Created
August 14, 2017 02:23
-
-
Save 6174/dc336af11e00091dfb727bce7deabaa9 to your computer and use it in GitHub Desktop.
gojs parsed source
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(window) { | |
var g, da = {}; | |
if (!window.document || void 0 === window.document.createElement("canvas").getContext) { | |
throw window.console && window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."), Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode.") | |
} | |
if (!Object.defineProperty) { | |
throw Error("GoJS requires a newer version of JavaScript") | |
} | |
Function.prototype.bind || (Function.prototype.bind = function(a) { | |
function b() { | |
return f.apply(a, e.concat(d.call(arguments))) | |
} | |
function c() {} | |
var d = Array.prototype.slice, | |
e = d.call(arguments, 1), | |
f = this; | |
c.prototype = this.prototype; | |
b.prototype = new c; | |
return b | |
}); | |
(function() { | |
for (var a = 0, b = ["ms", "moz", "webkit", "o"], c = 0; c < b.length && !window.requestAnimationFrame; ++c) { | |
window.requestAnimationFrame = window[b[c] + "RequestAnimationFrame"], window.cancelAnimationFrame = window[b[c] + "CancelAnimationFrame"] || window[b[c] + "CancelRequestAnimationFrame"] | |
} | |
window.requestAnimationFrame || (window.requestAnimationFrame = function(b) { | |
var c = (new Date).getTime(), | |
f = Math.max(8, 16 - (c - a)), | |
h = window.setTimeout(function() { | |
b(c + f) | |
}, f); | |
a = c + f; | |
return h | |
}); | |
window.cancelAnimationFrame || (window.cancelAnimationFrame = function(a) { | |
window.clearTimeout(a) | |
}) | |
})(); | |
da.Debug = null; | |
var u = { | |
Yc: 1, | |
Ec: 2, | |
Nc: 4, | |
Mc: 8, | |
Hm: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("534.30") && 0 < window.navigator.userAgent.indexOf("Android"), | |
bH: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("MSIE 10.0"), | |
cH: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("Trident/7"), | |
IJ: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("Edge/"), | |
Im: void 0 !== window.navigator && void 0 !== window.navigator.platform && 0 <= window.navigator.platform.toUpperCase().indexOf("MAC"), | |
ND: void 0 !== window.navigator && void 0 !== window.navigator.platform && null !== window.navigator.platform.match(/(iPhone|iPod|iPad)/i), | |
hD: function(a, b, c) { | |
var d = -1; | |
return function() { | |
var e = this, | |
f = arguments; - 1 !== d && u.clearTimeout(d); | |
d = u.setTimeout(function() { | |
d = -1; | |
c || a.apply(e, f) | |
}, b); | |
c && !d && a.apply(e, f) | |
} | |
}, | |
setTimeout: function(a, b) { | |
return window.setTimeout(a, b) | |
}, | |
clearTimeout: function(a) { | |
window.clearTimeout(a) | |
}, | |
setInterval: function(a, b) { | |
return window.setInterval(a, b) | |
}, | |
clearInterval: function(a) { | |
window.clearInterval(a) | |
}, | |
createElement: function(a) { | |
return window.document.createElement(a) | |
}, | |
k: function(a) { | |
throw Error(a) | |
}, | |
J: function(a, b) { | |
if (a.Ea) { | |
var c = "The object is frozen, so its properties cannot be set: " + a.toString(); | |
void 0 !== b && (c += " to value: " + b); | |
u.k(c) | |
} | |
}, | |
C: function(a, b, c, d) { | |
a instanceof b || (c = u.getTypeName(c), void 0 !== d && (c += "." + d), u.Ld(a, b, c)) | |
}, | |
j: function(a, b, c, d) { | |
typeof a !== b && (c = u.getTypeName(c), void 0 !== d && (c += "." + d), u.Ld(a, b, c)) | |
}, | |
Be: function(a, b, c) { | |
"number" === typeof a && isFinite(a) || (b = u.getTypeName(b), void 0 !== c && (b += "." + c), u.k(b + " must be a real number type, and not NaN or Infinity: " + a)) | |
}, | |
rb: function(a, b, c, d) { | |
a instanceof ea && a.Ce === b || (c = u.getTypeName(c), void 0 !== d && (c += "." + d), u.Ld(a, "a constant of class " + u.tg(b), c)) | |
}, | |
gJ: function(a, b) { | |
"string" === typeof a ? fa(a) || u.k('Color "' + a + '" is not a valid color string for ' + b) : a instanceof ga || u.k("Value for " + b + " must be a color string or a Brush, not " + a) | |
}, | |
Ld: function(a, b, c, d) { | |
b = u.getTypeName(b); | |
c = u.getTypeName(c); | |
void 0 !== d && (c += "." + d); | |
"string" === typeof a ? u.k(c + " value is not an instance of " + b + ': "' + a + '"') : u.k(c + " value is not an instance of " + b + ": " + a) | |
}, | |
xa: function(a, b, c, d) { | |
c = u.getTypeName(c); | |
void 0 !== d && (c += "." + d); | |
u.k(c + " is not in the range " + b + ": " + a) | |
}, | |
Xc: function(a) { | |
u.k(u.tg(a) + " constructor cannot take any arguments.") | |
}, | |
Nb: function(a) { | |
u.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) | |
}, | |
Ta: function(a) { | |
return "object" === typeof a && null !== a | |
}, | |
isArray: function(a) { | |
return Array.isArray(a) || a instanceof NodeList || a instanceof HTMLCollection | |
}, | |
eH: function(a) { | |
return Array.isArray(a) | |
}, | |
Sy: function(a, b, c) { | |
u.isArray(a) || u.Ld(a, "Array or NodeList or HTMLCollection", b, c) | |
}, | |
qb: function(a) { | |
return a.length | |
}, | |
Pk: function(a) { | |
return Array.prototype.slice.call(a) | |
}, | |
ib: function(a, b) { | |
Array.isArray(a); | |
return a[b] | |
}, | |
RC: function(a, b, c) { | |
Array.isArray(a) ? a[b] = c : u.k("Cannot replace an object in an HTMLCollection or NodeList at " + b) | |
}, | |
Ry: 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 | |
}, | |
zi: function(a, b, c) { | |
Array.isArray(a) ? b >= a.length ? a.push(c) : a.splice(b, 0, c) : u.k("Cannot insert an object into an HTMLCollection or NodeList: " + c + " at " + b) | |
}, | |
Ai: function(a, b) { | |
Array.isArray(a) ? b >= a.length ? a.pop() : a.splice(b, 1) : u.k("Cannot remove an object from an HTMLCollection or NodeList at " + b) | |
}, | |
Yw: [], | |
K: function() { | |
var a = u.Yw.pop(); | |
return void 0 === a ? new w : a | |
}, | |
Yb: function(a, b) { | |
var c = u.Yw.pop(); | |
if (void 0 === c) { | |
return new w(a, b) | |
} | |
c.x = a; | |
c.y = b; | |
return c | |
}, | |
v: function(a) { | |
u.Yw.push(a) | |
}, | |
yA: [], | |
vl: function() { | |
var a = u.yA.pop(); | |
return void 0 === a ? new ia : a | |
}, | |
Oj: function(a) { | |
u.yA.push(a) | |
}, | |
Zw: [], | |
Tf: function() { | |
var a = u.Zw.pop(); | |
return void 0 === a ? new z : a | |
}, | |
Vj: function(a, b, c, d) { | |
var e = u.Zw.pop(); | |
if (void 0 === e) { | |
return new z(a, b, c, d) | |
} | |
e.x = a; | |
e.y = b; | |
e.width = c; | |
e.height = d; | |
return e | |
}, | |
ic: function(a) { | |
u.Zw.push(a) | |
}, | |
zA: [], | |
lh: function() { | |
var a = u.zA.pop(); | |
return void 0 === a ? new ja : a | |
}, | |
Ze: function(a) { | |
u.zA.push(a) | |
}, | |
$w: null, | |
p: function() { | |
var a = u.$w; | |
return null !== a ? (u.$w = null, a) : new ka | |
}, | |
q: function(a) { | |
a.reset(); | |
u.$w = a | |
}, | |
xA: [], | |
hb: function() { | |
var a = u.xA.pop(); | |
return void 0 === a ? [] : a | |
}, | |
sa: function(a) { | |
a.length = 0; | |
u.xA.push(a) | |
}, | |
nh: Object.freeze([]), | |
zl: 1, | |
gc: function(a) { | |
a.__gohashid = u.zl++ | |
}, | |
Js: function(a) { | |
var b = a.__gohashid; | |
void 0 === b && (b = u.zl++, a.__gohashid = b); | |
return b | |
}, | |
Uc: function(a) { | |
return a.__gohashid | |
}, | |
fa: function(a, b) { | |
b.jx = a; | |
da[a] = b | |
}, | |
Ha: function(a, b) { | |
function c() {} | |
c.prototype = b.prototype; | |
a.prototype = new c; | |
a.prototype.constructor = a | |
}, | |
Nh: function(a) { | |
a.BF = !0 | |
}, | |
defineProperty: function(a, b, c, d, e) { | |
u.j(a, "function", "Util.defineProperty:classfunc"); | |
u.j(b, "object", "Util.defineProperty:propobj"); | |
u.j(c, "function", "Util.defineProperty:getter"); | |
u.j(d, "function", "Util.defineProperty:setter"); | |
for (var f in b) { | |
b = b[f]; | |
c = { | |
get: c, | |
set: d | |
}; | |
if (void 0 !== e) { | |
for (var h in e) { | |
c[h] = e[h] | |
} | |
} | |
Object.defineProperty(a.prototype, f, c); | |
e = Object.getOwnPropertyDescriptor(a.prototype, f); | |
b && e && Object.defineProperty(a.prototype, b, e); | |
break | |
} | |
}, | |
II: !1, | |
u: function(a, b, c, d) { | |
u.j(a, "function", "Util.defineReadOnlyProperty:classfunc"); | |
u.j(b, "object", "Util.defineReadOnlyProperty:propobj"); | |
u.j(c, "function", "Util.defineReadOnlyProperty:getter"); | |
for (var e in b) { | |
var f = b[e]; | |
b = { | |
get: c, | |
set: function(a) { | |
u.k('The property "' + f + '" is read-only and cannot be set to ' + a) | |
} | |
}; | |
if (void 0 !== d) { | |
for (var h in d) { | |
b[h] = d[h] | |
} | |
} | |
Object.defineProperty(a.prototype, e, b); | |
d = Object.getOwnPropertyDescriptor(a.prototype, e); | |
f && d && Object.defineProperty(a.prototype, f, d); | |
break | |
} | |
}, | |
Yd: function(a, b) { | |
for (var c in b) { | |
b[c] = !0 | |
} | |
a.prototype.UB = b | |
}, | |
getTypeName: function(a) { | |
return void 0 === a ? "" : "string" === typeof a ? a : "function" === typeof a ? u.tg(a) : null === a ? "*" : "" | |
}, | |
tg: function(a) { | |
if ("function" === typeof a) { | |
if (a.jx) { | |
return a.jx | |
} | |
if (a.name) { | |
return a.name | |
} | |
var b = a.toString(), | |
c = b.indexOf("("), | |
b = b.substring(9, c).trim(); | |
if ("" !== b) { | |
return a.jx = b | |
} | |
} else { | |
if ("object" === typeof a && a.constructor) { | |
return u.tg(a.constructor) | |
} | |
} | |
return typeof a | |
}, | |
s: function(a, b, c) { | |
u.j(a, "function", "Util.defineEnumValue:classfunc"); | |
u.j(b, "string", "Util.defineEnumValue:name"); | |
u.j(c, "number", "Util.defineEnumValue:num"); | |
c = new ea(a, b, c); | |
Object.freeze(c); | |
a[b] = c; | |
var d = a.Et; | |
d instanceof la || (d = new la("string", ea), a.Et = d); | |
d.add(b, c); | |
return c | |
}, | |
sb: function(a, b) { | |
if (!a || !b) { | |
return null | |
} | |
var c = void 0; | |
try { | |
"function" === typeof b ? c = b(a) : "function" === typeof a.getAttribute ? (c = a.getAttribute(b), null === c && (c = void 0)) : c = a[b] | |
} catch (d) {} | |
return c | |
}, | |
Pa: 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) {} | |
} | |
}, | |
pt: function(a, b) { | |
u.j(a, "object", "Setting properties requires Objects as arguments"); | |
u.j(b, "object", "Setting properties requires Objects as arguments"); | |
var c = a instanceof B, | |
d = a instanceof D, | |
e; | |
for (e in b) { | |
"" === e && u.k("Setting properties requires non-empty property names"); | |
var f = a, | |
h = e; | |
if (c || d) { | |
var k = e.indexOf("."); | |
if (0 < k) { | |
var l = e.substring(0, k); | |
if (c) { | |
f = a.ke(l) | |
} else { | |
if (f = a[l], void 0 === f || null === f) { | |
f = a.tb[l] | |
} | |
} | |
u.Ta(f) ? h = e.substr(k + 1) : u.k("Unable to find object named: " + l + " in " + a.toString() + " when trying to set property: " + e) | |
} | |
} | |
if ("_" !== h[0] && !u.kz(f, h)) { | |
if (d && u.kz(a.tb, h)) { | |
f = a.tb | |
} else { | |
if (d && ma(a, h)) { | |
a.My(h, b[h]); | |
continue | |
} else { | |
u.k('Trying to set undefined property "' + h + '" on object: ' + f.toString()) | |
} | |
} | |
} | |
f[h] = b[e]; | |
"_" === h[0] && (k = f.Fl, u.isArray(k) || (k = [], f.Fl = k), k.push(h)) | |
} | |
}, | |
kz: 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.UB; | |
if (d && d[b]) { | |
return !0 | |
} | |
c = Object.getPrototypeOf(c) | |
} | |
return !1 | |
}, | |
VC: function(a, b) { | |
if (!u.Ta(b) || b instanceof Element || b instanceof CanvasRenderingContext2D || b instanceof oa || b instanceof pa) { | |
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 = u.sb(b, d); | |
null === e || "function" === typeof e || u.kz(b, d) || ("" === c && (c = b + "\n"), c += ' unknown property "' + d + '" has value: ' + e + " at " + a + "\n") | |
} | |
} | |
} | |
return c | |
}, | |
Lv: function(a, b) { | |
if (null !== b && "number" !== typeof b && "string" !== typeof b && "boolean" !== typeof b && "function" !== typeof b) { | |
if (void 0 !== u.Uc(b)) { | |
if (!u.dv.contains(b)) { | |
if (u.dv.add(b), u.Lu.add(u.VC(a, b)), b instanceof E || b instanceof F || b instanceof la) { | |
for (var c = b.i; c.next();) { | |
u.Lv(a + "[" + c.key + "]", c.value) | |
} | |
} else { | |
for (c in b) { | |
var d = u.sb(b, c); | |
if (void 0 !== d && null !== d && u.Ta(d) && d !== b.UB) { | |
if (b instanceof qa) { | |
if (d === b.ej) { | |
continue | |
} | |
} else { | |
if (b instanceof B) { | |
if ("data" === c || d === b.sh) { | |
continue | |
} | |
if ("itemArray" === c || d === b.hi) { | |
continue | |
} | |
if (b instanceof G && d === b.Bk) { | |
continue | |
} | |
} else { | |
if (!(b instanceof D)) { | |
if (b instanceof sa) { | |
if ("archetypeGroupData" === c || d === b.ex) { | |
continue | |
} | |
} else { | |
if (b instanceof ta) { | |
if ("archetypeLinkData" === c || d === b.hx) { | |
continue | |
} | |
if ("archetypeLabelNodeData" === c || d === b.gx) { | |
continue | |
} | |
} else { | |
if (b instanceof va) { | |
if ("archetypeNodeData" === c || d === b.ik) { | |
continue | |
} | |
} else { | |
if (b instanceof J) { | |
if ("nodeDataArray" === c || d === b.of) { | |
continue | |
} | |
if ("linkDataArray" === c || d === b.Dh || d === b.Vl) { | |
continue | |
} | |
if (d === b.sc) { | |
continue | |
} | |
if (d === b.wh) { | |
continue | |
} | |
} else { | |
if (b instanceof xa || b instanceof ya || b instanceof Aa) { | |
continue | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
u.Lv(a + "." + c, d) | |
} | |
} | |
} | |
} | |
} else { | |
if (Array.isArray(b)) { | |
for (c = 0; c < b.length; c++) { | |
u.Lv(a + "[" + c + "]", b[c]) | |
} | |
} else { | |
u.Lu.add(u.VC(a, b)) | |
} | |
} | |
} | |
}, | |
check: function(a) { | |
void 0 === u.dv ? u.dv = new F(Object) : u.dv.clear(); | |
u.Lu = new Ca; | |
u.Lv("", a); | |
a = u.Lu.toString(); | |
u.Lu = null; | |
return a | |
}, | |
RH: function(a) { | |
for (var b = [], c = 0; 256 > c; c++) { | |
b[c] = c | |
} | |
for (var d = 0, e = 0, c = 0; 256 > c; c++) { | |
d = (d + b[c] + 119) % 256, e = b[c], b[c] = b[d], b[d] = e | |
} | |
for (var d = c = 0, f = "", h = 0; h < a.length; h++) { | |
c = (c + 1) % 256, d = (d + b[c]) % 256, e = b[c], b[c] = b[d], b[d] = e, f += String.fromCharCode(a.charCodeAt(h) ^ b[(b[c] + b[d]) % 256]) | |
} | |
return f | |
}, | |
QG: 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 | |
}, | |
Fa: function(a) { | |
return u.RH(u.QG(a)) | |
}, | |
xl: null, | |
adym: "7da71ca0ad381e90", | |
YF: "@COLOR1", | |
ZF: "@COLOR2" | |
}; | |
u.xl = function() { | |
var a = window.document.createElement("canvas"), | |
b = a.getContext("2d"); | |
b[u.Fa("7ca11abfd022028846")] = u.Fa("398c3597c01238"); | |
for (var c = ["5da73c80a3330d854f9e5e671d6633", "32ab5ff3b26f42dc0ed90f22422913b54ae6247590da4bb21c324ba3a84e385776", "54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387", "74bf19bce72555874c86"], d = 1; 5 > d; d++) { | |
b[u.Fa("7ca11abfd7330390")](u.Fa(c[d - 1]), 10, 15 * d + 0) | |
} | |
b[u.Fa("7ca11abfd022028846")] = u.Fa("39f046ebb36e4b"); | |
for (d = 1; 5 > d; d++) { | |
b[u.Fa("7ca11abfd7330390")](u.Fa(c[d - 1]), 10, 15 * d + 0) | |
} | |
if (4 !== c.length || "5" !== c[0][0] || "7" !== c[3][0]) { | |
u.s = function(a, b) { | |
var c = new ea(a, b, 2); | |
Object.freeze(c); | |
a[b] = c; | |
var d = a.Et; | |
d instanceof la || (d = new la("string", ea), a.Et = d); | |
d.add(b, c); | |
return c | |
} | |
} | |
return a | |
}(); | |
function ea(a, b, c) { | |
u.gc(this); | |
this.HA = a; | |
this.Vb = b; | |
this.GF = c | |
} | |
ea.prototype.toString = function() { | |
return u.tg(this.HA) + "." + this.Vb | |
}; | |
u.u(ea, { | |
Ce: "classType" | |
}, function() { | |
return this.HA | |
}); | |
u.u(ea, { | |
name: "name" | |
}, function() { | |
return this.Vb | |
}); | |
u.u(ea, { | |
value: "value" | |
}, function() { | |
return this.GF | |
}); | |
var Da; | |
ea.findName = Da = function(a, b) { | |
if (null === b || "" === b) { | |
return null | |
} | |
u.j(a, "function", "findName:classfunc"); | |
u.j(b, "string", "EnumValue.findName:name"); | |
var c = a.Et; | |
return c instanceof la ? c.ua(b) : null | |
}; | |
function Ca() { | |
this.FA = [] | |
} | |
Ca.prototype.toString = function() { | |
return this.FA.join("") | |
}; | |
Ca.prototype.add = function(a) { | |
"" !== a && this.FA.push(a) | |
}; | |
function pa() {} | |
function Fa(a) { | |
void 0 === a && (a = 42); | |
this.seed = a; | |
this.Rw = 48271; | |
this.Dt = 2147483647; | |
this.vA = this.Dt / this.Rw; | |
this.hF = this.Dt % this.Rw; | |
this.dF = 1 / this.Dt; | |
this.random() | |
} | |
Fa.prototype.random = function() { | |
var a = this.seed % this.vA * this.Rw - this.seed / this.vA * this.hF; | |
this.seed = 0 < a ? a : a + this.Dt; | |
return this.seed * this.dF | |
}; | |
function Ha() {} | |
u.u(Ha, { | |
i: "iterator" | |
}, function() { | |
return this | |
}); | |
Ha.prototype.reset = Ha.prototype.reset = function() {}; | |
Ha.prototype.next = Ha.prototype.hasNext = Ha.prototype.next = function() { | |
return !1 | |
}; | |
Ha.prototype.first = Ha.prototype.first = function() { | |
return null | |
}; | |
Ha.prototype.any = function() { | |
return !1 | |
}; | |
Ha.prototype.all = function() { | |
return !0 | |
}; | |
Ha.prototype.each = function() {}; | |
u.u(Ha, { | |
count: "count" | |
}, function() { | |
return 0 | |
}); | |
Ha.prototype.Xf = function() {}; | |
Ha.prototype.toString = function() { | |
return "EmptyIterator" | |
}; | |
var Ia = new Ha; | |
function Ja(a) { | |
this.key = -1; | |
this.value = a | |
} | |
u.Yd(Ja, { | |
key: !0, | |
value: !0 | |
}); | |
u.u(Ja, { | |
i: "iterator" | |
}, function() { | |
return this | |
}); | |
Ja.prototype.reset = Ja.prototype.reset = function() { | |
this.key = -1 | |
}; | |
Ja.prototype.next = Ja.prototype.hasNext = Ja.prototype.next = function() { | |
return -1 === this.key ? (this.key = 0, !0) : !1 | |
}; | |
Ja.prototype.first = Ja.prototype.first = function() { | |
this.key = 0; | |
return this.value | |
}; | |
Ja.prototype.any = function(a) { | |
this.key = -1; | |
return a(this.value) | |
}; | |
Ja.prototype.all = function(a) { | |
this.key = -1; | |
return a(this.value) | |
}; | |
Ja.prototype.each = function(a) { | |
this.key = -1; | |
a(this.value) | |
}; | |
u.u(Ja, { | |
count: "count" | |
}, function() { | |
return 1 | |
}); | |
Ja.prototype.Xf = function() { | |
this.value = null | |
}; | |
Ja.prototype.toString = function() { | |
return "SingletonIterator(" + this.value + ")" | |
}; | |
function Ka(a) { | |
this.zd = a; | |
this.sj = null; | |
this.reset() | |
} | |
u.Yd(Ka, { | |
key: !0, | |
value: !0 | |
}); | |
u.u(Ka, { | |
i: "iterator" | |
}, function() { | |
return this | |
}); | |
u.defineProperty(Ka, { | |
Om: "predicate" | |
}, function() { | |
return this.sj | |
}, function(a) { | |
this.sj = a | |
}); | |
Ka.prototype.reset = Ka.prototype.reset = function() { | |
var a = this.zd; | |
a.yd = null; | |
this.Ya = a.T; | |
this.wd = -1 | |
}; | |
Ka.prototype.next = Ka.prototype.hasNext = Ka.prototype.next = function() { | |
var a = this.zd; | |
if (a.T !== this.Ya) { | |
if (0 > this.key) { | |
return !1 | |
} | |
u.Nb(a) | |
} | |
var a = a.n, | |
b = a.length, | |
c = ++this.wd, | |
d = this.sj; | |
if (null !== d) { | |
for (; c < b;) { | |
var e = a[c]; | |
if (d(e)) { | |
return this.key = this.wd = c, this.value = e, !0 | |
} | |
c++ | |
} | |
} else { | |
if (c < b) { | |
return this.key = c, this.value = a[c], !0 | |
} | |
this.Xf() | |
} | |
return !1 | |
}; | |
Ka.prototype.first = Ka.prototype.first = function() { | |
var a = this.zd; | |
this.Ya = a.T; | |
this.wd = 0; | |
var a = a.n, | |
b = a.length, | |
c = this.sj; | |
if (null !== c) { | |
for (var d = 0; d < b;) { | |
var e = a[d]; | |
if (c(e)) { | |
return this.key = this.wd = d, this.value = e | |
} | |
d++ | |
} | |
return null | |
} | |
return 0 < b ? (e = a[0], this.key = 0, this.value = e) : null | |
}; | |
Ka.prototype.any = function(a) { | |
var b = this.zd; | |
b.yd = null; | |
var c = b.T; | |
this.wd = -1; | |
for (var d = b.n, e = d.length, f = this.sj, h = 0; h < e; h++) { | |
var k = d[h]; | |
if (null === f || f(k)) { | |
if (a(k)) { | |
return !0 | |
} | |
b.T !== c && u.Nb(b) | |
} | |
} | |
return !1 | |
}; | |
Ka.prototype.all = function(a) { | |
var b = this.zd; | |
b.yd = null; | |
var c = b.T; | |
this.wd = -1; | |
for (var d = b.n, e = d.length, f = this.sj, h = 0; h < e; h++) { | |
var k = d[h]; | |
if (null === f || f(k)) { | |
if (!a(k)) { | |
return !1 | |
} | |
b.T !== c && u.Nb(b) | |
} | |
} | |
return !0 | |
}; | |
Ka.prototype.each = function(a) { | |
var b = this.zd; | |
b.yd = null; | |
var c = b.T; | |
this.wd = -1; | |
for (var d = b.n, e = d.length, f = this.sj, h = 0; h < e; h++) { | |
var k = d[h]; | |
if (null === f || f(k)) { | |
a(k), b.T !== c && u.Nb(b) | |
} | |
} | |
}; | |
u.u(Ka, { | |
count: "count" | |
}, function() { | |
var a = this.sj; | |
if (null !== a) { | |
for (var b = 0, c = this.zd.n, d = c.length, e = 0; e < d; e++) { | |
a(c[e]) && b++ | |
} | |
return b | |
} | |
return this.zd.n.length | |
}); | |
Ka.prototype.Xf = function() { | |
this.key = -1; | |
this.value = null; | |
this.Ya = -1; | |
this.sj = null; | |
this.zd.yd = this | |
}; | |
Ka.prototype.toString = function() { | |
return "ListIterator@" + this.wd + "/" + this.zd.count | |
}; | |
function La(a) { | |
this.zd = a; | |
this.reset() | |
} | |
u.Yd(La, { | |
key: !0, | |
value: !0 | |
}); | |
u.u(La, { | |
i: "iterator" | |
}, function() { | |
return this | |
}); | |
La.prototype.reset = La.prototype.reset = function() { | |
var a = this.zd; | |
a.Kn = null; | |
this.Ya = a.T; | |
this.wd = a.n.length | |
}; | |
La.prototype.next = La.prototype.hasNext = La.prototype.next = function() { | |
var a = this.zd; | |
if (a.T !== this.Ya) { | |
if (0 > this.key) { | |
return !1 | |
} | |
u.Nb(a) | |
} | |
var b = --this.wd; | |
if (0 <= b) { | |
return this.key = b, this.value = a.n[b], !0 | |
} | |
this.Xf(); | |
return !1 | |
}; | |
La.prototype.first = La.prototype.first = function() { | |
var a = this.zd; | |
this.Ya = a.T; | |
var b = a.n; | |
this.wd = a = b.length - 1; | |
return 0 <= a ? (b = b[a], this.key = a, this.value = b) : null | |
}; | |
La.prototype.any = function(a) { | |
var b = this.zd; | |
b.Kn = null; | |
var c = b.T, | |
d = b.n, | |
e = d.length; | |
this.wd = e; | |
for (e -= 1; 0 <= e; e--) { | |
if (a(d[e])) { | |
return !0 | |
} | |
b.T !== c && u.Nb(b) | |
} | |
return !1 | |
}; | |
La.prototype.all = function(a) { | |
var b = this.zd; | |
b.Kn = null; | |
var c = b.T, | |
d = b.n, | |
e = d.length; | |
this.wd = e; | |
for (e -= 1; 0 <= e; e--) { | |
if (!a(d[e])) { | |
return !1 | |
} | |
b.T !== c && u.Nb(b) | |
} | |
return !0 | |
}; | |
La.prototype.each = function(a) { | |
var b = this.zd; | |
b.Kn = null; | |
var c = b.T, | |
d = b.n, | |
e = d.length; | |
this.wd = e; | |
for (e -= 1; 0 <= e; e--) { | |
a(d[e]), b.T !== c && u.Nb(b) | |
} | |
}; | |
u.u(La, { | |
count: "count" | |
}, function() { | |
return this.zd.n.length | |
}); | |
La.prototype.Xf = function() { | |
this.key = -1; | |
this.value = null; | |
this.Ya = -1; | |
this.zd.Kn = this | |
}; | |
La.prototype.toString = function() { | |
return "ListIteratorBackwards(" + this.wd + "/" + this.zd.count + ")" | |
}; | |
function E(a) { | |
u.gc(this); | |
this.Ea = !1; | |
this.n = []; | |
this.T = 0; | |
this.Kn = this.yd = null; | |
void 0 === a || null === a ? this.pa = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a || "boolean" === a || "function" === a ? this.pa = a : u.xa(a, "the string 'object', 'number', 'string', 'boolean', or 'function'", "List constructor: type") : "function" === typeof a ? this.pa = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a === Boolean ? "boolean" : a === Function ? "function" : a : u.xa(a, "null, a primitive type name, or a class type", "List constructor: type") | |
} | |
u.fa("List", E); | |
E.prototype.Qd = function() { | |
var a = this.T; | |
a++; | |
999999999 < a && (a = 0); | |
this.T = a | |
}; | |
E.prototype.freeze = E.prototype.freeze = function() { | |
this.Ea = !0; | |
return this | |
}; | |
E.prototype.thaw = E.prototype.Ma = function() { | |
this.Ea = !1; | |
return this | |
}; | |
E.prototype.toString = function() { | |
return "List(" + u.getTypeName(this.pa) + ")#" + u.Uc(this) | |
}; | |
E.prototype.add = E.prototype.push = E.prototype.add = function(a) { | |
null !== a && (u.J(this, a), this.n.push(a), this.Qd()) | |
}; | |
E.prototype.addAll = E.prototype.Ud = function(a) { | |
if (null === a) { | |
return this | |
} | |
u.J(this); | |
var b = this.n; | |
if (u.isArray(a)) { | |
for (var c = u.qb(a), d = 0; d < c; d++) { | |
var e = u.ib(a, d); | |
b.push(e) | |
} | |
} else { | |
for (a = a.i; a.next();) { | |
e = a.value, b.push(e) | |
} | |
} | |
this.Qd(); | |
return this | |
}; | |
E.prototype.clear = E.prototype.clear = function() { | |
u.J(this); | |
this.n.length = 0; | |
this.Qd() | |
}; | |
E.prototype.contains = E.prototype.has = E.prototype.contains = function(a) { | |
return null === a ? !1 : -1 !== this.n.indexOf(a) | |
}; | |
E.prototype.indexOf = E.prototype.indexOf = function(a) { | |
return null === a ? -1 : this.n.indexOf(a) | |
}; | |
E.prototype.elt = E.prototype.get = E.prototype.ja = function(a) { | |
var b = this.n; | |
(0 > a || a >= b.length) && u.xa(a, "0 <= i < length", E, "elt:i"); | |
return b[a] | |
}; | |
E.prototype.setElt = E.prototype.set = E.prototype.Dg = function(a, b) { | |
var c = this.n; | |
(0 > a || a >= c.length) && u.xa(a, "0 <= i < length", E, "setElt:i"); | |
u.J(this, a); | |
c[a] = b | |
}; | |
E.prototype.first = E.prototype.first = function() { | |
var a = this.n; | |
return 0 === a.length ? null : a[0] | |
}; | |
E.prototype.last = E.prototype.Jd = function() { | |
var a = this.n, | |
b = a.length; | |
return 0 < b ? a[b - 1] : null | |
}; | |
E.prototype.pop = E.prototype.pop = function() { | |
u.J(this); | |
var a = this.n; | |
return 0 < a.length ? a.pop() : null | |
}; | |
E.prototype.any = function(a) { | |
for (var b = this.n, c = this.T, d = b.length, e = 0; e < d; e++) { | |
if (a(b[e])) { | |
return !0 | |
} | |
this.T !== c && u.Nb(this) | |
} | |
return !1 | |
}; | |
E.prototype.all = function(a) { | |
for (var b = this.n, c = this.T, d = b.length, e = 0; e < d; e++) { | |
if (!a(b[e])) { | |
return !1 | |
} | |
this.T !== c && u.Nb(this) | |
} | |
return !0 | |
}; | |
E.prototype.each = function(a) { | |
for (var b = this.n, c = this.T, d = b.length, e = 0; e < d; e++) { | |
a(b[e]), this.T !== c && u.Nb(this) | |
} | |
}; | |
E.prototype.insertAt = E.prototype.Zd = function(a, b) { | |
0 > a && u.xa(a, ">= 0", E, "insertAt:i"); | |
u.J(this, a); | |
var c = this.n; | |
a >= c.length ? c.push(b) : c.splice(a, 0, b); | |
this.Qd(); | |
return !0 | |
}; | |
E.prototype.remove = E.prototype["delete"] = E.prototype.remove = function(a) { | |
if (null === a) { | |
return !1 | |
} | |
u.J(this, a); | |
var b = this.n; | |
a = b.indexOf(a); | |
if (-1 === a) { | |
return !1 | |
} | |
a === b.length - 1 ? b.pop() : b.splice(a, 1); | |
this.Qd(); | |
return !0 | |
}; | |
E.prototype.removeAt = E.prototype.kd = function(a) { | |
var b = this.n; | |
(0 > a || a >= b.length) && u.xa(a, "0 <= i < length", E, "removeAt:i"); | |
u.J(this, a); | |
a === b.length - 1 ? b.pop() : b.splice(a, 1); | |
this.Qd() | |
}; | |
E.prototype.removeRange = E.prototype.removeRange = function(a, b) { | |
var c = this.n; | |
(0 > a || a >= c.length) && u.xa(a, "0 <= from < length", E, "elt:from"); | |
(0 > b || b >= c.length) && u.xa(b, "0 <= to < length", E, "elt:to"); | |
u.J(this, a); | |
var d = c.slice((b || a) + 1 || c.length); | |
c.length = 0 > a ? c.length + a : a; | |
c.push.apply(c, d); | |
this.Qd() | |
}; | |
E.prototype.copy = function() { | |
for (var a = new E(this.pa), b = this.n, c = this.count, d = 0; d < c; d++) { | |
a.add(b[d]) | |
} | |
return a | |
}; | |
E.prototype.toArray = E.prototype.Le = function() { | |
for (var a = this.n, b = this.count, c = Array(b), d = 0; d < b; d++) { | |
c[d] = a[d] | |
} | |
return c | |
}; | |
E.prototype.toSet = function() { | |
for (var a = new F(this.pa), b = this.n, c = this.count, d = 0; d < c; d++) { | |
a.add(b[d]) | |
} | |
return a | |
}; | |
E.prototype.sort = E.prototype.sort = function(a) { | |
u.J(this); | |
this.n.sort(a); | |
this.Qd(); | |
return this | |
}; | |
E.prototype.sortRange = E.prototype.jp = function(a, b, c) { | |
var d = this.n, | |
e = d.length; | |
void 0 === b && (b = 0); | |
void 0 === c && (c = e); | |
u.J(this); | |
var f = c - b; | |
if (1 >= f) { | |
return this | |
}(0 > b || b >= e - 1) && u.xa(b, "0 <= from < length", E, "sortRange:from"); | |
if (2 === f) { | |
return c = d[b], e = d[b + 1], 0 < a(c, e) && (d[b] = e, d[b + 1] = c, this.Qd()), this | |
} | |
if (0 === b) { | |
if (c >= e) { | |
d.sort(a) | |
} else { | |
for (f = d.slice(0, c), f.sort(a), a = 0; a < c; a++) { | |
d[a] = f[a] | |
} | |
} | |
} else { | |
if (c >= e) { | |
for (f = d.slice(b), f.sort(a), a = b; a < e; a++) { | |
d[a] = f[a - b] | |
} | |
} else { | |
for (f = d.slice(b, c), f.sort(a), a = b; a < c; a++) { | |
d[a] = f[a - b] | |
} | |
} | |
} | |
this.Qd(); | |
return this | |
}; | |
E.prototype.reverse = E.prototype.reverse = function() { | |
u.J(this); | |
this.n.reverse(); | |
this.Qd(); | |
return this | |
}; | |
u.u(E, { | |
count: "count" | |
}, function() { | |
return this.n.length | |
}); | |
u.u(E, { | |
size: "size" | |
}, function() { | |
return this.n.length | |
}); | |
u.u(E, { | |
length: "length" | |
}, function() { | |
return this.n.length | |
}); | |
u.u(E, { | |
i: "iterator" | |
}, function() { | |
if (0 >= this.n.length) { | |
return Ia | |
} | |
var a = this.yd; | |
return null !== a ? (a.reset(), a) : new Ka(this) | |
}); | |
u.u(E, { | |
Jm: "iteratorBackwards" | |
}, function() { | |
if (0 >= this.n.length) { | |
return Ia | |
} | |
var a = this.Kn; | |
return null !== a ? (a.reset(), a) : new La(this) | |
}); | |
function Ma(a) { | |
this.Gk = a; | |
this.reset() | |
} | |
u.Yd(Ma, { | |
key: !0, | |
value: !0 | |
}); | |
u.u(Ma, { | |
i: "iterator" | |
}, function() { | |
return this | |
}); | |
Ma.prototype.reset = Ma.prototype.reset = function() { | |
var a = this.Gk; | |
a.yd = null; | |
this.Ya = a.T; | |
this.Cb = null | |
}; | |
Ma.prototype.next = Ma.prototype.hasNext = Ma.prototype.next = function() { | |
var a = this.Gk; | |
if (a.T !== this.Ya) { | |
if (null === this.key) { | |
return !1 | |
} | |
u.Nb(a) | |
} | |
var b = this.Cb, | |
b = null === b ? a.cb : b.Sb; | |
if (null !== b) { | |
return this.Cb = b, this.value = b.value, this.key = b.key, !0 | |
} | |
this.Xf(); | |
return !1 | |
}; | |
Ma.prototype.first = Ma.prototype.first = function() { | |
var a = this.Gk; | |
this.Ya = a.T; | |
a = a.cb; | |
if (null !== a) { | |
this.Cb = a; | |
var b = a.value; | |
this.key = a.key; | |
return this.value = b | |
} | |
return null | |
}; | |
Ma.prototype.any = function(a) { | |
var b = this.Gk; | |
b.yd = null; | |
var c = b.T; | |
this.Cb = null; | |
for (var d = b.cb; null !== d;) { | |
if (a(d.value)) { | |
return !0 | |
} | |
b.T !== c && u.Nb(b); | |
d = d.Sb | |
} | |
return !1 | |
}; | |
Ma.prototype.all = function(a) { | |
var b = this.Gk; | |
b.yd = null; | |
var c = b.T; | |
this.Cb = null; | |
for (var d = b.cb; null !== d;) { | |
if (!a(d.value)) { | |
return !1 | |
} | |
b.T !== c && u.Nb(b); | |
d = d.Sb | |
} | |
return !0 | |
}; | |
Ma.prototype.each = function(a) { | |
var b = this.Gk; | |
b.yd = null; | |
var c = b.T; | |
this.Cb = null; | |
for (var d = b.cb; null !== d;) { | |
a(d.value), b.T !== c && u.Nb(b), d = d.Sb | |
} | |
}; | |
u.u(Ma, { | |
count: "count" | |
}, function() { | |
return this.Gk.$c | |
}); | |
Ma.prototype.Xf = function() { | |
this.value = this.key = null; | |
this.Ya = -1; | |
this.Gk.yd = this | |
}; | |
Ma.prototype.toString = function() { | |
return null !== this.Cb ? "SetIterator@" + this.Cb.value : "SetIterator" | |
}; | |
function F(a) { | |
u.gc(this); | |
this.Ea = !1; | |
void 0 === a || null === a ? this.pa = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.pa = a : u.xa(a, "the string 'object', 'number' or 'string'", "Set constructor: type") : "function" === typeof a ? this.pa = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : u.xa(a, "null, a primitive type name, or a class type", "Set constructor: type"); | |
this.ad = {}; | |
this.$c = 0; | |
this.yd = null; | |
this.T = 0; | |
this.Ch = this.cb = null | |
} | |
u.fa("Set", F); | |
F.prototype.Qd = function() { | |
var a = this.T; | |
a++; | |
999999999 < a && (a = 0); | |
this.T = a | |
}; | |
F.prototype.freeze = F.prototype.freeze = function() { | |
this.Ea = !0; | |
return this | |
}; | |
F.prototype.thaw = F.prototype.Ma = function() { | |
this.Ea = !1; | |
return this | |
}; | |
F.prototype.toString = function() { | |
return "Set(" + u.getTypeName(this.pa) + ")#" + u.Uc(this) | |
}; | |
F.prototype.add = F.prototype.add = function(a) { | |
if (null === a) { | |
return !1 | |
} | |
u.J(this, a); | |
var b = a; | |
u.Ta(a) && (b = u.Js(a)); | |
return void 0 === this.ad[b] ? (this.$c++, a = new Pa(a, a), this.ad[b] = a, b = this.Ch, null === b ? this.cb = a : (a.Wn = b, b.Sb = a), this.Ch = a, this.Qd(), !0) : !1 | |
}; | |
F.prototype.addAll = F.prototype.Ud = function(a) { | |
if (null === a) { | |
return this | |
} | |
u.J(this); | |
if (u.isArray(a)) { | |
for (var b = u.qb(a), c = 0; c < b; c++) { | |
this.add(u.ib(a, c)) | |
} | |
} else { | |
for (a = a.i; a.next();) { | |
this.add(a.value) | |
} | |
} | |
return this | |
}; | |
F.prototype.contains = F.prototype.has = F.prototype.contains = function(a) { | |
if (null === a) { | |
return !1 | |
} | |
var b = a; | |
return u.Ta(a) && (b = u.Uc(a), void 0 === b) ? !1 : void 0 !== this.ad[b] | |
}; | |
F.prototype.containsAll = function(a) { | |
if (null === a) { | |
return !0 | |
} | |
for (a = a.i; a.next();) { | |
if (!this.contains(a.value)) { | |
return !1 | |
} | |
} | |
return !0 | |
}; | |
F.prototype.containsAny = function(a) { | |
if (null === a) { | |
return !0 | |
} | |
for (a = a.i; a.next();) { | |
if (this.contains(a.value)) { | |
return !0 | |
} | |
} | |
return !1 | |
}; | |
F.prototype.first = F.prototype.first = function() { | |
var a = this.cb; | |
return null === a ? null : a.value | |
}; | |
F.prototype.any = function(a) { | |
for (var b = this.T, c = this.cb; null !== c;) { | |
if (a(c.value)) { | |
return !0 | |
} | |
this.T !== b && u.Nb(this); | |
c = c.Sb | |
} | |
return !1 | |
}; | |
F.prototype.all = function(a) { | |
for (var b = this.T, c = this.cb; null !== c;) { | |
if (!a(c.value)) { | |
return !1 | |
} | |
this.T !== b && u.Nb(this); | |
c = c.Sb | |
} | |
return !0 | |
}; | |
F.prototype.each = function(a) { | |
for (var b = this.T, c = this.cb; null !== c;) { | |
a(c.value), this.T !== b && u.Nb(this), c = c.Sb | |
} | |
}; | |
F.prototype.remove = F.prototype["delete"] = F.prototype.remove = function(a) { | |
if (null === a) { | |
return !1 | |
} | |
u.J(this, a); | |
var b = a; | |
if (u.Ta(a) && (b = u.Uc(a), void 0 === b)) { | |
return !1 | |
} | |
a = this.ad[b]; | |
if (void 0 === a) { | |
return !1 | |
} | |
var c = a.Sb, | |
d = a.Wn; | |
null !== c && (c.Wn = d); | |
null !== d && (d.Sb = c); | |
this.cb === a && (this.cb = c); | |
this.Ch === a && (this.Ch = d); | |
delete this.ad[b]; | |
this.$c--; | |
this.Qd(); | |
return !0 | |
}; | |
F.prototype.removeAll = F.prototype.kE = function(a) { | |
if (null === a) { | |
return this | |
} | |
u.J(this); | |
if (u.isArray(a)) { | |
for (var b = u.qb(a), c = 0; c < b; c++) { | |
this.remove(u.ib(a, c)) | |
} | |
} else { | |
for (a = a.i; a.next();) { | |
this.remove(a.value) | |
} | |
} | |
return this | |
}; | |
F.prototype.retainAll = function(a) { | |
if (null === a || 0 === this.count) { | |
return this | |
} | |
u.J(this); | |
var b = new F(this.pa); | |
b.Ud(a); | |
a = new E(this.pa); | |
for (var c = this.i; c.next();) { | |
b.contains(c.value) || a.add(c.value) | |
} | |
for (b = a.i; b.next();) { | |
this.remove(b.value) | |
} | |
return this | |
}; | |
F.prototype.clear = F.prototype.clear = function() { | |
u.J(this); | |
this.ad = {}; | |
this.$c = 0; | |
this.Ch = this.cb = null; | |
this.Qd() | |
}; | |
F.prototype.copy = function() { | |
var a = new F(this.pa), | |
b = this.ad, | |
c; | |
for (c in b) { | |
a.add(b[c].value) | |
} | |
return a | |
}; | |
F.prototype.toArray = F.prototype.Le = function() { | |
var a = Array(this.$c), | |
b = this.ad, | |
c = 0, | |
d; | |
for (d in b) { | |
a[c] = b[d].value, c++ | |
} | |
return a | |
}; | |
F.prototype.toList = function() { | |
var a = new E(this.pa), | |
b = this.ad, | |
c; | |
for (c in b) { | |
a.add(b[c].value) | |
} | |
return a | |
}; | |
u.u(F, { | |
count: "count" | |
}, function() { | |
return this.$c | |
}); | |
u.u(F, { | |
size: "size" | |
}, function() { | |
return this.$c | |
}); | |
u.u(F, { | |
i: "iterator" | |
}, function() { | |
if (0 >= this.$c) { | |
return Ia | |
} | |
var a = this.yd; | |
return null !== a ? (a.reset(), a) : new Ma(this) | |
}); | |
function Qa(a) { | |
this.Xa = a; | |
this.reset() | |
} | |
u.Yd(Qa, { | |
key: !0, | |
value: !0 | |
}); | |
u.u(Qa, { | |
i: "iterator" | |
}, function() { | |
return this | |
}); | |
Qa.prototype.reset = Qa.prototype.reset = function() { | |
this.Ya = this.Xa.T; | |
this.Cb = null | |
}; | |
Qa.prototype.next = Qa.prototype.hasNext = Qa.prototype.next = function() { | |
var a = this.Xa; | |
if (a.T !== this.Ya) { | |
if (null === this.key) { | |
return !1 | |
} | |
u.Nb(a) | |
} | |
var b = this.Cb, | |
b = null === b ? a.cb : b.Sb; | |
if (null !== b) { | |
return this.Cb = b, this.value = this.key = a = b.key, !0 | |
} | |
this.Xf(); | |
return !1 | |
}; | |
Qa.prototype.first = Qa.prototype.first = function() { | |
var a = this.Xa; | |
this.Ya = a.T; | |
a = a.cb; | |
return null !== a ? (this.Cb = a, this.value = this.key = a = a.key) : null | |
}; | |
Qa.prototype.any = function(a) { | |
var b = this.Xa, | |
c = b.T; | |
this.Cb = null; | |
for (var d = b.cb; null !== d;) { | |
if (a(d.key)) { | |
return !0 | |
} | |
b.T !== c && u.Nb(b); | |
d = d.Sb | |
} | |
return !1 | |
}; | |
Qa.prototype.all = function(a) { | |
var b = this.Xa, | |
c = b.T; | |
this.Cb = null; | |
for (var d = b.cb; null !== d;) { | |
if (!a(d.key)) { | |
return !1 | |
} | |
b.T !== c && u.Nb(b); | |
d = d.Sb | |
} | |
return !0 | |
}; | |
Qa.prototype.each = function(a) { | |
var b = this.Xa, | |
c = b.T; | |
this.Cb = null; | |
for (var d = b.cb; null !== d;) { | |
a(d.key), b.T !== c && u.Nb(b), d = d.Sb | |
} | |
}; | |
u.u(Qa, { | |
count: "count" | |
}, function() { | |
return this.Xa.$c | |
}); | |
Qa.prototype.Xf = function() { | |
this.value = this.key = null; | |
this.Ya = -1 | |
}; | |
Qa.prototype.toString = function() { | |
return null !== this.Cb ? "MapKeySetIterator@" + this.Cb.value : "MapKeySetIterator" | |
}; | |
function Ra(a) { | |
u.gc(this); | |
this.Ea = !0; | |
this.Xa = a | |
} | |
u.Ha(Ra, F); | |
Ra.prototype.freeze = function() { | |
return this | |
}; | |
Ra.prototype.Ma = function() { | |
return this | |
}; | |
Ra.prototype.toString = function() { | |
return "MapKeySet(" + this.Xa.toString() + ")" | |
}; | |
Ra.prototype.add = Ra.prototype.set = Ra.prototype.add = function() { | |
u.k("This Set is read-only: " + this.toString()); | |
return !1 | |
}; | |
Ra.prototype.contains = Ra.prototype.has = Ra.prototype.contains = function(a) { | |
return this.Xa.contains(a) | |
}; | |
Ra.prototype.remove = Ra.prototype["delete"] = Ra.prototype.remove = function() { | |
u.k("This Set is read-only: " + this.toString()); | |
return !1 | |
}; | |
Ra.prototype.clear = Ra.prototype.clear = function() { | |
u.k("This Set is read-only: " + this.toString()) | |
}; | |
Ra.prototype.first = Ra.prototype.first = function() { | |
var a = this.Xa.cb; | |
return null !== a ? a.key : null | |
}; | |
Ra.prototype.any = function(a) { | |
for (var b = this.Xa.cb; null !== b;) { | |
if (a(b.key)) { | |
return !0 | |
} | |
b = b.Sb | |
} | |
return !1 | |
}; | |
Ra.prototype.all = function(a) { | |
for (var b = this.Xa.cb; null !== b;) { | |
if (!a(b.key)) { | |
return !1 | |
} | |
b = b.Sb | |
} | |
return !0 | |
}; | |
Ra.prototype.each = function(a) { | |
for (var b = this.Xa.cb; null !== b;) { | |
a(b.key), b = b.Sb | |
} | |
}; | |
Ra.prototype.copy = function() { | |
return new Ra(this.Xa) | |
}; | |
Ra.prototype.toSet = function() { | |
var a = new F(this.Xa.yq), | |
b = this.Xa.ad, | |
c; | |
for (c in b) { | |
a.add(b[c].key) | |
} | |
return a | |
}; | |
Ra.prototype.toArray = Ra.prototype.Le = function() { | |
var a = this.Xa.ad, | |
b = Array(this.Xa.$c), | |
c = 0, | |
d; | |
for (d in a) { | |
b[c] = a[d].key, c++ | |
} | |
return b | |
}; | |
Ra.prototype.toList = function() { | |
var a = new E(this.pa), | |
b = this.Xa.ad, | |
c; | |
for (c in b) { | |
a.add(b[c].key) | |
} | |
return a | |
}; | |
u.u(Ra, { | |
count: "count" | |
}, function() { | |
return this.Xa.$c | |
}); | |
u.u(Ra, { | |
size: "size" | |
}, function() { | |
return this.Xa.$c | |
}); | |
u.u(Ra, { | |
i: "iterator" | |
}, function() { | |
return 0 >= this.Xa.$c ? Ia : new Qa(this.Xa) | |
}); | |
function Sa(a) { | |
this.Xa = a; | |
this.reset() | |
} | |
u.Yd(Sa, { | |
key: !0, | |
value: !0 | |
}); | |
u.u(Sa, { | |
i: "iterator" | |
}, function() { | |
return this | |
}); | |
Sa.prototype.reset = Sa.prototype.reset = function() { | |
var a = this.Xa; | |
a.Ln = null; | |
this.Ya = a.T; | |
this.Cb = null | |
}; | |
Sa.prototype.next = Sa.prototype.hasNext = Sa.prototype.next = function() { | |
var a = this.Xa; | |
if (a.T !== this.Ya) { | |
if (null === this.key) { | |
return !1 | |
} | |
u.Nb(a) | |
} | |
var b = this.Cb, | |
b = null === b ? a.cb : b.Sb; | |
if (null !== b) { | |
return this.Cb = b, this.value = b.value, this.key = b.key, !0 | |
} | |
this.Xf(); | |
return !1 | |
}; | |
Sa.prototype.first = Sa.prototype.first = function() { | |
var a = this.Xa; | |
this.Ya = a.T; | |
a = a.cb; | |
if (null !== a) { | |
this.Cb = a; | |
var b = a.value; | |
this.key = a.key; | |
return this.value = b | |
} | |
return null | |
}; | |
Sa.prototype.any = function(a) { | |
var b = this.Xa; | |
b.Ln = null; | |
var c = b.T; | |
this.Cb = null; | |
for (var d = b.cb; null !== d;) { | |
if (a(d.value)) { | |
return !0 | |
} | |
b.T !== c && u.Nb(b); | |
d = d.Sb | |
} | |
return !1 | |
}; | |
Sa.prototype.all = function(a) { | |
var b = this.Xa; | |
b.Ln = null; | |
var c = b.T; | |
this.Cb = null; | |
for (var d = b.cb; null !== d;) { | |
if (!a(d.value)) { | |
return !1 | |
} | |
b.T !== c && u.Nb(b); | |
d = d.Sb | |
} | |
return !0 | |
}; | |
Sa.prototype.each = function(a) { | |
var b = this.Xa; | |
b.Ln = null; | |
var c = b.T; | |
this.Cb = null; | |
for (var d = b.cb; null !== d;) { | |
a(d.value), b.T !== c && u.Nb(b), d = d.Sb | |
} | |
}; | |
u.u(Sa, { | |
count: "count" | |
}, function() { | |
return this.Xa.$c | |
}); | |
Sa.prototype.Xf = function() { | |
this.value = this.key = null; | |
this.Ya = -1; | |
this.Xa.Ln = this | |
}; | |
Sa.prototype.toString = function() { | |
return null !== this.Cb ? "MapValueSetIterator@" + this.Cb.value : "MapValueSetIterator" | |
}; | |
function Pa(a, b) { | |
this.key = a; | |
this.value = b; | |
this.Wn = this.Sb = null | |
} | |
u.Yd(Pa, { | |
key: !0, | |
value: !0 | |
}); | |
Pa.prototype.toString = function() { | |
return "{" + this.key + ":" + this.value + "}" | |
}; | |
function Ua(a) { | |
this.Xa = a; | |
this.reset() | |
} | |
u.Yd(Ua, { | |
key: !0, | |
value: !0 | |
}); | |
u.u(Ua, { | |
i: "iterator" | |
}, function() { | |
return this | |
}); | |
Ua.prototype.reset = Ua.prototype.reset = function() { | |
var a = this.Xa; | |
a.yd = null; | |
this.Ya = a.T; | |
this.Cb = null | |
}; | |
Ua.prototype.next = Ua.prototype.hasNext = Ua.prototype.next = function() { | |
var a = this.Xa; | |
if (a.T !== this.Ya) { | |
if (null === this.key) { | |
return !1 | |
} | |
u.Nb(a) | |
} | |
var b = this.Cb, | |
b = null === b ? a.cb : b.Sb; | |
if (null !== b) { | |
return this.Cb = b, this.key = b.key, this.value = b.value, !0 | |
} | |
this.Xf(); | |
return !1 | |
}; | |
Ua.prototype.first = Ua.prototype.first = function() { | |
var a = this.Xa; | |
this.Ya = a.T; | |
a = a.cb; | |
return null !== a ? (this.Cb = a, this.key = a.key, this.value = a.value, a) : null | |
}; | |
Ua.prototype.any = function(a) { | |
var b = this.Xa; | |
b.yd = null; | |
var c = b.T; | |
this.Cb = null; | |
for (var d = b.cb; null !== d;) { | |
if (a(d)) { | |
return !0 | |
} | |
b.T !== c && u.Nb(b); | |
d = d.Sb | |
} | |
return !1 | |
}; | |
Ua.prototype.all = function(a) { | |
var b = this.Xa; | |
b.yd = null; | |
var c = b.T; | |
this.Cb = null; | |
for (var d = b.cb; null !== d;) { | |
if (!a(d)) { | |
return !1 | |
} | |
b.T !== c && u.Nb(b); | |
d = d.Sb | |
} | |
return !0 | |
}; | |
Ua.prototype.each = function(a) { | |
var b = this.Xa; | |
b.yd = null; | |
var c = b.T; | |
this.Cb = null; | |
for (var d = b.cb; null !== d;) { | |
a(d), b.T !== c && u.Nb(b), d = d.Sb | |
} | |
}; | |
u.u(Ua, { | |
count: "count" | |
}, function() { | |
return this.Xa.$c | |
}); | |
Ua.prototype.Xf = function() { | |
this.value = this.key = null; | |
this.Ya = -1; | |
this.Xa.yd = this | |
}; | |
Ua.prototype.toString = function() { | |
return null !== this.Cb ? "MapIterator@" + this.Cb : "MapIterator" | |
}; | |
function la(a, b) { | |
u.gc(this); | |
this.Ea = !1; | |
void 0 === a || null === a ? this.yq = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.yq = a : u.xa(a, "the string 'object', 'number' or 'string'", "Map constructor: keytype") : "function" === typeof a ? this.yq = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : u.xa(a, "null, a primitive type name, or a class type", "Map constructor: keytype"); | |
void 0 === b || null === b ? this.uv = null : "string" === typeof b ? "object" === b || "string" === b || "boolean" === b || "number" === b || "function" === b ? this.uv = b : u.xa(b, "the string 'object', 'number', 'string', 'boolean', or 'function'", "Map constructor: valtype") : "function" === typeof b ? this.uv = b === Object ? "object" : b === String ? "string" : b === Number ? "number" : b === Boolean ? "boolean" : b === Function ? "function" : b : u.xa(b, "null, a primitive type name, or a class type", "Map constructor: valtype"); | |
this.ad = {}; | |
this.$c = 0; | |
this.Ln = this.yd = null; | |
this.T = 0; | |
this.Ch = this.cb = null | |
} | |
u.fa("Map", la); | |
la.prototype.Qd = function() { | |
var a = this.T; | |
a++; | |
999999999 < a && (a = 0); | |
this.T = a | |
}; | |
la.prototype.freeze = la.prototype.freeze = function() { | |
this.Ea = !0; | |
return this | |
}; | |
la.prototype.thaw = la.prototype.Ma = function() { | |
this.Ea = !1; | |
return this | |
}; | |
la.prototype.toString = function() { | |
return "Map(" + u.getTypeName(this.yq) + "," + u.getTypeName(this.uv) + ")#" + u.Uc(this) | |
}; | |
la.prototype.add = la.prototype.set = la.prototype.add = function(a, b) { | |
u.J(this, a); | |
var c = a; | |
u.Ta(a) && (c = u.Js(a)); | |
var d = this.ad[c]; | |
if (void 0 === d) { | |
return this.$c++, d = new Pa(a, b), this.ad[c] = d, c = this.Ch, null === c ? this.cb = d : (d.Wn = c, c.Sb = d), this.Ch = d, this.Qd(), !0 | |
} | |
d.value = b; | |
return !1 | |
}; | |
la.prototype.addAll = la.prototype.Ud = function(a) { | |
if (null === a) { | |
return this | |
} | |
if (u.isArray(a)) { | |
for (var b = u.qb(a), c = 0; c < b; c++) { | |
var d = u.ib(a, c); | |
this.add(d.key, d.value) | |
} | |
} else { | |
for (a = a.i; a.next();) { | |
this.add(a.key, a.value) | |
} | |
} | |
return this | |
}; | |
la.prototype.first = la.prototype.first = function() { | |
return this.cb | |
}; | |
la.prototype.any = function(a) { | |
for (var b = this.T, c = this.cb; null !== c;) { | |
if (a(c)) { | |
return !0 | |
} | |
this.T !== b && u.Nb(this); | |
c = c.Sb | |
} | |
return !1 | |
}; | |
la.prototype.all = function(a) { | |
for (var b = this.T, c = this.cb; null !== c;) { | |
if (!a(c)) { | |
return !1 | |
} | |
this.T !== b && u.Nb(this); | |
c = c.Sb | |
} | |
return !0 | |
}; | |
la.prototype.each = function(a) { | |
for (var b = this.T, c = this.cb; null !== c;) { | |
a(c), this.T !== b && u.Nb(this), c = c.Sb | |
} | |
}; | |
la.prototype.contains = la.prototype.has = la.prototype.contains = function(a) { | |
var b = a; | |
return u.Ta(a) && (b = u.Uc(a), void 0 === b) ? !1 : void 0 !== this.ad[b] | |
}; | |
la.prototype.getValue = la.prototype.get = la.prototype.ua = function(a) { | |
var b = a; | |
if (u.Ta(a) && (b = u.Uc(a), void 0 === b)) { | |
return null | |
} | |
a = this.ad[b]; | |
return void 0 === a ? null : a.value | |
}; | |
la.prototype.remove = la.prototype["delete"] = la.prototype.remove = function(a) { | |
if (null === a) { | |
return !1 | |
} | |
u.J(this, a); | |
var b = a; | |
if (u.Ta(a) && (b = u.Uc(a), void 0 === b)) { | |
return !1 | |
} | |
a = this.ad[b]; | |
if (void 0 === a) { | |
return !1 | |
} | |
var c = a.Sb, | |
d = a.Wn; | |
null !== c && (c.Wn = d); | |
null !== d && (d.Sb = c); | |
this.cb === a && (this.cb = c); | |
this.Ch === a && (this.Ch = d); | |
delete this.ad[b]; | |
this.$c--; | |
this.Qd(); | |
return !0 | |
}; | |
la.prototype.clear = la.prototype.clear = function() { | |
u.J(this); | |
this.ad = {}; | |
this.$c = 0; | |
this.Ch = this.cb = null; | |
this.Qd() | |
}; | |
la.prototype.copy = function() { | |
var a = new la(this.yq, this.uv), | |
b = this.ad, | |
c; | |
for (c in b) { | |
var d = b[c]; | |
a.add(d.key, d.value) | |
} | |
return a | |
}; | |
la.prototype.toArray = la.prototype.Le = function() { | |
var a = this.ad, | |
b = Array(this.$c), | |
c = 0, | |
d; | |
for (d in a) { | |
var e = a[d]; | |
b[c] = new Pa(e.key, e.value); | |
c++ | |
} | |
return b | |
}; | |
la.prototype.toKeySet = la.prototype.Oi = function() { | |
return new Ra(this) | |
}; | |
u.u(la, { | |
count: "count" | |
}, function() { | |
return this.$c | |
}); | |
u.u(la, { | |
size: "size" | |
}, function() { | |
return this.$c | |
}); | |
u.u(la, { | |
i: "iterator" | |
}, function() { | |
if (0 >= this.count) { | |
return Ia | |
} | |
var a = this.yd; | |
return null !== a ? (a.reset(), a) : new Ua(this) | |
}); | |
u.u(la, { | |
RJ: "iteratorKeys" | |
}, function() { | |
return 0 >= this.count ? Ia : new Qa(this) | |
}); | |
u.u(la, { | |
SD: "iteratorValues" | |
}, function() { | |
if (0 >= this.count) { | |
return Ia | |
} | |
var a = this.Ln; | |
return null !== a ? (a.reset(), a) : new Sa(this) | |
}); | |
function w(a, b) { | |
void 0 === a ? this.y = this.x = 0 : (this.x = a, this.y = b); | |
this.Ea = !1 | |
} | |
u.fa("Point", w); | |
u.Nh(w); | |
u.Yd(w, { | |
x: !0, | |
y: !0 | |
}); | |
w.prototype.assign = function(a) { | |
this.x = a.x; | |
this.y = a.y | |
}; | |
w.prototype.setTo = w.prototype.m = function(a, b) { | |
this.x = a; | |
this.y = b; | |
return this | |
}; | |
w.prototype.set = w.prototype.set = function(a) { | |
this.J(); | |
this.x = a.x; | |
this.y = a.y; | |
return this | |
}; | |
w.prototype.copy = function() { | |
var a = new w; | |
a.x = this.x; | |
a.y = this.y; | |
return a | |
}; | |
g = w.prototype; | |
g.La = function() { | |
this.Ea = !0; | |
Object.freeze(this); | |
return this | |
}; | |
g.Z = function() { | |
return Object.isFrozen(this) ? this : this.copy().freeze() | |
}; | |
g.freeze = function() { | |
this.Ea = !0; | |
return this | |
}; | |
g.Ma = function() { | |
Object.isFrozen(this) && u.k("cannot thaw constant: " + this); | |
this.Ea = !1; | |
return this | |
}; | |
g.J = function(a) { | |
if (this.Ea) { | |
var b = "The Point is frozen, so its properties cannot be set: " + this.toString(); | |
void 0 !== a && (b += " to value: " + a); | |
u.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)); | |
return new w(c, e) | |
} | |
return new w | |
}; | |
w.stringify = function(a) { | |
return a instanceof w ? a.x.toString() + " " + a.y.toString() : a.toString() | |
}; | |
w.prototype.toString = function() { | |
return "Point(" + this.x + "," + this.y + ")" | |
}; | |
w.prototype.equals = w.prototype.L = function(a) { | |
return a instanceof w ? this.x === a.x && this.y === a.y : !1 | |
}; | |
w.prototype.equalTo = w.prototype.Tv = function(a, b) { | |
return this.x === a && this.y === b | |
}; | |
w.prototype.equalsApprox = w.prototype.pd = function(a) { | |
return K.D(this.x, a.x) && K.D(this.y, a.y) | |
}; | |
w.prototype.add = w.prototype.add = function(a) { | |
this.J(); | |
this.x += a.x; | |
this.y += a.y; | |
return this | |
}; | |
w.prototype.subtract = w.prototype.wt = function(a) { | |
this.J(); | |
this.x -= a.x; | |
this.y -= a.y; | |
return this | |
}; | |
w.prototype.offset = w.prototype.offset = function(a, b) { | |
this.J(); | |
this.x += a; | |
this.y += b; | |
return this | |
}; | |
w.prototype.rotate = w.prototype.rotate = function(a) { | |
this.J(); | |
if (0 === a) { | |
return this | |
} | |
var b = this.x, | |
c = this.y; | |
if (0 === b && 0 === c) { | |
return this | |
} | |
var d = 0, | |
e = 0; | |
360 <= a ? a -= 360 : 0 > a && (a += 360); | |
90 === a ? (d = 0, e = 1) : 180 === a ? (d = -1, e = 0) : 270 === a ? (d = 0, e = -1) : (a = a * Math.PI / 180, d = Math.cos(a), e = Math.sin(a)); | |
this.x = d * b - e * c; | |
this.y = e * b + d * c; | |
return this | |
}; | |
w.prototype.scale = w.prototype.scale = function(a, b) { | |
this.x *= a; | |
this.y *= b; | |
return this | |
}; | |
w.prototype.distanceSquaredPoint = w.prototype.Lj = function(a) { | |
var b = a.x - this.x; | |
a = a.y - this.y; | |
return b * b + a * a | |
}; | |
w.prototype.distanceSquared = w.prototype.zo = function(a, b) { | |
var c = a - this.x, | |
d = b - this.y; | |
return c * c + d * d | |
}; | |
w.prototype.normalize = w.prototype.normalize = function() { | |
this.J(); | |
var a = this.x, | |
b = this.y, | |
c = Math.sqrt(a * a + b * b); | |
0 < c && (this.x = a / c, this.y = b / c); | |
return this | |
}; | |
w.prototype.directionPoint = w.prototype.Gi = function(a) { | |
return Va(a.x - this.x, a.y - this.y) | |
}; | |
w.prototype.direction = w.prototype.direction = function(a, b) { | |
return Va(a - this.x, b - this.y) | |
}; | |
function Va(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 | |
} | |
w.prototype.projectOntoLineSegment = function(a, b, c, d) { | |
K.Lm(a, b, c, d, this.x, this.y, this); | |
return this | |
}; | |
w.prototype.projectOntoLineSegmentPoint = function(a, b) { | |
K.Lm(a.x, a.y, b.x, b.y, this.x, this.y, this); | |
return this | |
}; | |
w.prototype.snapToGrid = function(a, b, c, d) { | |
K.ys(this.x, this.y, a, b, c, d, this); | |
return this | |
}; | |
w.prototype.snapToGridPoint = function(a, b) { | |
K.ys(this.x, this.y, a.x, a.y, b.width, b.height, this); | |
return this | |
}; | |
w.prototype.setRectSpot = w.prototype.qt = function(a, b) { | |
this.J(); | |
this.x = a.x + b.x * a.width + b.offsetX; | |
this.y = a.y + b.y * a.height + b.offsetY; | |
return this | |
}; | |
w.prototype.setSpot = w.prototype.st = function(a, b, c, d, e) { | |
this.J(); | |
this.x = a + e.x * c + e.offsetX; | |
this.y = b + e.y * d + e.offsetY; | |
return this | |
}; | |
w.prototype.transform = function(a) { | |
a.bb(this); | |
return this | |
}; | |
function Wa(a, b) { | |
b.Qh(a); | |
return a | |
} | |
var Xa; | |
w.distanceLineSegmentSquared = Xa = function(a, b, c, d, e, f) { | |
var h = e - c, | |
k = f - d, | |
l = h * h + k * k; | |
c -= a; | |
d -= b; | |
var m = -c * h - d * k; | |
if (0 >= m || m >= l) { | |
return h = e - a, k = f - b, Math.min(c * c + d * d, h * h + k * k) | |
} | |
a = h * d - k * c; | |
return a * a / l | |
}; | |
var Ya; | |
w.distanceSquared = Ya = function(a, b, c, d) { | |
a = c - a; | |
b = d - b; | |
return a * a + b * b | |
}; | |
var Za; | |
w.direction = Za = function(a, b, c, d) { | |
a = c - a; | |
b = d - b; | |
if (0 === a) { | |
return 0 < b ? 90 : 0 > b ? 270 : 0 | |
} | |
if (0 === b) { | |
return 0 < a ? 0 : 180 | |
} | |
if (isNaN(a) || isNaN(b)) { | |
return 0 | |
} | |
d = 180 * Math.atan(Math.abs(b / a)) / Math.PI; | |
0 > a ? d = 0 > b ? d + 180 : 180 - d : 0 > b && (d = 360 - d); | |
return d | |
}; | |
w.prototype.isReal = w.prototype.I = function() { | |
return isFinite(this.x) && isFinite(this.y) | |
}; | |
function ia(a, b) { | |
void 0 === a ? this.height = this.width = 0 : (this.width = a, this.height = b); | |
this.Ea = !1 | |
} | |
u.fa("Size", ia); | |
u.Nh(ia); | |
u.Yd(ia, { | |
width: !0, | |
height: !0 | |
}); | |
ia.prototype.assign = function(a) { | |
this.width = a.width; | |
this.height = a.height | |
}; | |
ia.prototype.setTo = ia.prototype.m = function(a, b) { | |
this.width = a; | |
this.height = b; | |
return this | |
}; | |
ia.prototype.set = ia.prototype.set = function(a) { | |
this.J(); | |
this.width = a.width; | |
this.height = a.height; | |
return this | |
}; | |
ia.prototype.copy = function() { | |
var a = new ia; | |
a.width = this.width; | |
a.height = this.height; | |
return a | |
}; | |
g = ia.prototype; | |
g.La = function() { | |
this.Ea = !0; | |
Object.freeze(this); | |
return this | |
}; | |
g.Z = function() { | |
return Object.isFrozen(this) ? this : this.copy().freeze() | |
}; | |
g.freeze = function() { | |
this.Ea = !0; | |
return this | |
}; | |
g.Ma = function() { | |
Object.isFrozen(this) && u.k("cannot thaw constant: " + this); | |
this.Ea = !1; | |
return this | |
}; | |
g.J = function(a) { | |
if (this.Ea) { | |
var b = "The Size is frozen, so its properties cannot be set: " + this.toString(); | |
void 0 !== a && (b += " to value: " + a); | |
u.k(b) | |
} | |
}; | |
ia.parse = function(a) { | |
if ("string" === typeof a) { | |
a = a.split(" "); | |
for (var b = 0, c = 0; | |
"" === a[b];) { | |
b++ | |
} | |
var d = a[b++]; | |
d && (c = parseFloat(d)); | |
for (var e = 0; | |
"" === a[b];) { | |
b++ | |
}(d = a[b++]) && (e = parseFloat(d)); | |
return new ia(c, e) | |
} | |
return new ia | |
}; | |
ia.stringify = function(a) { | |
return a instanceof ia ? a.width.toString() + " " + a.height.toString() : a.toString() | |
}; | |
ia.prototype.toString = function() { | |
return "Size(" + this.width + "," + this.height + ")" | |
}; | |
ia.prototype.equals = ia.prototype.L = function(a) { | |
return a instanceof ia ? this.width === a.width && this.height === a.height : !1 | |
}; | |
ia.prototype.equalTo = ia.prototype.Tv = function(a, b) { | |
return this.width === a && this.height === b | |
}; | |
ia.prototype.equalsApprox = ia.prototype.pd = function(a) { | |
return K.D(this.width, a.width) && K.D(this.height, a.height) | |
}; | |
ia.prototype.isReal = ia.prototype.I = function() { | |
return isFinite(this.width) && isFinite(this.height) | |
}; | |
function z(a, b, c, d) { | |
void 0 === a ? this.height = this.width = this.y = this.x = 0 : a instanceof w ? b instanceof w ? (this.x = Math.min(a.x, b.x), this.y = Math.min(a.y, b.y), this.width = Math.abs(a.x - b.x), this.height = Math.abs(a.y - b.y)) : b instanceof ia ? (this.x = a.x, this.y = a.y, this.width = b.width, this.height = b.height) : u.k("Incorrect arguments supplied to Rect constructor") : (this.x = a, this.y = b, this.width = c, this.height = d); | |
this.Ea = !1 | |
} | |
u.fa("Rect", z); | |
u.Nh(z); | |
u.Yd(z, { | |
x: !0, | |
y: !0, | |
width: !0, | |
height: !0 | |
}); | |
z.prototype.assign = function(a) { | |
this.x = a.x; | |
this.y = a.y; | |
this.width = a.width; | |
this.height = a.height | |
}; | |
function bb(a, b, c) { | |
a.width = b; | |
a.height = c | |
} | |
z.prototype.setTo = z.prototype.m = function(a, b, c, d) { | |
this.x = a; | |
this.y = b; | |
this.width = c; | |
this.height = d; | |
return this | |
}; | |
z.prototype.set = z.prototype.set = function(a) { | |
this.J(); | |
this.x = a.x; | |
this.y = a.y; | |
this.width = a.width; | |
this.height = a.height; | |
return this | |
}; | |
z.prototype.setPoint = z.prototype.zf = function(a) { | |
this.J(); | |
this.x = a.x; | |
this.y = a.y; | |
return this | |
}; | |
z.prototype.setSize = function(a) { | |
this.J(); | |
this.width = a.width; | |
this.height = a.height; | |
return this | |
}; | |
z.prototype.copy = function() { | |
var a = new z; | |
a.x = this.x; | |
a.y = this.y; | |
a.width = this.width; | |
a.height = this.height; | |
return a | |
}; | |
g = z.prototype; | |
g.La = function() { | |
this.Ea = !0; | |
Object.freeze(this); | |
return this | |
}; | |
g.Z = function() { | |
return Object.isFrozen(this) ? this : this.copy().freeze() | |
}; | |
g.freeze = function() { | |
this.Ea = !0; | |
return this | |
}; | |
g.Ma = function() { | |
Object.isFrozen(this) && u.k("cannot thaw constant: " + this); | |
this.Ea = !1; | |
return this | |
}; | |
g.J = function(a) { | |
if (this.Ea) { | |
var b = "The Rect is frozen, so its properties cannot be set: " + this.toString(); | |
void 0 !== a && (b += " to value: " + a); | |
u.k(b) | |
} | |
}; | |
z.parse = function(a) { | |
if ("string" === typeof a) { | |
a = a.split(" "); | |
for (var b = 0, c = 0; | |
"" === a[b];) { | |
b++ | |
} | |
var d = a[b++]; | |
d && (c = parseFloat(d)); | |
for (var e = 0; | |
"" === a[b];) { | |
b++ | |
}(d = a[b++]) && (e = parseFloat(d)); | |
for (var f = 0; | |
"" === a[b];) { | |
b++ | |
}(d = a[b++]) && (f = parseFloat(d)); | |
for (var h = 0; | |
"" === a[b];) { | |
b++ | |
}(d = a[b++]) && (h = parseFloat(d)); | |
return new z(c, e, f, h) | |
} | |
return new z | |
}; | |
z.stringify = function(a) { | |
return a instanceof z ? a.x.toString() + " " + a.y.toString() + " " + a.width.toString() + " " + a.height.toString() : a.toString() | |
}; | |
z.prototype.toString = function() { | |
return "Rect(" + this.x + "," + this.y + "," + this.width + "," + this.height + ")" | |
}; | |
z.prototype.equals = z.prototype.L = function(a) { | |
return a instanceof z ? this.x === a.x && this.y === a.y && this.width === a.width && this.height === a.height : !1 | |
}; | |
z.prototype.equalTo = z.prototype.Tv = function(a, b, c, d) { | |
return this.x === a && this.y === b && this.width === c && this.height === d | |
}; | |
z.prototype.equalsApprox = z.prototype.pd = function(a) { | |
return K.D(this.x, a.x) && K.D(this.y, a.y) && K.D(this.width, a.width) && K.D(this.height, a.height) | |
}; | |
z.prototype.containsPoint = z.prototype.Da = function(a) { | |
return this.x <= a.x && this.x + this.width >= a.x && this.y <= a.y && this.y + this.height >= a.y | |
}; | |
z.prototype.containsRect = z.prototype.Kj = function(a) { | |
return this.x <= a.x && a.x + a.width <= this.x + this.width && this.y <= a.y && a.y + a.height <= this.y + this.height | |
}; | |
z.prototype.contains = z.prototype.contains = function(a, b, c, d) { | |
void 0 === c && (c = 0); | |
void 0 === d && (d = 0); | |
return this.x <= a && a + c <= this.x + this.width && this.y <= b && b + d <= this.y + this.height | |
}; | |
z.prototype.reset = function() { | |
this.J(); | |
this.height = this.width = this.y = this.x = 0 | |
}; | |
z.prototype.offset = z.prototype.offset = function(a, b) { | |
this.J(); | |
this.x += a; | |
this.y += b; | |
return this | |
}; | |
z.prototype.inflate = z.prototype.Kf = function(a, b) { | |
return hb(this, b, a, b, a) | |
}; | |
z.prototype.addMargin = z.prototype.zv = function(a) { | |
return hb(this, a.top, a.right, a.bottom, a.left) | |
}; | |
z.prototype.subtractMargin = z.prototype.vI = function(a) { | |
return hb(this, -a.top, -a.right, -a.bottom, -a.left) | |
}; | |
z.prototype.grow = function(a, b, c, d) { | |
return hb(this, a, b, c, d) | |
}; | |
function hb(a, b, c, d, e) { | |
a.J(); | |
var f = a.width; | |
c + e <= -f ? (a.x += f / 2, a.width = 0) : (a.x -= e, a.width += c + e); | |
c = a.height; | |
b + d <= -c ? (a.y += c / 2, a.height = 0) : (a.y -= b, a.height += b + d); | |
return a | |
} | |
z.prototype.intersectRect = function(a) { | |
return ib(this, a.x, a.y, a.width, a.height) | |
}; | |
z.prototype.intersect = function(a, b, c, d) { | |
return ib(this, a, b, c, d) | |
}; | |
function ib(a, b, c, d, e) { | |
a.J(); | |
var f = Math.max(a.x, b), | |
h = Math.max(a.y, c); | |
b = Math.min(a.x + a.width, b + d); | |
c = Math.min(a.y + a.height, c + e); | |
a.x = f; | |
a.y = h; | |
a.width = Math.max(0, b - f); | |
a.height = Math.max(0, c - h); | |
return a | |
} | |
z.prototype.intersectsRect = z.prototype.ug = function(a) { | |
return this.HD(a.x, a.y, a.width, a.height) | |
}; | |
z.prototype.intersects = z.prototype.HD = function(a, b, c, d) { | |
var e = this.width, | |
f = this.x; | |
if (Infinity !== e && Infinity !== c && (e += f, c += a, isNaN(c) || isNaN(e) || f > c || a > e)) { | |
return !1 | |
} | |
a = this.height; | |
c = this.y; | |
return Infinity !== a && Infinity !== d && (a += c, d += b, isNaN(d) || isNaN(a) || c > d || b > a) ? !1 : !0 | |
}; | |
function jb(a, b) { | |
var c = a.width, | |
d = b.width + 10 + 10, | |
e = a.x, | |
f = b.x - 10; | |
if (e > d + f || f > c + e) { | |
return !1 | |
} | |
c = a.height; | |
d = b.height + 10 + 10; | |
e = a.y; | |
f = b.y - 10; | |
return e > d + f || f > c + e ? !1 : !0 | |
} | |
z.prototype.unionPoint = z.prototype.Pi = function(a) { | |
return kb(this, a.x, a.y, 0, 0) | |
}; | |
z.prototype.unionRect = z.prototype.Uh = function(a) { | |
return kb(this, a.x, a.y, a.width, a.height) | |
}; | |
z.prototype.union = z.prototype.YE = function(a, b, c, d) { | |
this.J(); | |
void 0 === c && (c = 0); | |
void 0 === d && (d = 0); | |
return kb(this, a, b, c, d) | |
}; | |
function kb(a, b, c, d, e) { | |
var f = Math.min(a.x, b), | |
h = Math.min(a.y, c); | |
b = Math.max(a.x + a.width, b + d); | |
c = Math.max(a.y + a.height, c + e); | |
a.x = f; | |
a.y = h; | |
a.width = b - f; | |
a.height = c - h; | |
return a | |
} | |
z.prototype.setSpot = z.prototype.st = function(a, b, c) { | |
this.J(); | |
this.x = a - c.offsetX - c.x * this.width; | |
this.y = b - c.offsetY - c.y * this.height; | |
return this | |
}; | |
var qb; | |
z.contains = qb = function(a, b, c, d, e, f, h, k) { | |
void 0 === h && (h = 0); | |
void 0 === k && (k = 0); | |
return a <= e && e + h <= a + c && b <= f && f + k <= b + d | |
}; | |
z.intersects = function(a, b, c, d, e, f, h, k) { | |
c += a; | |
h += e; | |
if (a > h || e > c) { | |
return !1 | |
} | |
a = d + b; | |
k += f; | |
return b > k || f > a ? !1 : !0 | |
}; | |
u.defineProperty(z, { | |
left: "left" | |
}, function() { | |
return this.x | |
}, function(a) { | |
this.J(a); | |
this.x = a | |
}); | |
u.defineProperty(z, { | |
top: "top" | |
}, function() { | |
return this.y | |
}, function(a) { | |
this.J(a); | |
this.y = a | |
}); | |
u.defineProperty(z, { | |
right: "right" | |
}, function() { | |
return this.x + this.width | |
}, function(a) { | |
this.J(a); | |
this.x += a - (this.x + this.width) | |
}); | |
u.defineProperty(z, { | |
bottom: "bottom" | |
}, function() { | |
return this.y + this.height | |
}, function(a) { | |
this.J(a); | |
this.y += a - (this.y + this.height) | |
}); | |
u.defineProperty(z, { | |
position: "position" | |
}, function() { | |
return new w(this.x, this.y) | |
}, function(a) { | |
this.J(a); | |
this.x = a.x; | |
this.y = a.y | |
}); | |
u.defineProperty(z, { | |
size: "size" | |
}, function() { | |
return new ia(this.width, this.height) | |
}, function(a) { | |
this.J(a); | |
this.width = a.width; | |
this.height = a.height | |
}); | |
u.defineProperty(z, { | |
Ok: "center" | |
}, function() { | |
return new w(this.x + this.width / 2, this.y + this.height / 2) | |
}, function(a) { | |
this.J(a); | |
this.x = a.x - this.width / 2; | |
this.y = a.y - this.height / 2 | |
}); | |
u.defineProperty(z, { | |
ma: "centerX" | |
}, function() { | |
return this.x + this.width / 2 | |
}, function(a) { | |
this.J(a); | |
this.x = a - this.width / 2 | |
}); | |
u.defineProperty(z, { | |
ya: "centerY" | |
}, function() { | |
return this.y + this.height / 2 | |
}, function(a) { | |
this.J(a); | |
this.y = a - this.height / 2 | |
}); | |
z.prototype.isReal = z.prototype.I = function() { | |
return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height) | |
}; | |
z.prototype.isEmpty = function() { | |
return 0 === this.width && 0 === this.height | |
}; | |
function rb(a, b, c, d) { | |
void 0 === a ? this.left = this.bottom = this.right = this.top = 0 : void 0 === b ? this.left = this.bottom = this.right = this.top = a : void 0 === c ? (d = b, this.top = a, this.right = b, this.bottom = a, this.left = d) : void 0 !== d ? (this.top = a, this.right = b, this.bottom = c, this.left = d) : u.k("Invalid arguments to Margin constructor"); | |
this.Ea = !1 | |
} | |
u.fa("Margin", rb); | |
u.Nh(rb); | |
u.Yd(rb, { | |
top: !0, | |
right: !0, | |
bottom: !0, | |
left: !0 | |
}); | |
rb.prototype.assign = function(a) { | |
this.top = a.top; | |
this.right = a.right; | |
this.bottom = a.bottom; | |
this.left = a.left | |
}; | |
rb.prototype.setTo = rb.prototype.m = function(a, b, c, d) { | |
this.J(); | |
this.top = a; | |
this.right = b; | |
this.bottom = c; | |
this.left = d; | |
return this | |
}; | |
rb.prototype.set = rb.prototype.set = function(a) { | |
this.J(); | |
this.top = a.top; | |
this.right = a.right; | |
this.bottom = a.bottom; | |
this.left = a.left; | |
return this | |
}; | |
rb.prototype.copy = function() { | |
var a = new rb; | |
a.top = this.top; | |
a.right = this.right; | |
a.bottom = this.bottom; | |
a.left = this.left; | |
return a | |
}; | |
g = rb.prototype; | |
g.La = function() { | |
this.Ea = !0; | |
Object.freeze(this); | |
return this | |
}; | |
g.Z = function() { | |
return Object.isFrozen(this) ? this : this.copy().freeze() | |
}; | |
g.freeze = function() { | |
this.Ea = !0; | |
return this | |
}; | |
g.Ma = function() { | |
Object.isFrozen(this) && u.k("cannot thaw constant: " + this); | |
this.Ea = !1; | |
return this | |
}; | |
g.J = function(a) { | |
if (this.Ea) { | |
var b = "The Margin is frozen, so its properties cannot be set: " + this.toString(); | |
void 0 !== a && (b += " to value: " + a); | |
u.k(b) | |
} | |
}; | |
rb.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 rb | |
} | |
for (var e = NaN; | |
"" === a[b];) { | |
b++ | |
}(d = a[b++]) && (e = parseFloat(d)); | |
if (isNaN(e)) { | |
return new rb(c) | |
} | |
for (var f = NaN; | |
"" === a[b];) { | |
b++ | |
}(d = a[b++]) && (f = parseFloat(d)); | |
if (isNaN(f)) { | |
return new rb(c, e) | |
} | |
for (var h = NaN; | |
"" === a[b];) { | |
b++ | |
}(d = a[b++]) && (h = parseFloat(d)); | |
return isNaN(h) ? new rb(c, e) : new rb(c, e, f, h) | |
} | |
return new rb | |
}; | |
rb.stringify = function(a) { | |
return a instanceof rb ? a.top.toString() + " " + a.right.toString() + " " + a.bottom.toString() + " " + a.left.toString() : a.toString() | |
}; | |
rb.prototype.toString = function() { | |
return "Margin(" + this.top + "," + this.right + "," + this.bottom + "," + this.left + ")" | |
}; | |
rb.prototype.equals = rb.prototype.L = function(a) { | |
return a instanceof rb ? this.top === a.top && this.right === a.right && this.bottom === a.bottom && this.left === a.left : !1 | |
}; | |
rb.prototype.equalTo = rb.prototype.Tv = function(a, b, c, d) { | |
return this.top === a && this.right === b && this.bottom === c && this.left === d | |
}; | |
rb.prototype.equalsApprox = rb.prototype.pd = function(a) { | |
return K.D(this.top, a.top) && K.D(this.right, a.right) && K.D(this.bottom, a.bottom) && K.D(this.left, a.left) | |
}; | |
rb.prototype.isReal = rb.prototype.I = function() { | |
return isFinite(this.top) && isFinite(this.right) && isFinite(this.bottom) && isFinite(this.left) | |
}; | |
function ja() { | |
this.m11 = 1; | |
this.m21 = this.m12 = 0; | |
this.m22 = 1; | |
this.dy = this.dx = 0 | |
} | |
u.Nh(ja); | |
u.Yd(ja, { | |
m11: !0, | |
m12: !0, | |
m21: !0, | |
m22: !0, | |
dx: !0, | |
dy: !0 | |
}); | |
ja.prototype.set = ja.prototype.set = function(a) { | |
this.m11 = a.m11; | |
this.m12 = a.m12; | |
this.m21 = a.m21; | |
this.m22 = a.m22; | |
this.dx = a.dx; | |
this.dy = a.dy; | |
return this | |
}; | |
ja.prototype.copy = function() { | |
var a = new ja; | |
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 | |
}; | |
ja.prototype.toString = function() { | |
return "Transform(" + this.m11 + "," + this.m12 + "," + this.m21 + "," + this.m22 + "," + this.dx + "," + this.dy + ")" | |
}; | |
ja.prototype.equals = ja.prototype.L = function(a) { | |
return a instanceof ja ? 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 | |
}; | |
ja.prototype.isIdentity = ja.prototype.Ps = function() { | |
return 1 === this.m11 && 0 === this.m12 && 0 === this.m21 && 1 === this.m22 && 0 === this.dx && 0 === this.dy | |
}; | |
ja.prototype.reset = ja.prototype.reset = function() { | |
this.m11 = 1; | |
this.m21 = this.m12 = 0; | |
this.m22 = 1; | |
this.dy = this.dx = 0; | |
return this | |
}; | |
ja.prototype.multiply = ja.prototype.multiply = function(a) { | |
var b = this.m12 * a.m11 + this.m22 * a.m12, | |
c = this.m11 * a.m21 + this.m21 * a.m22, | |
d = this.m12 * a.m21 + this.m22 * a.m22, | |
e = this.m11 * a.dx + this.m21 * a.dy + this.dx, | |
f = this.m12 * a.dx + this.m22 * a.dy + this.dy; | |
this.m11 = this.m11 * a.m11 + this.m21 * a.m12; | |
this.m12 = b; | |
this.m21 = c; | |
this.m22 = d; | |
this.dx = e; | |
this.dy = f; | |
return this | |
}; | |
ja.prototype.multiplyInverted = ja.prototype.bE = function(a) { | |
var b = 1 / (a.m11 * a.m22 - a.m12 * a.m21), | |
c = a.m22 * b, | |
d = -a.m12 * b, | |
e = -a.m21 * b, | |
f = a.m11 * b, | |
h = b * (a.m21 * a.dy - a.m22 * a.dx), | |
k = b * (a.m12 * a.dx - a.m11 * a.dy); | |
a = this.m12 * c + this.m22 * d; | |
b = this.m11 * e + this.m21 * f; | |
e = this.m12 * e + this.m22 * f; | |
f = this.m11 * h + this.m21 * k + this.dx; | |
h = this.m12 * h + this.m22 * k + this.dy; | |
this.m11 = this.m11 * c + this.m21 * d; | |
this.m12 = a; | |
this.m21 = b; | |
this.m22 = e; | |
this.dx = f; | |
this.dy = h; | |
return this | |
}; | |
ja.prototype.invert = ja.prototype.pz = function() { | |
var a = 1 / (this.m11 * this.m22 - this.m12 * this.m21), | |
b = -this.m12 * a, | |
c = -this.m21 * a, | |
d = this.m11 * a, | |
e = a * (this.m21 * this.dy - this.m22 * this.dx), | |
f = a * (this.m12 * this.dx - this.m11 * this.dy); | |
this.m11 = this.m22 * a; | |
this.m12 = b; | |
this.m21 = c; | |
this.m22 = d; | |
this.dx = e; | |
this.dy = f; | |
return this | |
}; | |
ja.prototype.rotate = ja.prototype.rotate = function(a, b, c) { | |
360 <= a ? a -= 360 : 0 > a && (a += 360); | |
if (0 === a) { | |
return this | |
} | |
this.translate(b, c); | |
var d = 0, | |
e = 0; | |
90 === a ? (d = 0, e = 1) : 180 === a ? (d = -1, e = 0) : 270 === a ? (d = 0, e = -1) : (e = a * Math.PI / 180, d = Math.cos(e), e = Math.sin(e)); | |
a = this.m12 * d + this.m22 * e; | |
var f = this.m11 * -e + this.m21 * d, | |
h = this.m12 * -e + this.m22 * d; | |
this.m11 = this.m11 * d + this.m21 * e; | |
this.m12 = a; | |
this.m21 = f; | |
this.m22 = h; | |
this.translate(-b, -c); | |
return this | |
}; | |
ja.prototype.translate = ja.prototype.translate = function(a, b) { | |
this.dx += this.m11 * a + this.m21 * b; | |
this.dy += this.m12 * a + this.m22 * b; | |
return this | |
}; | |
ja.prototype.scale = ja.prototype.scale = function(a, b) { | |
void 0 === b && (b = a); | |
this.m11 *= a; | |
this.m12 *= a; | |
this.m21 *= b; | |
this.m22 *= b; | |
return this | |
}; | |
ja.prototype.transformPoint = ja.prototype.bb = function(a) { | |
var b = a.x, | |
c = a.y; | |
a.x = b * this.m11 + c * this.m21 + this.dx; | |
a.y = b * this.m12 + c * this.m22 + this.dy; | |
return a | |
}; | |
ja.prototype.invertedTransformPoint = ja.prototype.Qh = function(a) { | |
var b = 1 / (this.m11 * this.m22 - this.m12 * this.m21), | |
c = -this.m12 * b, | |
d = this.m11 * b, | |
e = b * (this.m12 * this.dx - this.m11 * this.dy), | |
f = a.x, | |
h = a.y; | |
a.x = f * this.m22 * b + h * -this.m21 * b + b * (this.m21 * this.dy - this.m22 * this.dx); | |
a.y = f * c + h * d + e; | |
return a | |
}; | |
ja.prototype.transformRect = ja.prototype.WE = function(a) { | |
var b = a.x, | |
c = a.y, | |
d = b + a.width, | |
e = c + a.height, | |
f = this.m11, | |
h = this.m12, | |
k = this.m21, | |
l = this.m22, | |
m = this.dx, | |
n = this.dy, | |
p = b * f + c * k + m, | |
q = b * h + c * l + n, | |
r = d * f + c * k + m, | |
c = d * h + c * l + n, | |
s = b * f + e * k + m, | |
b = b * h + e * l + n, | |
f = d * f + e * k + m, | |
d = d * h + e * l + n, | |
e = p, | |
h = q, | |
p = Math.min(p, r), | |
e = Math.max(e, r), | |
h = Math.min(h, c), | |
q = Math.max(q, c), | |
p = Math.min(p, s), | |
e = Math.max(e, s), | |
h = Math.min(h, b), | |
q = Math.max(q, b), | |
p = Math.min(p, f), | |
e = Math.max(e, f), | |
h = Math.min(h, d), | |
q = Math.max(q, d); | |
a.x = p; | |
a.y = h; | |
a.width = e - p; | |
a.height = q - h; | |
return a | |
}; | |
function L(a, b, c, d) { | |
void 0 === a ? this.offsetY = this.offsetX = this.y = this.x = 0 : (void 0 === b && (b = 0), void 0 === c && (c = 0), void 0 === d && (d = 0), this.x = a, this.y = b, this.offsetX = c, this.offsetY = d); | |
this.Ea = !1 | |
} | |
u.fa("Spot", L); | |
u.Nh(L); | |
u.Yd(L, { | |
x: !0, | |
y: !0, | |
offsetX: !0, | |
offsetY: !0 | |
}); | |
L.prototype.assign = function(a) { | |
this.x = a.x; | |
this.y = a.y; | |
this.offsetX = a.offsetX; | |
this.offsetY = a.offsetY | |
}; | |
L.prototype.setTo = L.prototype.m = function(a, b, c, d) { | |
this.J(); | |
this.x = a; | |
this.y = b; | |
this.offsetX = c; | |
this.offsetY = d; | |
return this | |
}; | |
L.prototype.set = L.prototype.set = function(a) { | |
this.J(); | |
this.x = a.x; | |
this.y = a.y; | |
this.offsetX = a.offsetX; | |
this.offsetY = a.offsetY; | |
return this | |
}; | |
L.prototype.copy = function() { | |
var a = new L; | |
a.x = this.x; | |
a.y = this.y; | |
a.offsetX = this.offsetX; | |
a.offsetY = this.offsetY; | |
return a | |
}; | |
g = L.prototype; | |
g.La = function() { | |
this.Ea = !0; | |
Object.freeze(this); | |
return this | |
}; | |
g.Z = function() { | |
return Object.isFrozen(this) ? this : this.copy().freeze() | |
}; | |
g.freeze = function() { | |
this.Ea = !0; | |
return this | |
}; | |
g.Ma = function() { | |
Object.isFrozen(this) && u.k("cannot thaw constant: " + this); | |
this.Ea = !1; | |
return this | |
}; | |
g.J = function(a) { | |
if (this.Ea) { | |
var b = "The Spot is frozen, so its properties cannot be set: " + this.toString(); | |
void 0 !== a && (b += " to value: " + a); | |
u.k(b) | |
} | |
}; | |
function sb(a, b) { | |
a.x = NaN; | |
a.y = NaN; | |
a.offsetX = b; | |
return a | |
} | |
var tb; | |
L.parse = tb = function(a) { | |
if ("string" === typeof a) { | |
a = a.trim(); | |
if ("None" === a) { | |
return vb | |
} | |
if ("TopLeft" === a) { | |
return xb | |
} | |
if ("Top" === a || "TopCenter" === a || "MiddleTop" === a) { | |
return Db | |
} | |
if ("TopRight" === a) { | |
return Gb | |
} | |
if ("Left" === a || "LeftCenter" === a || "MiddleLeft" === a) { | |
return Hb | |
} | |
if ("Center" === a) { | |
return Ib | |
} | |
if ("Right" === a || "RightCenter" === a || "MiddleRight" === a) { | |
return Jb | |
} | |
if ("BottomLeft" === a) { | |
return Qb | |
} | |
if ("Bottom" === a || "BottomCenter" === a || "MiddleBottom" === a) { | |
return Ub | |
} | |
if ("BottomRight" === a) { | |
return Vb | |
} | |
if ("TopSide" === a) { | |
return Wb | |
} | |
if ("LeftSide" === a) { | |
return Xb | |
} | |
if ("RightSide" === a) { | |
return Yb | |
} | |
if ("BottomSide" === a) { | |
return Zb | |
} | |
if ("TopBottomSides" === a) { | |
return $b | |
} | |
if ("LeftRightSides" === a) { | |
return ac | |
} | |
if ("TopLeftSides" === a) { | |
return bc | |
} | |
if ("TopRightSides" === a) { | |
return cc | |
} | |
if ("BottomLeftSides" === a) { | |
return hc | |
} | |
if ("BottomRightSides" === a) { | |
return ic | |
} | |
if ("NotTopSide" === a) { | |
return lc | |
} | |
if ("NotLeftSide" === a) { | |
return mc | |
} | |
if ("NotRightSide" === a) { | |
return rc | |
} | |
if ("NotBottomSide" === a) { | |
return sc | |
} | |
if ("AllSides" === a) { | |
return tc | |
} | |
if ("Default" === a) { | |
return uc | |
} | |
a = a.split(" "); | |
for (var b = 0, c = 0; | |
"" === a[b];) { | |
b++ | |
} | |
var d = a[b++]; | |
void 0 !== d && 0 < d.length && (c = parseFloat(d)); | |
for (var e = 0; | |
"" === a[b];) { | |
b++ | |
} | |
d = a[b++]; | |
void 0 !== d && 0 < d.length && (e = parseFloat(d)); | |
for (var f = 0; | |
"" === a[b];) { | |
b++ | |
} | |
d = a[b++]; | |
void 0 !== d && 0 < d.length && (f = parseFloat(d)); | |
for (var h = 0; | |
"" === a[b];) { | |
b++ | |
} | |
d = a[b++]; | |
void 0 !== d && 0 < d.length && (h = parseFloat(d)); | |
return new L(c, e, f, h) | |
} | |
return new L | |
}; | |
L.stringify = function(a) { | |
return a instanceof L ? a.Vc() ? a.x.toString() + " " + a.y.toString() + " " + a.offsetX.toString() + " " + a.offsetY.toString() : a.toString() : a.toString() | |
}; | |
L.prototype.toString = function() { | |
return this.Vc() ? 0 === this.offsetX && 0 === this.offsetY ? "Spot(" + this.x + "," + this.y + ")" : "Spot(" + this.x + "," + this.y + "," + this.offsetX + "," + this.offsetY + ")" : this.L(vb) ? "None" : this.L(xb) ? "TopLeft" : this.L(Db) ? "Top" : this.L(Gb) ? "TopRight" : this.L(Hb) ? "Left" : this.L(Ib) ? "Center" : this.L(Jb) ? "Right" : this.L(Qb) ? "BottomLeft" : this.L(Ub) ? "Bottom" : this.L(Vb) ? "BottomRight" : this.L(Wb) ? "TopSide" : this.L(Xb) ? "LeftSide" : this.L(Yb) ? "RightSide" : this.L(Zb) ? "BottomSide" : this.L($b) ? "TopBottomSides" : this.L(ac) ? "LeftRightSides" : this.L(bc) ? "TopLeftSides" : this.L(cc) ? "TopRightSides" : this.L(hc) ? "BottomLeftSides" : this.L(ic) ? "BottomRightSides" : this.L(lc) ? "NotTopSide" : this.L(mc) ? "NotLeftSide" : this.L(rc) ? "NotRightSide" : this.L(sc) ? "NotBottomSide" : this.L(tc) ? "AllSides" : this.L(uc) ? "Default" : "None" | |
}; | |
L.prototype.equals = L.prototype.L = function(a) { | |
return a instanceof L ? (this.x === a.x || isNaN(this.x) && isNaN(a.x)) && (this.y === a.y || isNaN(this.y) && isNaN(a.y)) && this.offsetX === a.offsetX && this.offsetY === a.offsetY : !1 | |
}; | |
L.prototype.opposite = function() { | |
return new L(0.5 - (this.x - 0.5), 0.5 - (this.y - 0.5), -this.offsetX, -this.offsetY) | |
}; | |
L.prototype.includesSide = L.prototype.cw = function(a) { | |
if (!this.jl() || !a.jl()) { | |
return !1 | |
} | |
a = a.offsetY; | |
return (this.offsetY & a) === a | |
}; | |
L.prototype.isSpot = L.prototype.Vc = function() { | |
return !isNaN(this.x) && !isNaN(this.y) | |
}; | |
L.prototype.isNoSpot = L.prototype.oe = function() { | |
return isNaN(this.x) || isNaN(this.y) | |
}; | |
L.prototype.isSide = L.prototype.jl = function() { | |
return this.oe() && 1 === this.offsetX && 0 !== this.offsetY | |
}; | |
L.prototype.isDefault = L.prototype.Kc = function() { | |
return isNaN(this.x) && isNaN(this.y) && -1 === this.offsetX && 0 === this.offsetY | |
}; | |
var vb; | |
L.None = vb = sb(new L(0, 0, 0, 0), 0).La(); | |
var uc; | |
L.Default = uc = sb(new L(0, 0, -1, 0), -1).La(); | |
var xb; | |
L.TopLeft = xb = (new L(0, 0, 0, 0)).La(); | |
var Db; | |
L.TopCenter = Db = (new L(0.5, 0, 0, 0)).La(); | |
var Gb; | |
L.TopRight = Gb = (new L(1, 0, 0, 0)).La(); | |
var Hb; | |
L.LeftCenter = Hb = (new L(0, 0.5, 0, 0)).La(); | |
var Ib; | |
L.Center = Ib = (new L(0.5, 0.5, 0, 0)).La(); | |
var Jb; | |
L.RightCenter = Jb = (new L(1, 0.5, 0, 0)).La(); | |
var Qb; | |
L.BottomLeft = Qb = (new L(0, 1, 0, 0)).La(); | |
var Ub; | |
L.BottomCenter = Ub = (new L(0.5, 1, 0, 0)).La(); | |
var Vb; | |
L.BottomRight = Vb = (new L(1, 1, 0, 0)).La(); | |
var vc; | |
L.MiddleTop = vc = Db; | |
var wc; | |
L.MiddleLeft = wc = Hb; | |
var xc; | |
L.MiddleRight = xc = Jb; | |
var Cc; | |
L.MiddleBottom = Cc = Ub; | |
L.Top = Db; | |
var Dc; | |
L.Left = Dc = Hb; | |
var Ec; | |
L.Right = Ec = Jb; | |
L.Bottom = Ub; | |
var Wb; | |
L.TopSide = Wb = sb(new L(0, 0, 1, u.Yc), 1).La(); | |
var Xb; | |
L.LeftSide = Xb = sb(new L(0, 0, 1, u.Ec), 1).La(); | |
var Yb; | |
L.RightSide = Yb = sb(new L(0, 0, 1, u.Nc), 1).La(); | |
var Zb; | |
L.BottomSide = Zb = sb(new L(0, 0, 1, u.Mc), 1).La(); | |
var $b; | |
L.TopBottomSides = $b = sb(new L(0, 0, 1, u.Yc | u.Mc), 1).La(); | |
var ac; | |
L.LeftRightSides = ac = sb(new L(0, 0, 1, u.Ec | u.Nc), 1).La(); | |
var bc; | |
L.TopLeftSides = bc = sb(new L(0, 0, 1, u.Yc | u.Ec), 1).La(); | |
var cc; | |
L.TopRightSides = cc = sb(new L(0, 0, 1, u.Yc | u.Nc), 1).La(); | |
var hc; | |
L.BottomLeftSides = hc = sb(new L(0, 0, 1, u.Mc | u.Ec), 1).La(); | |
var ic; | |
L.BottomRightSides = ic = sb(new L(0, 0, 1, u.Mc | u.Nc), 1).La(); | |
var lc; | |
L.NotTopSide = lc = sb(new L(0, 0, 1, u.Ec | u.Nc | u.Mc), 1).La(); | |
var mc; | |
L.NotLeftSide = mc = sb(new L(0, 0, 1, u.Yc | u.Nc | u.Mc), 1).La(); | |
var rc; | |
L.NotRightSide = rc = sb(new L(0, 0, 1, u.Yc | u.Ec | u.Mc), 1).La(); | |
var sc; | |
L.NotBottomSide = sc = sb(new L(0, 0, 1, u.Yc | u.Ec | u.Nc), 1).La(); | |
var tc; | |
L.AllSides = tc = sb(new L(0, 0, 1, u.Yc | u.Ec | u.Nc | u.Mc), 1).La(); | |
function Lc() { | |
this.bf = [1, 0, 0, 1, 0, 0] | |
} | |
Lc.prototype.copy = function() { | |
var a = new Lc; | |
a.bf[0] = this.bf[0]; | |
a.bf[1] = this.bf[1]; | |
a.bf[2] = this.bf[2]; | |
a.bf[3] = this.bf[3]; | |
a.bf[4] = this.bf[4]; | |
a.bf[5] = this.bf[5]; | |
return a | |
}; | |
function Mc(a) { | |
this.type = a; | |
this.r2 = this.y2 = this.x2 = this.r1 = this.y1 = this.x1 = 0; | |
this.YC = [] | |
} | |
Mc.prototype.addColorStop = function(a, b) { | |
this.YC.push({ | |
offset: a, | |
color: b | |
}) | |
}; | |
function Nc(a, b, c) { | |
this.fillStyle = "#000000"; | |
this.font = "10px sans-serif"; | |
this.globalAlpha = 1; | |
this.lineCap = "butt"; | |
this.ow = 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.document = b || document; | |
this.oD = c; | |
this.lw = null; | |
this.path = []; | |
this.Fi = new Lc; | |
this.stack = []; | |
this.tf = []; | |
this.Rv = a; | |
this.KH = "http://www.w3.org/2000/svg"; | |
this.width = this.Rv.width; | |
this.height = this.Rv.height; | |
this.tl = Oc(this, "svg", { | |
width: this.width + "px", | |
height: this.height + "px", | |
GK: "0 0 " + this.Rv.width + " " + this.Rv.height | |
}); | |
this.tl.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.w3.org/2000/svg"); | |
this.tl.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"); | |
Uc(this, 1, 0, 0, 1, 0, 0); | |
a = u.zl++; | |
b = Oc(this, "clipPath", { | |
id: "mainClip" + a | |
}); | |
b.appendChild(Oc(this, "rect", { | |
x: 0, | |
y: 0, | |
width: this.width, | |
height: this.height | |
})); | |
this.tl.appendChild(b); | |
this.tf[0].setAttributeNS(null, "clip-path", "url(#mainClip" + a + ")") | |
} | |
g = Nc.prototype; | |
g.arc = function(a, b, c, d, e, f) { | |
Vc(this, a, b, c, d, e, f) | |
}; | |
g.beginPath = function() { | |
this.path = [] | |
}; | |
g.bezierCurveTo = function(a, b, c, d, e, f) { | |
this.path.push(["C", a, b, c, d, e, f]) | |
}; | |
g.clearRect = function() {}; | |
g.clip = function() { | |
Wc(this, "clipPath", this.path, new Lc) | |
}; | |
g.closePath = function() { | |
this.path.push(["z"]) | |
}; | |
g.createLinearGradient = function(a, b, c, d) { | |
var e = new Mc("linear"); | |
e.x1 = a; | |
e.y1 = b; | |
e.x2 = c; | |
e.y2 = d; | |
return e | |
}; | |
g.createPattern = function() {}; | |
g.createRadialGradient = function(a, b, c, d, e, f) { | |
var h = new Mc("radial"); | |
h.x1 = a; | |
h.y1 = b; | |
h.r1 = c; | |
h.x2 = d; | |
h.y2 = e; | |
h.r2 = f; | |
return h | |
}; | |
g.drawImage = function(a, b, c, d, e, f, h, k, l) { | |
var m = ""; | |
a instanceof HTMLCanvasElement && (m = a.toDataURL()); | |
a instanceof HTMLImageElement && (m = a.src); | |
m = { | |
x: 0, | |
y: 0, | |
width: a.naturalWidth, | |
height: a.naturalHeight, | |
href: m | |
}; | |
m.preserveAspectRatio = K.Wa(d, k) && K.Wa(e, l) ? "xMidYMid slice" : "none"; | |
var n = ""; | |
k /= d; | |
l /= e; | |
if (0 !== f || 0 !== h) { | |
n += " translate(" + f + ", " + h + ")" | |
} | |
if (1 !== k || 1 !== l) { | |
n += " scale(" + k + ", " + l + ")" | |
} | |
if (0 !== b || 0 !== c) { | |
n += " translate(" + -b + ", " + -c + ")" | |
} | |
if (0 !== b || 0 !== c || d !== a.naturalWidth || e !== a.naturalHeight) { | |
a = "CLIP" + u.zl++, f = Oc(this, "clipPath", { | |
id: a | |
}), f.appendChild(Oc(this, "rect", { | |
x: b, | |
y: c, | |
width: d, | |
height: e | |
})), this.tl.appendChild(f), m["clip-path"] = "url(#" + a + ")" | |
} | |
Xc(this, "image", m, this.Fi, n); | |
this.addElement("image", m) | |
}; | |
g.fill = function() { | |
Wc(this, "fill", this.path, this.Fi) | |
}; | |
g.fillRect = function(a, b, c, d) { | |
Yc(this, "fill", [a, b, c, d], this.Fi) | |
}; | |
g.fillText = function(a, b, c) { | |
a = [a, b, c]; | |
b = this.textAlign; | |
"left" === b ? b = "start" : "right" === b ? b = "end" : "center" === b && (b = "middle"); | |
b = { | |
x: a[1], | |
y: a[2], | |
style: "font: " + this.font, | |
"text-anchor": b | |
}; | |
Xc(this, "fill", b, this.Fi); | |
this.addElement("text", b, a[0]) | |
}; | |
g.lineTo = function(a, b) { | |
this.path.push(["L", a, b]) | |
}; | |
g.moveTo = function(a, b) { | |
this.path.push(["M", a, b]) | |
}; | |
g.quadraticCurveTo = function(a, b, c, d) { | |
this.path.push(["Q", a, b, c, d]) | |
}; | |
g.rect = function(a, b, c, d) { | |
this.path.push(["M", a, b], ["L", a + c, b], ["L", a + c, b + d], ["L", a, b + d], ["z"]) | |
}; | |
g.restore = function() { | |
this.Fi = 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.ow = a.ow; | |
this.lineJoin = a.lineJoin; | |
this.lineWidth = a.lineWidth; | |
this.miterLimit = a.miterLimit; | |
this.shadowBlur = a.shadowBlur; | |
this.shadowColor = a.shadowColor; | |
this.shadowOffsetX = a.shadowOffsetX; | |
this.shadowOffsetY = a.shadowOffsetY; | |
this.strokeStyle = a.strokeStyle; | |
this.textAlign = a.textAlign | |
}; | |
g.save = function() { | |
this.stack.push({ | |
fillStyle: this.fillStyle, | |
font: this.font, | |
globalAlpha: this.globalAlpha, | |
lineCap: this.lineCap, | |
ow: this.ow, | |
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.Fi.copy()) | |
}; | |
g.setTransform = function(a, b, c, d, e, f) { | |
1 === a && 0 === b && 0 === c && 1 === d && 0 === e && 0 === f || Uc(this, a, b, c, d, e, f) | |
}; | |
g.scale = function() {}; | |
g.stroke = function() { | |
Wc(this, "stroke", this.path, this.Fi) | |
}; | |
g.strokeRect = function(a, b, c, d) { | |
Yc(this, "stroke", [a, b, c, d], this.Fi) | |
}; | |
function Oc(a, b, c, d) { | |
a = a.document.createElementNS(a.KH, b); | |
if (u.Ta(c)) { | |
for (var e in c) { | |
a.setAttributeNS("href" === e ? "http://www.w3.org/1999/xlink" : "", e, c[e]) | |
} | |
} | |
void 0 !== d && (a.textContent = d); | |
return a | |
} | |
g.addElement = function(a, b, c) { | |
a = Oc(this, a, b, c); | |
0 < this.tf.length ? this.tf[this.tf.length - 1].appendChild(a) : this.tl.appendChild(a); | |
return this.lw = a | |
}; | |
function Xc(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 Mc ? Zc(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 Mc ? Zc(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.bf; | |
d = "matrix(" + d[0] + ", " + d[1] + ", " + d[2] + ", " + d[3] + ", " + d[4] + ", " + d[5] + ")"; | |
void 0 !== e && (d += e); | |
c.transform = d | |
} | |
function Zc(a, b) { | |
var c = "GRAD" + u.zl++, | |
d; | |
if ("linear" === b.type) { | |
d = { | |
x1: b.x1, | |
x2: b.x2, | |
y1: b.y1, | |
y2: b.y2, | |
id: c, | |
gradientUnits: "userSpaceOnUse" | |
}, d = Oc(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 = Oc(a, "radialGradient", d) | |
} else { | |
throw Error("invalid gradient") | |
} | |
} | |
for (var e = b.YC, f = e.length, h = [], k = 0; k < f; k++) { | |
var l = e[k], | |
m = l.color, | |
l = { | |
offset: l.offset, | |
"stop-color": m | |
}; | |
/^rgba\(/.test(m) && (m = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(m), l["stop-color"] = "rgb(" + m[1] + "," + m[2] + "," + m[3] + ")", l["stop-opacity"] = m[4]); | |
h.push(l) | |
} | |
h.sort(function(a, b) { | |
return a.offset > b.offset ? 1 : -1 | |
}); | |
for (k = 0; k < f; k++) { | |
d.appendChild(Oc(a, "stop", h[k])) | |
} | |
a.tl.appendChild(d); | |
return "url(#" + c + ")" | |
} | |
function Yc(a, b, c, d) { | |
c = { | |
x: c[0], | |
y: c[1], | |
width: c[2], | |
height: c[3] | |
}; | |
Xc(a, b, c, d); | |
a.addElement("rect", c) | |
} | |
function Wc(a, b, c, d) { | |
for (var e = [], f = 0; f < c.length; f++) { | |
var h = u.Pk(c[f]), | |
k = [h.shift()]; | |
if ("A" == k[0]) { | |
k.push(h.shift() + "," + h.shift(), h.shift(), h.shift() + "," + h.shift(), h.shift() + "," + h.shift()) | |
} else { | |
for (; h.length;) { | |
k.push(h.shift() + "," + h.shift()) | |
} | |
} | |
e.push(k.join(" ")) | |
} | |
c = { | |
d: e.join(" ") | |
}; | |
Xc(a, b, c, d); | |
"clipPath" === b ? (b = "CLIP" + u.zl++, d = Oc(a, "clipPath", { | |
id: b | |
}), d.appendChild(Oc(a, "path", c)), a.tl.appendChild(d), 0 < a.tf.length && a.tf[a.tf.length - 1].setAttributeNS(null, "clip-path", "url(#" + b + ")")) : a.addElement("path", c) | |
} | |
function Vc(a, b, c, d, e, f, h) { | |
var k = Math.abs(e - f); | |
if (e != f) { | |
var l = b + d * Math.cos(f); | |
f = c + d * Math.sin(f); | |
k >= 2 * Math.PI ? (Vc(a, b, c, d, e, e + Math.PI, h), Vc(a, b, c, d, e + Math.PI, e + 2 * Math.PI, h), a.path.push(["M", l, f])) : (b += d * Math.cos(e), c += d * Math.sin(e), k = 180 * k / Math.PI, e = h ? 0 : 1, h = 180 <= k == !!h ? 0 : 1, 0 !== a.path.length ? a.path.push(["L", b, c]) : a.path.push(["M", b, c]), a.path.push(["A", d, d, k, h, e, l, f])) | |
} | |
} | |
function Uc(a, b, c, d, e, f, h) { | |
var k = new Lc; | |
k.bf = [b, c, d, e, f, h]; | |
b = {}; | |
Xc(a, "g", b, k); | |
k = a.addElement("g", b); | |
a.tf.push(k) | |
} | |
g.ab = function() { | |
if (0 !== this.shadowOffsetX || 0 !== this.shadowOffsetY || 0 !== this.shadowBlur) { | |
var a = "SHADOW" + u.zl++, | |
b = this.addElement("filter", { | |
id: a, | |
x: "-100%", | |
y: "-100%", | |
width: "300%", | |
height: "300%" | |
}, null), | |
c, d, e, f, h; | |
c = Oc(this, "feGaussianBlur", { | |
"in": "SourceAlpha", | |
result: "blur", | |
yK: this.shadowBlur / 2 | |
}); | |
d = Oc(this, "feFlood", { | |
"in": "blur", | |
result: "flood", | |
"flood-color": this.shadowColor | |
}); | |
e = Oc(this, "feComposite", { | |
"in": "flood", | |
in2: "blur", | |
operator: "in", | |
result: "comp" | |
}); | |
f = Oc(this, "feOffset", { | |
"in": "comp", | |
result: "offsetBlur", | |
dx: this.shadowOffsetX, | |
dy: this.shadowOffsetY | |
}); | |
h = Oc(this, "feMerge", {}); | |
h.appendChild(Oc(this, "feMergeNode", { | |
"in": "offsetBlur" | |
})); | |
h.appendChild(Oc(this, "feMergeNode", { | |
"in": "SourceGraphic" | |
})); | |
b.appendChild(c); | |
b.appendChild(d); | |
b.appendChild(e); | |
b.appendChild(f); | |
b.appendChild(h); | |
0 < this.tf.length && this.tf[this.tf.length - 1].setAttributeNS(null, "filter", "url(#" + a + ")") | |
} | |
}; | |
function oa(a, b) { | |
this.ownerDocument = void 0 === b ? document : b; | |
var c = this.ownerDocument.createElement("canvas"); | |
c.tabIndex = 0; | |
this.Fd = c; | |
c.getContext && c.getContext("2d") || u.k("Browser does not support HTML Canvas Element"); | |
this.eG = c.getContext("2d"); | |
c.Y = a; | |
Object.seal(this) | |
} | |
g = oa.prototype; | |
g.getContext = function() { | |
return this.eG | |
}; | |
g.toDataURL = function(a, b) { | |
return this.Fd.toDataURL(a, b) | |
}; | |
g.getBoundingClientRect = function() { | |
return this.Fd.getBoundingClientRect() | |
}; | |
g.focus = function() { | |
return this.Fd.focus() | |
}; | |
g.addEventListener = function(a, b, c) { | |
this.Fd.addEventListener(a, b, c) | |
}; | |
g.removeEventListener = function(a, b, c) { | |
this.Fd.removeEventListener(a, b, c) | |
}; | |
u.defineProperty(oa, { | |
width: "width" | |
}, function() { | |
return this.Fd.width | |
}, function(a) { | |
this.Fd.width = a | |
}); | |
u.defineProperty(oa, { | |
height: "height" | |
}, function() { | |
return this.Fd.height | |
}, function(a) { | |
this.Fd.height = a | |
}); | |
u.defineProperty(oa, { | |
style: "style" | |
}, function() { | |
return this.Fd.style | |
}, function(a) { | |
this.Fd.style = a | |
}); | |
var K = { | |
ta: 4 * ((Math.sqrt(2) - 1) / 3), | |
Wj: (new w(0, 0)).La(), | |
kF: (new z(0, 0, 0, 0)).La(), | |
pp: (new rb(0, 0, 0, 0)).La(), | |
iF: (new rb(2, 2, 2, 2)).La(), | |
jF: (new ia(Infinity, Infinity)).La(), | |
fF: (new w(-Infinity, -Infinity)).La(), | |
eF: (new w(Infinity, Infinity)).La(), | |
qp: (new ia(0, 0)).La(), | |
Vw: (new ia(1, 1)).La(), | |
op: (new ia(6, 6)).La(), | |
Sw: (new ia(8, 8)).La(), | |
gF: (new w(NaN, NaN)).La(), | |
Ww: new pa, | |
Ri: new pa, | |
wA: null, | |
sqrt: function(a) { | |
if (0 >= a) { | |
return 0 | |
} | |
var b = K.wA; | |
if (null === b) { | |
for (var b = [], c = 0; 2000 >= c; c++) { | |
b[c] = Math.sqrt(c) | |
} | |
K.wA = b | |
} | |
return 1 > a ? (c = 1 / a, 2000 >= c ? 1 / b[c | 0] : Math.sqrt(a)) : 2000 >= a ? b[a | 0] : Math.sqrt(a) | |
}, | |
D: function(a, b) { | |
var c = a - b; | |
return 0.5 > c && -0.5 < c | |
}, | |
Wa: function(a, b) { | |
var c = a - b; | |
return 5e-8 > c && -5e-8 < c | |
}, | |
sd: function(a, b, c, d, e, f, h) { | |
0 >= e && (e = 0.000001); | |
var k = 0, | |
l = 0, | |
m = 0, | |
n = 0; | |
a < c ? (l = a, k = c) : (l = c, k = a); | |
b < d ? (n = b, m = d) : (n = d, m = b); | |
if (a === c) { | |
return n <= h && h <= m && a - e <= f && f <= a + e | |
} | |
if (b === d) { | |
return l <= f && f <= k && b - e <= h && h <= b + e | |
} | |
k += e; | |
l -= e; | |
if (l <= f && f <= k && (m += e, n -= e, n <= h && h <= m)) { | |
if (k - l > m - n) { | |
if (a - c > e || c - a > e) { | |
if (f = (d - b) / (c - a) * (f - a) + b, f - e <= h && h <= f + e) { | |
return !0 | |
} | |
} else { | |
return !0 | |
} | |
} else { | |
if (b - d > e || d - b > e) { | |
if (h = (c - a) / (d - b) * (h - b) + a, h - e <= f && f <= h + e) { | |
return !0 | |
} | |
} else { | |
return !0 | |
} | |
} | |
} | |
return !1 | |
}, | |
Jv: function(a, b, c, d, e, f, h, k, l, m, n, p) { | |
if (K.sd(a, b, h, k, p, c, d) && K.sd(a, b, h, k, p, e, f)) { | |
return K.sd(a, b, h, k, p, m, n) | |
} | |
var q = (a + c) / 2, | |
r = (b + d) / 2, | |
s = (c + e) / 2, | |
t = (d + f) / 2; | |
e = (e + h) / 2; | |
f = (f + k) / 2; | |
d = (q + s) / 2; | |
c = (r + t) / 2; | |
var s = (s + e) / 2, | |
t = (t + f) / 2, | |
v = (d + s) / 2, | |
x = (c + t) / 2; | |
return K.Jv(a, b, q, r, d, c, v, x, l, m, n, p) || K.Jv(v, x, s, t, e, f, h, k, l, m, n, p) | |
}, | |
VF: function(a, b, c, d, e, f, h, k, l) { | |
var m = (c + e) / 2, | |
n = (d + f) / 2; | |
l.x = (((a + c) / 2 + m) / 2 + (m + (e + h) / 2) / 2) / 2; | |
l.y = (((b + d) / 2 + n) / 2 + (n + (f + k) / 2) / 2) / 2; | |
return l | |
}, | |
UF: function(a, b, c, d, e, f, h, k) { | |
var l = (c + e) / 2, | |
m = (d + f) / 2; | |
return Za(((a + c) / 2 + l) / 2, ((b + d) / 2 + m) / 2, (l + (e + h) / 2) / 2, (m + (f + k) / 2) / 2) | |
}, | |
qo: function(a, b, c, d, e, f, h, k, l, m) { | |
if (K.sd(a, b, h, k, l, c, d) && K.sd(a, b, h, k, l, e, f)) { | |
kb(m, a, b, 0, 0), kb(m, h, k, 0, 0) | |
} else { | |
var n = (a + c) / 2, | |
p = (b + d) / 2, | |
q = (c + e) / 2, | |
r = (d + f) / 2; | |
e = (e + h) / 2; | |
f = (f + k) / 2; | |
d = (n + q) / 2; | |
c = (p + r) / 2; | |
var q = (q + e) / 2, | |
r = (r + f) / 2, | |
s = (d + q) / 2, | |
t = (c + r) / 2; | |
K.qo(a, b, n, p, d, c, s, t, l, m); | |
K.qo(s, t, q, r, e, f, h, k, l, m) | |
} | |
return m | |
}, | |
Ae: function(a, b, c, d, e, f, h, k, l, m) { | |
if (K.sd(a, b, h, k, l, c, d) && K.sd(a, b, h, k, l, e, f)) { | |
0 === m.length && (m.push(a), m.push(b)), m.push(h), m.push(k) | |
} else { | |
var n = (a + c) / 2, | |
p = (b + d) / 2, | |
q = (c + e) / 2, | |
r = (d + f) / 2; | |
e = (e + h) / 2; | |
f = (f + k) / 2; | |
d = (n + q) / 2; | |
c = (p + r) / 2; | |
var q = (q + e) / 2, | |
r = (r + f) / 2, | |
s = (d + q) / 2, | |
t = (c + r) / 2; | |
K.Ae(a, b, n, p, d, c, s, t, l, m); | |
K.Ae(s, t, q, r, e, f, h, k, l, m) | |
} | |
return m | |
}, | |
Pz: function(a, b, c, d, e, f, h, k, l, m) { | |
if (K.sd(a, b, e, f, m, c, d)) { | |
return K.sd(a, b, e, f, m, k, l) | |
} | |
var n = (a + c) / 2, | |
p = (b + d) / 2; | |
c = (c + e) / 2; | |
d = (d + f) / 2; | |
var q = (n + c) / 2, | |
r = (p + d) / 2; | |
return K.Pz(a, b, n, p, q, r, h, k, l, m) || K.Pz(q, r, c, d, e, f, h, k, l, m) | |
}, | |
qK: function(a, b, c, d, e, f, h) { | |
h.x = ((a + c) / 2 + (c + e) / 2) / 2; | |
h.y = ((b + d) / 2 + (d + f) / 2) / 2; | |
return h | |
}, | |
Oz: function(a, b, c, d, e, f, h, k) { | |
if (K.sd(a, b, e, f, h, c, d)) { | |
kb(k, a, b, 0, 0), kb(k, e, f, 0, 0) | |
} else { | |
var l = (a + c) / 2, | |
m = (b + d) / 2; | |
c = (c + e) / 2; | |
d = (d + f) / 2; | |
var n = (l + c) / 2, | |
p = (m + d) / 2; | |
K.Oz(a, b, l, m, n, p, h, k); | |
K.Oz(n, p, c, d, e, f, h, k) | |
} | |
return k | |
}, | |
Zo: function(a, b, c, d, e, f, h, k) { | |
if (K.sd(a, b, e, f, h, c, d)) { | |
0 === k.length && (k.push(a), k.push(b)), k.push(e), k.push(f) | |
} else { | |
var l = (a + c) / 2, | |
m = (b + d) / 2; | |
c = (c + e) / 2; | |
d = (d + f) / 2; | |
var n = (l + c) / 2, | |
p = (m + d) / 2; | |
K.Zo(a, b, l, m, n, p, h, k); | |
K.Zo(n, p, c, d, e, f, h, k) | |
} | |
return k | |
}, | |
ls: function(a, b, c, d, e, f, h, k, l, m, n, p, q, r) { | |
0 >= q && (q = 0.000001); | |
if (K.sd(a, b, h, k, q, c, d) && K.sd(a, b, h, k, q, e, f)) { | |
var s = (a - h) * (m - p) - (b - k) * (l - n); | |
if (0 === s) { | |
return !1 | |
} | |
q = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / s; | |
s = ((a * k - b * h) * (m - p) - (b - k) * (l * p - m * n)) / s; | |
if ((l > n ? l - n : n - l) < (m > p ? m - p : p - m)) { | |
if (h = l = 0, b < k ? (l = b, h = k) : (l = k, h = b), s < l || s > h) { | |
return !1 | |
} | |
} else { | |
if (a < h ? l = a : (l = h, h = a), q < l || q > h) { | |
return !1 | |
} | |
} | |
r.x = q; | |
r.y = s; | |
return !0 | |
} | |
var s = (a + c) / 2, | |
t = (b + d) / 2; | |
c = (c + e) / 2; | |
d = (d + f) / 2; | |
e = (e + h) / 2; | |
f = (f + k) / 2; | |
var v = (s + c) / 2, | |
x = (t + d) / 2; | |
c = (c + e) / 2; | |
d = (d + f) / 2; | |
var A = (v + c) / 2, | |
y = (x + d) / 2, | |
C = (n - l) * (n - l) + (p - m) * (p - m), | |
I = !1; | |
K.ls(a, b, s, t, v, x, A, y, l, m, n, p, q, r) && (b = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), b < C && (C = b, I = !0)); | |
a = r.x; | |
s = r.y; | |
K.ls(A, y, c, d, e, f, h, k, l, m, n, p, q, r) && (b = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), b < C ? I = !0 : (r.x = a, r.y = s)); | |
return I | |
}, | |
ms: function(a, b, c, d, e, f, h, k, l, m, n, p, q) { | |
var r = 0; | |
0 >= q && (q = 0.000001); | |
if (K.sd(a, b, h, k, q, c, d) && K.sd(a, b, h, k, q, e, f)) { | |
q = (a - h) * (m - p) - (b - k) * (l - n); | |
if (0 === q) { | |
return r | |
} | |
var s = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / q, | |
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 + f) / 2; | |
e = (e + h) / 2; | |
f = (f + k) / 2; | |
d = (s + v) / 2; | |
c = (t + x) / 2; | |
var v = (v + e) / 2, | |
x = (x + f) / 2, | |
A = (d + v) / 2, | |
y = (c + x) / 2, | |
r = r + K.ms(a, b, s, t, d, c, A, y, l, m, n, p, q), | |
r = r + K.ms(A, y, v, x, e, f, h, k, l, m, n, p, q) | |
} | |
return r | |
}, | |
Lm: function(a, b, c, d, e, f, h) { | |
if (K.Wa(a, c)) { | |
var k = 0; | |
c = 0; | |
b < d ? (k = b, c = d) : (k = d, c = b); | |
d = f; | |
if (d < k) { | |
return h.x = a, h.y = k, !1 | |
} | |
if (d > c) { | |
return h.x = a, h.y = c, !1 | |
} | |
h.x = a; | |
h.y = d; | |
return !0 | |
} | |
if (K.Wa(b, d)) { | |
a < c ? k = a : (k = c, c = a); | |
d = e; | |
if (d < k) { | |
return h.x = k, h.y = b, !1 | |
} | |
if (d > c) { | |
return h.x = c, h.y = b, !1 | |
} | |
h.x = d; | |
h.y = b; | |
return !0 | |
} | |
k = ((a - e) * (a - c) + (b - f) * (b - d)) / ((c - a) * (c - a) + (d - b) * (d - b)); | |
if (-0.000005 > 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 | |
}, | |
bh: function(a, b, c, d, e, f, h, k, l) { | |
if (K.D(a, c) && K.D(b, d)) { | |
return l.x = a, l.y = b, !1 | |
} | |
if (K.Wa(e, h)) { | |
if (K.Wa(a, c)) { | |
return K.Lm(a, b, c, d, e, f, l), !1 | |
} | |
f = (d - b) / (c - a) * (e - a) + b; | |
return K.Lm(a, b, c, d, e, f, l) | |
} | |
k = (k - f) / (h - e); | |
if (K.Wa(a, c)) { | |
f = k * (a - e) + f; | |
c = h = 0; | |
b < d ? (h = b, c = d) : (h = d, c = b); | |
if (f < h) { | |
return l.x = a, l.y = h, !1 | |
} | |
if (f > c) { | |
return l.x = a, l.y = c, !1 | |
} | |
l.x = a; | |
l.y = f; | |
return !0 | |
} | |
h = (d - b) / (c - a); | |
if (K.Wa(k, h)) { | |
return K.Lm(a, b, c, d, e, f, l), !1 | |
} | |
e = (h * a - k * e + f - b) / (h - k); | |
if (K.Wa(h, 0)) { | |
a < c ? h = a : (h = c, c = a); | |
if (e < h) { | |
return l.x = h, l.y = b, !1 | |
} | |
if (e > c) { | |
return l.x = c, l.y = b, !1 | |
} | |
l.x = e; | |
l.y = b; | |
return !0 | |
} | |
f = h * (e - a) + b; | |
return K.Lm(a, b, c, d, e, f, l) | |
}, | |
TJ: function(a, b, c, d, e) { | |
return K.bh(c.x, c.y, d.x, d.y, a.x, a.y, b.x, b.y, e) | |
}, | |
BJ: function(a, b, c, d, e, f, h, k, l, m) { | |
function n(c, d) { | |
var e = (c - a) * (c - a) + (d - b) * (d - b); | |
e < p && (p = e, l.x = c, l.y = d) | |
} | |
var p = Infinity; | |
n(l.x, l.y); | |
var q = 0, | |
r = 0, | |
s = 0, | |
t = 0; | |
e < h ? (q = e, r = h) : (q = h, r = e); | |
f < k ? (s = e, t = h) : (s = h, t = e); | |
q = (r - q) / 2 + m; | |
m = (t - s) / 2 + m; | |
e = (e + h) / 2; | |
f = (f + k) / 2; | |
if (0 === q || 0 === m) { | |
return l | |
} | |
if (0.5 > (c > a ? c - a : a - c)) { | |
q = 1 - (c - e) * (c - e) / (q * q); | |
if (0 > q) { | |
return l | |
} | |
q = Math.sqrt(q); | |
d = -m * q + f; | |
n(c, m * q + f); | |
n(c, d) | |
} else { | |
c = (d - b) / (c - a); | |
d = 1 / (q * q) + c * c / (m * m); | |
k = 2 * c * (b - c * a) / (m * m) - 2 * c * f / (m * m) - 2 * e / (q * q); | |
q = k * k - 4 * d * (2 * c * a * f / (m * m) - 2 * b * f / (m * m) + f * f / (m * m) + e * e / (q * q) - 1 + (b - c * a) * (b - c * a) / (m * m)); | |
if (0 > q) { | |
return l | |
} | |
q = Math.sqrt(q); | |
m = (-k + q) / (2 * d); | |
n(m, c * m - c * a + b); | |
q = (-k - q) / (2 * d); | |
n(q, c * q - c * a + b) | |
} | |
return l | |
}, | |
bl: function(a, b, c, d, e, f, h, k, l) { | |
var m = 1e+21, | |
n = a, | |
p = b; | |
if (K.bh(a, b, a, d, e, f, h, k, l)) { | |
var q = (l.x - e) * (l.x - e) + (l.y - f) * (l.y - f); | |
q < m && (m = q, n = l.x, p = l.y) | |
} | |
K.bh(c, b, c, d, e, f, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - f) * (l.y - f), q < m && (m = q, n = l.x, p = l.y)); | |
K.bh(a, b, c, b, e, f, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - f) * (l.y - f), q < m && (m = q, n = l.x, p = l.y)); | |
K.bh(a, d, c, d, e, f, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - f) * (l.y - f), q < m && (m = q, n = l.x, p = l.y)); | |
l.x = n; | |
l.y = p; | |
return 1e+21 > m | |
}, | |
ew: function(a, b, c) { | |
var d = b.x, | |
e = b.y, | |
f = c.x, | |
h = c.y, | |
k = a.left, | |
l = a.right, | |
m = a.top, | |
n = a.bottom; | |
return d === f ? (f = a = 0, e < h ? (a = e, f = h) : (a = h, f = e), k <= d && d <= l && a <= n && f >= m) : e === h ? (d < f ? a = d : (a = f, f = d), m <= e && e <= n && a <= l && f >= k) : a.Da(b) || a.Da(c) || K.dw(k, m, l, m, d, e, f, h) || K.dw(l, m, l, n, d, e, f, h) || K.dw(l, n, k, n, d, e, f, h) || K.dw(k, n, k, m, d, e, f, h) ? !0 : !1 | |
}, | |
dw: function(a, b, c, d, e, f, h, k) { | |
return 0 >= K.Nv(a, b, c, d, e, f) * K.Nv(a, b, c, d, h, k) && 0 >= K.Nv(e, f, h, k, a, b) * K.Nv(e, f, h, k, c, d) | |
}, | |
Nv: function(a, b, c, d, e, f) { | |
c -= a; | |
d -= b; | |
a = e - a; | |
b = f - b; | |
f = a * d - b * c; | |
0 === f && (f = a * c + b * d, 0 < f && (f = (a - c) * c + (b - d) * d, 0 > f && (f = 0))); | |
return 0 > f ? -1 : 0 < f ? 1 : 0 | |
}, | |
dt: function(a) { | |
0 > a && (a += 360); | |
360 <= a && (a -= 360); | |
return a | |
}, | |
gD: function(a, b, c, d, e, f) { | |
var h = Math.PI; | |
f || (d *= h / 180, e *= h / 180); | |
f = d < e ? 1 : -1; | |
var k = [], | |
l = h / 2, | |
m = d; | |
for (d = Math.min(2 * h, Math.abs(e - d)); 0.00001 < d;) { | |
e = m + f * Math.min(d, l), k.push(K.kG(c, m, e, a, b)), d -= Math.abs(e - m), m = e | |
} | |
return k | |
}, | |
kG: function(a, b, c, d, e) { | |
var f = (c - b) / 2, | |
h = a * Math.cos(f), | |
k = a * Math.sin(f), | |
l = -k, | |
m = h * h + l * l, | |
n = m + h * h + l * k, | |
m = 4 / 3 * (Math.sqrt(2 * m * n) - n) / (h * k - l * h), | |
k = h - m * l, | |
h = l + m * h, | |
l = -h, | |
m = f + b, | |
f = Math.cos(m), | |
m = Math.sin(m); | |
return [d + a * Math.cos(b), e + a * Math.sin(b), d + k * f - h * m, e + k * m + h * f, d + k * f - l * m, e + k * m + l * f, d + a * Math.cos(c), e + a * Math.sin(c)] | |
}, | |
ys: function(a, b, c, d, e, f, h) { | |
c = Math.floor((a - c) / e) * e + c; | |
d = Math.floor((b - d) / f) * f + d; | |
var k = c; | |
c + e - a < e / 2 && (k = c + e); | |
a = d; | |
d + f - b < f / 2 && (a = d + f); | |
h.m(k, a); | |
return h | |
}, | |
yD: function(a, b) { | |
var c = Math.max(a, b), | |
d = Math.min(a, b), | |
e = 1, | |
f = 1; | |
do { | |
e = c % d, c = f = d, d = e | |
} while (0 < e); | |
return f | |
}, | |
tG: function(a, b, c, d) { | |
var e = 0 > c, | |
f = 0 > d, | |
h = 0, | |
k = h = 0; | |
a < b ? (h = 1, k = 0) : (h = 0, k = 1); | |
var l = 0, | |
m = 0, | |
n = 0, | |
l = 0 === h ? a : b, | |
m = 0 === h ? c : d; | |
if (0 === h ? e : f) { | |
m = -m | |
} | |
h = k; | |
n = 0 === h ? c : d; | |
if (0 === h ? e : f) { | |
n = -n | |
} | |
return K.uG(l, 0 === h ? a : b, m, n, 0, 0) | |
}, | |
uG: function(a, b, c, d, e, f) { | |
e = 0; | |
if (0 < d) { | |
if (0 < c) { | |
f = a * a; | |
e = b * b; | |
a *= c; | |
var h = b * d, | |
k = -e + h, | |
l = -e + Math.sqrt(a * a + h * h); | |
b = k; | |
for (var m = 0; 9999999999 > m; ++m) { | |
b = 0.5 * (k + l); | |
if (b === k || b === l) { | |
break | |
} | |
var n = a / (b + f), | |
p = h / (b + e), | |
n = n * n + p * p - 1; | |
if (0 < n) { | |
k = b | |
} else { | |
if (0 > n) { | |
l = b | |
} else { | |
break | |
} | |
} | |
} | |
c = f * c / (b + f) - c; | |
d = e * d / (b + e) - d; | |
e = Math.sqrt(c * c + d * d) | |
} else { | |
e = Math.abs(d - b) | |
} | |
} else { | |
d = a * a - b * b, e = a * c, e < d ? (d = e / d, e = a * d, f = b * Math.sqrt(Math.abs(1 - d * d)), c = e - c, e = Math.sqrt(c * c + f * f)) : e = Math.abs(c - a) | |
} | |
return e | |
} | |
}; | |
function $c(a) { | |
1 < arguments.length && u.k("Geometry constructor can take at most one optional argument, the Geometry type."); | |
u.gc(this); | |
this.Ea = !1; | |
void 0 === a && (a = ad); | |
this.pa = a; | |
this.Bb = this.pb = this.tc = this.nc = 0; | |
this.Zi = new E(bd); | |
this.ku = this.Zi.T; | |
this.Vt = (new z).freeze(); | |
this.Ua = !0; | |
this.si = xb; | |
this.ti = Vb; | |
this.En = this.Fn = NaN; | |
this.ci = cd | |
} | |
u.fa("Geometry", $c); | |
u.Nh($c); | |
$c.prototype.copy = function() { | |
var a = new $c; | |
a.pa = this.pa; | |
a.nc = this.nc; | |
a.tc = this.tc; | |
a.pb = this.pb; | |
a.Bb = this.Bb; | |
for (var b = this.Zi.n, c = b.length, d = a.Zi, e = 0; e < c; e++) { | |
var f = b[e].copy(); | |
d.add(f) | |
} | |
a.ku = this.ku; | |
a.Vt.assign(this.Vt); | |
a.Ua = this.Ua; | |
a.si = this.si.Z(); | |
a.ti = this.ti.Z(); | |
a.Fn = this.Fn; | |
a.En = this.En; | |
a.ci = this.ci; | |
return a | |
}; | |
var dd; | |
$c.Line = dd = u.s($c, "Line", 0); | |
var md; | |
$c.Rectangle = md = u.s($c, "Rectangle", 1); | |
var nd; | |
$c.Ellipse = nd = u.s($c, "Ellipse", 2); | |
var ad; | |
$c.Path = ad = u.s($c, "Path", 3); | |
$c.prototype.La = function() { | |
this.freeze(); | |
Object.freeze(this); | |
return this | |
}; | |
$c.prototype.freeze = function() { | |
this.Ea = !0; | |
var a = this.ub; | |
a.freeze(); | |
for (var a = a.n, b = a.length, c = 0; c < b; c++) { | |
a[c].freeze() | |
} | |
return this | |
}; | |
$c.prototype.Ma = function() { | |
Object.isFrozen(this) && u.k("cannot thaw constant: " + this); | |
this.Ea = !1; | |
var a = this.ub; | |
a.Ma(); | |
for (var a = a.n, b = a.length, c = 0; c < b; c++) { | |
a[c].Ma() | |
} | |
return this | |
}; | |
$c.prototype.equalsApprox = $c.prototype.pd = function(a) { | |
if (!(a instanceof $c)) { | |
return !1 | |
} | |
if (this.type !== a.type) { | |
return this.type === dd && a.type === ad ? od(this, a) : a.type === dd && this.type === ad ? od(a, this) : !1 | |
} | |
if (this.type === ad) { | |
var b = this.ub.n; | |
a = a.ub.n; | |
var c = b.length; | |
if (c !== a.length) { | |
return !1 | |
} | |
for (var d = 0; d < c; d++) { | |
if (!b[d].pd(a[d])) { | |
return !1 | |
} | |
} | |
return !0 | |
} | |
return K.D(this.va, a.va) && K.D(this.wa, a.wa) && K.D(this.F, a.F) && K.D(this.G, a.G) | |
}; | |
function od(a, b) { | |
if (a.type !== dd || b.type !== ad) { | |
return !1 | |
} | |
if (1 === b.ub.count) { | |
var c = b.ub.ja(0); | |
if (1 === c.Ga.count && K.D(a.va, c.va) && K.D(a.wa, c.wa) && (c = c.Ga.ja(0), c.type === pd && K.D(a.F, c.F) && K.D(a.G, c.G))) { | |
return !0 | |
} | |
} | |
return !1 | |
} | |
var qd; | |
$c.stringify = qd = function(a) { | |
return a.toString() | |
}; | |
$c.prototype.toString = function(a) { | |
void 0 === a && (a = -1); | |
switch (this.type) { | |
case dd: | |
return 0 > a ? "M" + this.va.toString() + " " + this.wa.toString() + "L" + this.F.toString() + " " + this.G.toString() : "M" + this.va.toFixed(a) + " " + this.wa.toFixed(a) + "L" + this.F.toFixed(a) + " " + this.G.toFixed(a); | |
case md: | |
var b = new z(this.va, this.wa, 0, 0); | |
b.YE(this.F, this.G, 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 nd: | |
b = new z(this.va, this.wa, 0, 0); | |
b.YE(this.F, this.G, 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 ad: | |
for (var b = "", c = this.ub.n, d = c.length, e = 0; e < d; e++) { | |
var f = c[e]; | |
0 < e && (b += " x "); | |
f.Os && (b += "F "); | |
b += f.toString(a) | |
} | |
return b; | |
default: | |
return this.type.toString() | |
} | |
}; | |
var rd; | |
$c.fillPath = rd = function(a) { | |
"string" !== typeof a && u.Ld(a, "string", $c, "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 sd; | |
$c.parse = sd = 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 w(parseFloat(d()), parseFloat(d())); | |
n === n.toLowerCase() && (a.x = s.x + a.x, a.y = s.y + a.y); | |
return a | |
} | |
function f() { | |
return s = e() | |
} | |
function h() { | |
return r = e() | |
} | |
function k() { | |
return "c" !== p.toLowerCase() && "s" !== p.toLowerCase() ? s : new w(2 * s.x - r.x, 2 * s.y - r.y) | |
} | |
void 0 === b && (b = !1); | |
"string" !== typeof a && u.Ld(a, "string", $c, "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 w(0, 0), r = new w(0, 0), s = new w(0, 0), t = l.length, v = u.p(), x = !1, A = !1, y = !0; !(m >= t - 1);) { | |
if (p = n, n = d(), "" !== n) { | |
switch (n.toUpperCase()) { | |
case "X": | |
y = !0; | |
A = x = !1; | |
break; | |
case "M": | |
var C = f(); | |
null === v.Tb || !0 === y ? (M(v, C.x, C.y, x, !1, !A), y = !1) : v.moveTo(C.x, C.y); | |
for (q = s; !c();) { | |
C = f(), v.lineTo(C.x, C.y) | |
} | |
break; | |
case "L": | |
for (; !c();) { | |
C = f(), v.lineTo(C.x, C.y) | |
} | |
break; | |
case "H": | |
for (; !c();) { | |
s = C = new w((n === n.toLowerCase() ? s.x : 0) + parseFloat(d()), s.y), v.lineTo(s.x, s.y) | |
} | |
break; | |
case "V": | |
for (; !c();) { | |
s = C = new w(s.x, (n === n.toLowerCase() ? s.y : 0) + parseFloat(d())), v.lineTo(s.x, s.y) | |
} | |
break; | |
case "C": | |
for (; !c();) { | |
var I = e(), | |
H = h(), | |
C = f(); | |
O(v, I.x, I.y, H.x, H.y, C.x, C.y) | |
} | |
break; | |
case "S": | |
for (; !c();) { | |
I = k(), H = h(), C = f(), O(v, I.x, I.y, H.x, H.y, C.x, C.y) | |
} | |
break; | |
case "Q": | |
for (; !c();) { | |
H = h(), C = f(), td(v, H.x, H.y, C.x, C.y) | |
} | |
break; | |
case "T": | |
for (; !c();) { | |
r = H = k(), C = f(), td(v, H.x, H.y, C.x, C.y) | |
} | |
break; | |
case "B": | |
for (; !c();) { | |
var C = parseFloat(d()), | |
I = parseFloat(d()), | |
H = parseFloat(d()), | |
R = parseFloat(d()), | |
aa = parseFloat(d()), | |
S = aa, | |
N = !1; | |
c() || (S = parseFloat(d()), c() || (N = 0 !== parseFloat(d()))); | |
n === n.toLowerCase() && (H += s.x, R += s.y); | |
v.arcTo(C, I, H, R, aa, S, N) | |
} | |
break; | |
case "A": | |
for (; !c();) { | |
I = Math.abs(parseFloat(d())), H = Math.abs(parseFloat(d())), R = parseFloat(d()), aa = !!parseFloat(d()), S = !!parseFloat(d()), C = f(), ud(v, I, H, R, aa, S, C.x, C.y) | |
} | |
break; | |
case "Z": | |
C = v.o.ub.n[v.o.ub.length - 1]; | |
P(v); | |
s = q; | |
break; | |
case "F": | |
C = ""; | |
for (I = 1; l[m + I];) { | |
if (null !== l[m + I].match(/[Uu]/)) { | |
I++ | |
} else { | |
if (null === l[m + I].match(/[A-Za-z]/)) { | |
I++ | |
} else { | |
C = l[m + I]; | |
break | |
} | |
} | |
} | |
C.match(/[Mm]/) ? x = !0 : vd(v); | |
break; | |
case "U": | |
C = ""; | |
for (I = 1; l[m + I];) { | |
if (null !== l[m + I].match(/[Ff]/)) { | |
I++ | |
} else { | |
if (null === l[m + I].match(/[A-Za-z]/)) { | |
I++ | |
} else { | |
C = l[m + I]; | |
break | |
} | |
} | |
} | |
C.match(/[Mm]/) ? A = !0 : v.ab(!1) | |
} | |
} | |
} | |
q = v.o; | |
u.q(v); | |
if (b) { | |
for (v = q.ub.i; v.next();) { | |
C = v.value, C.Os = !0 | |
} | |
} | |
return q | |
}; | |
function wd(a, b) { | |
for (var c = a.length, d = u.K(), e = 0; e < c; e++) { | |
var f = a[e]; | |
d.x = f[0]; | |
d.y = f[1]; | |
b.bb(d); | |
f[0] = d.x; | |
f[1] = d.y; | |
d.x = f[2]; | |
d.y = f[3]; | |
b.bb(d); | |
f[2] = d.x; | |
f[3] = d.y; | |
d.x = f[4]; | |
d.y = f[5]; | |
b.bb(d); | |
f[4] = d.x; | |
f[5] = d.y; | |
d.x = f[6]; | |
d.y = f[7]; | |
b.bb(d); | |
f[6] = d.x; | |
f[7] = d.y | |
} | |
u.v(d) | |
} | |
$c.prototype.wz = function() { | |
if (this.Ua || this.ku !== this.ub.T) { | |
return !0 | |
} | |
for (var a = this.ub.n, b = a.length, c = 0; c < b; c++) { | |
if (a[c].wz()) { | |
return !0 | |
} | |
} | |
return !1 | |
}; | |
$c.prototype.oA = function() { | |
this.Ua = !1; | |
this.ku = this.ub.T; | |
for (var a = this.ub.n, b = a.length, c = 0; c < b; c++) { | |
a[c].oA() | |
} | |
}; | |
$c.prototype.mg = function() { | |
var a = this.Vt; | |
a.Ma(); | |
isNaN(this.Fn) || isNaN(this.En) ? a.m(0, 0, 0, 0) : a.m(0, 0, this.Fn, this.En); | |
xd(this, a, !1); | |
kb(a, 0, 0, 0, 0); | |
a.freeze() | |
}; | |
$c.prototype.computeBoundsWithoutOrigin = $c.prototype.bG = function() { | |
var a = new z; | |
xd(this, a, !0); | |
return a | |
}; | |
function xd(a, b, c) { | |
switch (a.type) { | |
case dd: | |
case md: | |
case nd: | |
c ? b.m(a.nc, a.tc, 0, 0) : kb(b, a.nc, a.tc, 0, 0); | |
kb(b, a.pb, a.Bb, 0, 0); | |
break; | |
case ad: | |
var d = a.ub; | |
a = d.n; | |
for (var d = d.length, e = 0; e < d; e++) { | |
var f = a[e]; | |
c && 0 === e ? b.m(f.va, f.wa, 0, 0) : kb(b, f.va, f.wa, 0, 0); | |
for (var h = f.Ga.n, k = h.length, l = f.va, m = f.wa, n = 0; n < k; n++) { | |
var p = h[n]; | |
switch (p.type) { | |
case pd: | |
case yd: | |
l = p.F; | |
m = p.G; | |
kb(b, l, m, 0, 0); | |
break; | |
case zd: | |
K.qo(l, m, p.Rb, p.jc, p.ff, p.gf, p.F, p.G, 0.5, b); | |
l = p.F; | |
m = p.G; | |
break; | |
case Ad: | |
K.Oz(l, m, p.Rb, p.jc, p.F, p.G, 0.5, b); | |
l = p.F; | |
m = p.G; | |
break; | |
case Bd: | |
case Gd: | |
var q = p.type === Bd ? Hd(p, f) : Id(p, f, l, m), | |
r = q.length; | |
if (0 === r) { | |
l = p.ma; | |
m = p.ya; | |
kb(b, l, m, 0, 0); | |
break | |
} | |
for (var p = null, s = 0; s < r; s++) { | |
p = q[s], K.qo(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], 0.5, b) | |
} | |
null !== p && (l = p[6], m = p[7]); | |
break; | |
default: | |
u.k("Unknown Segment type: " + p.type) | |
} | |
} | |
} | |
break; | |
default: | |
u.k("Unknown Geometry type: " + a.type) | |
} | |
} | |
$c.prototype.normalize = $c.prototype.normalize = function() { | |
u.J(this); | |
var a = this.bG(); | |
this.offset(-a.x, -a.y); | |
return new w(-a.x, -a.y) | |
}; | |
$c.prototype.offset = $c.prototype.offset = function(a, b) { | |
u.J(this); | |
this.transform(1, 0, 0, 1, a, b); | |
return this | |
}; | |
$c.prototype.scale = $c.prototype.scale = function(a, b) { | |
u.J(this); | |
this.transform(a, 0, 0, b, 0, 0); | |
return this | |
}; | |
$c.prototype.rotate = $c.prototype.rotate = function(a, b, c) { | |
u.J(this); | |
void 0 === b && (b = 0); | |
void 0 === c && (c = 0); | |
var d = u.lh(); | |
d.reset(); | |
d.rotate(a, b, c); | |
this.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy); | |
u.Ze(d); | |
return this | |
}; | |
$c.prototype.transform = $c.prototype.transform = function(a, b, c, d, e, f) { | |
var h = 0, | |
k = 0; | |
switch (this.type) { | |
case dd: | |
case md: | |
case nd: | |
h = this.nc; | |
k = this.tc; | |
this.nc = h * a + k * c + e; | |
this.tc = h * b + k * d + f; | |
h = this.pb; | |
k = this.Bb; | |
this.pb = h * a + k * c + e; | |
this.Bb = h * b + k * d + f; | |
break; | |
case ad: | |
for (var l = this.ub.n, m = l.length, n = 0; n < m; n++) { | |
var p = l[n], | |
h = p.va, | |
k = p.wa; | |
p.va = h * a + k * c + e; | |
p.wa = h * b + k * d + f; | |
for (var p = p.Ga.n, q = p.length, r = 0; r < q; r++) { | |
var s = p[r]; | |
switch (s.type) { | |
case pd: | |
case yd: | |
h = s.F; | |
k = s.G; | |
s.F = h * a + k * c + e; | |
s.G = h * b + k * d + f; | |
break; | |
case zd: | |
h = s.Rb; | |
k = s.jc; | |
s.Rb = h * a + k * c + e; | |
s.jc = h * b + k * d + f; | |
h = s.ff; | |
k = s.gf; | |
s.ff = h * a + k * c + e; | |
s.gf = h * b + k * d + f; | |
h = s.F; | |
k = s.G; | |
s.F = h * a + k * c + e; | |
s.G = h * b + k * d + f; | |
break; | |
case Ad: | |
h = s.Rb; | |
k = s.jc; | |
s.Rb = h * a + k * c + e; | |
s.jc = h * b + k * d + f; | |
h = s.F; | |
k = s.G; | |
s.F = h * a + k * c + e; | |
s.G = h * b + k * d + f; | |
break; | |
case Bd: | |
h = s.ma; | |
k = s.ya; | |
s.ma = h * a + k * c + e; | |
s.ya = h * b + k * d + f; | |
0 !== b && (h = 180 * Math.atan2(b, a) / Math.PI, 0 > h && (h += 360), s.Ke += h); | |
0 > a && (s.Ke = 180 - s.Ke, s.Rf = -s.Rf); | |
0 > d && (s.Ke = -s.Ke, s.Rf = -s.Rf); | |
s.radiusX *= Math.sqrt(a * a + c * c); | |
void 0 !== s.radiusY && (s.radiusY *= Math.sqrt(b * b + d * d)); | |
break; | |
case Gd: | |
h = s.F; | |
k = s.G; | |
s.F = h * a + k * c + e; | |
s.G = h * b + k * d + f; | |
0 !== b && (h = 180 * Math.atan2(b, a) / Math.PI, 0 > h && (h += 360), s.Qi += h); | |
0 > a && (s.Qi = 180 - s.Qi, s.fl = !s.fl); | |
0 > d && (s.Qi = -s.Qi, s.fl = !s.fl); | |
s.radiusX *= Math.sqrt(a * a + c * c); | |
s.radiusY *= Math.sqrt(b * b + d * d); | |
break; | |
default: | |
u.k("Unknown Segment type: " + s.type) | |
} | |
} | |
} | |
} | |
this.Ua = !0; | |
return this | |
}; | |
$c.prototype.Zr = function(a, b) { | |
var c = this.nc, | |
d = this.tc, | |
e = this.pb, | |
f = this.Bb, | |
h = Math.min(c, e), | |
k = Math.min(d, f), | |
c = Math.abs(e - c), | |
d = Math.abs(f - d), | |
f = u.K(); | |
f.x = h; | |
f.y = k; | |
b.bb(f); | |
e = new bd(f.x, f.y); | |
f.x = h + c; | |
f.y = k; | |
b.bb(f); | |
e.Ga.add(new Jd(pd, f.x, f.y)); | |
f.x = h + c; | |
f.y = k + d; | |
b.bb(f); | |
e.Ga.add(new Jd(pd, f.x, f.y)); | |
f.x = h; | |
f.y = k + d; | |
b.bb(f); | |
e.Ga.add((new Jd(pd, f.x, f.y)).close()); | |
u.v(f); | |
a.type = ad; | |
a.ub.add(e); | |
return a | |
}; | |
$c.prototype.Da = function(a, b, c, d) { | |
var e = a.x, | |
f = a.y, | |
h = this.mb.x - 20; | |
a = a.y; | |
for (var k = 0, l = 0, m = 0, n = 0, p = 0, q = 0, r = this.ub.n, s = r.length, t = 0; t < s; t++) { | |
var v = r[t]; | |
if (v.Os) { | |
if (c && v.Da(e, f, b)) { | |
return !0 | |
} | |
for (var x = v.Ga, l = v.va, m = v.wa, A = l, y = m, C = x.n, I = 0; I <= x.length; I++) { | |
var H, R; | |
I !== x.length ? (H = C[I], R = H.type, p = H.F, q = H.G) : (R = pd, p = A, q = y); | |
switch (R) { | |
case yd: | |
n = Kd(e, f, h, a, l, m, A, y); | |
if (isNaN(n)) { | |
return !0 | |
} | |
k += n; | |
A = p; | |
y = q; | |
break; | |
case pd: | |
n = Kd(e, f, h, a, l, m, p, q); | |
if (isNaN(n)) { | |
return !0 | |
} | |
k += n; | |
break; | |
case zd: | |
n = K.ms(l, m, H.Rb, H.jc, H.ff, H.gf, p, q, h, a, e, f, 0.5); | |
k += n; | |
break; | |
case Ad: | |
n = K.ms(l, m, (l + 2 * H.Rb) / 3, (m + 2 * H.jc) / 3, (H.Rb + 2 * p) / 3, (H.Rb + 2 * p) / 3, p, q, h, a, e, f, 0.5); | |
k += n; | |
break; | |
case Bd: | |
case Gd: | |
R = H.type === Bd ? Hd(H, v) : Id(H, v, l, m); | |
var aa = R.length; | |
if (0 === aa) { | |
n = Kd(e, f, h, a, l, m, H.ma, H.ya); | |
if (isNaN(n)) { | |
return !0 | |
} | |
k += n; | |
break | |
} | |
for (var S = null, N = 0; N < aa; N++) { | |
S = R[N]; | |
if (0 === N) { | |
n = Kd(e, f, h, a, l, m, S[0], S[1]); | |
if (isNaN(n)) { | |
return !0 | |
} | |
k += n | |
} | |
n = K.ms(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], h, a, e, f, 0.5); | |
k += n | |
} | |
null !== S && (p = S[6], q = S[7]); | |
break; | |
default: | |
u.k("Unknown Segment type: " + H.type) | |
} | |
l = p; | |
m = q | |
} | |
if (0 !== k) { | |
return !0 | |
} | |
k = 0 | |
} else { | |
if (v.Da(e, f, d ? b : b + 2)) { | |
return !0 | |
} | |
} | |
} | |
return 0 !== k | |
}; | |
function Kd(a, b, c, d, e, f, h, k) { | |
if (K.sd(e, f, h, k, 0.05, a, b)) { | |
return NaN | |
} | |
var l = (a - c) * (f - k); | |
if (0 === l) { | |
return 0 | |
} | |
var m = ((a * d - b * c) * (e - h) - (a - c) * (e * k - f * h)) / l; | |
b = (a * d - b * c) * (f - k) / l; | |
if (m >= a) { | |
return 0 | |
} | |
if ((e > h ? e - h : h - e) < (f > k ? f - k : k - f)) { | |
if (e = a = 0, f < k ? (a = f, e = k) : (a = k, e = f), b < a || b > e) { | |
return 0 | |
} | |
} else { | |
if (e < h ? (a = e, e = h) : a = h, m < a || m > e) { | |
return 0 | |
} | |
} | |
return 0 < l ? 1 : -1 | |
} | |
function Ld(a, b, c, d) { | |
a = a.ub.n; | |
for (var e = a.length, f = 0; f < e; f++) { | |
if (a[f].Da(b, c, d)) { | |
return !0 | |
} | |
} | |
return !1 | |
} | |
$c.prototype.getPointAlongPath = function(a) { | |
(0 > a || 1 < a) && u.xa(a, "0 <= fraction <= 1", $c, "getPointAlongPath:fraction"); | |
var b = this.ub.first(), | |
c = u.hb(), | |
d = []; | |
d.push(b.va); | |
d.push(b.wa); | |
for (var e = b.va, f = b.wa, h = e, k = f, l = b.Ga.n, m = l.length, n = 0; n < m; n++) { | |
var p = l[n]; | |
switch (p.pa) { | |
case yd: | |
c.push(d); | |
d = []; | |
d.push(p.F); | |
d.push(p.G); | |
e = p.F; | |
f = p.G; | |
h = e; | |
k = f; | |
break; | |
case pd: | |
d.push(p.F); | |
d.push(p.G); | |
e = p.F; | |
f = p.G; | |
break; | |
case zd: | |
K.Ae(e, f, p.dd, p.ze, p.fg, p.gg, p.pb, p.Bb, 0.5, d); | |
e = p.F; | |
f = p.G; | |
break; | |
case Ad: | |
K.Zo(e, f, p.dd, p.ze, p.pb, p.Bb, 0.5, d); | |
e = p.F; | |
f = p.G; | |
break; | |
case Bd: | |
var q = Hd(p, b), | |
r = q.length; | |
if (0 === r) { | |
d.push(p.ma); | |
d.push(p.ya); | |
e = p.ma; | |
f = p.ya; | |
break | |
} | |
for (var s = 0; s < r; s++) { | |
var t = q[s]; | |
K.Ae(e, f, t[2], t[3], t[4], t[5], t[6], t[7], 0.5, d); | |
e = t[6]; | |
f = t[7] | |
} | |
break; | |
case Gd: | |
q = Id(p, b, e, f); | |
r = q.length; | |
for (s = 0; s < r; s++) { | |
t = q[s], K.Ae(e, f, t[2], t[3], t[4], t[5], t[6], t[7], 0.5, d), e = t[6], f = t[7] | |
} | |
break; | |
default: | |
u.k("Segment not of valid type") | |
} | |
p.Bh && (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], f = l[n + 1], 0 !== n && (p = Math.sqrt(Ya(b, d, e, f)), q += p), b = e, d = f | |
} | |
} | |
a *= q; | |
for (k = q = 0; k < h; k++) { | |
for (l = c[k], m = l.length, n = 0; n < m; n++) { | |
e = l[n]; | |
f = l[n + 1]; | |
if (0 !== n) { | |
p = Math.sqrt(Ya(b, d, e, f)); | |
if (q + p > a) { | |
return n = (a - q) / p, u.sa(c), new w(b + (e - b) * n, d + (f - d) * n) | |
} | |
q += p | |
} | |
b = e; | |
d = f | |
} | |
} | |
u.sa(c); | |
return null | |
}; | |
u.defineProperty($c, { | |
type: "type" | |
}, function() { | |
return this.pa | |
}, function(a) { | |
this.pa !== a && (u.J(this, a), this.pa = a, this.Ua = !0) | |
}); | |
u.defineProperty($c, { | |
va: "startX" | |
}, function() { | |
return this.nc | |
}, function(a) { | |
this.nc !== a && (u.J(this, a), this.nc = a, this.Ua = !0) | |
}); | |
u.defineProperty($c, { | |
wa: "startY" | |
}, function() { | |
return this.tc | |
}, function(a) { | |
this.tc !== a && (u.J(this, a), this.tc = a, this.Ua = !0) | |
}); | |
u.defineProperty($c, { | |
F: "endX" | |
}, function() { | |
return this.pb | |
}, function(a) { | |
this.pb !== a && (u.J(this, a), this.pb = a, this.Ua = !0) | |
}); | |
u.defineProperty($c, { | |
G: "endY" | |
}, function() { | |
return this.Bb | |
}, function(a) { | |
this.Bb !== a && (u.J(this, a), this.Bb = a, this.Ua = !0) | |
}); | |
u.defineProperty($c, { | |
ub: "figures" | |
}, function() { | |
return this.Zi | |
}, function(a) { | |
this.Zi !== a && (u.J(this, a), this.Zi = a, this.Ua = !0) | |
}); | |
$c.prototype.add = $c.prototype.add = function(a) { | |
this.Zi.add(a); | |
return this | |
}; | |
u.defineProperty($c, { | |
A: "spot1" | |
}, function() { | |
return this.si | |
}, function(a) { | |
u.J(this, a); | |
this.si = a.Z() | |
}); | |
u.defineProperty($c, { | |
B: "spot2" | |
}, function() { | |
return this.ti | |
}, function(a) { | |
u.J(this, a); | |
this.ti = a.Z() | |
}); | |
u.defineProperty($c, { | |
Dd: "defaultStretch" | |
}, function() { | |
return this.ci | |
}, function(a) { | |
u.J(this, a); | |
this.ci = a | |
}); | |
u.u($c, { | |
mb: "bounds" | |
}, function() { | |
this.wz() && (this.oA(), this.mg()); | |
return this.Vt | |
}); | |
function bd(a, b, c, d) { | |
u.gc(this); | |
this.Ea = !1; | |
void 0 === c && (c = !0); | |
this.Ml = c; | |
void 0 === d && (d = !0); | |
this.Gn = d; | |
this.nc = void 0 !== a ? a : 0; | |
this.tc = void 0 !== b ? b : 0; | |
this.$n = new E(Jd); | |
this.ev = this.$n.T; | |
this.Ua = !0 | |
} | |
u.fa("PathFigure", bd); | |
u.Nh(bd); | |
bd.prototype.copy = function() { | |
var a = new bd; | |
a.Ml = this.Ml; | |
a.Gn = this.Gn; | |
a.nc = this.nc; | |
a.tc = this.tc; | |
for (var b = this.$n.n, c = b.length, d = a.$n, e = 0; e < c; e++) { | |
var f = b[e].copy(); | |
d.add(f) | |
} | |
a.ev = this.ev; | |
a.Ua = this.Ua; | |
return a | |
}; | |
bd.prototype.equalsApprox = bd.prototype.pd = function(a) { | |
if (!(a instanceof bd && K.D(this.va, a.va) && K.D(this.wa, a.wa))) { | |
return !1 | |
} | |
var b = this.Ga.n; | |
a = a.Ga.n; | |
var c = b.length; | |
if (c !== a.length) { | |
return !1 | |
} | |
for (var d = 0; d < c; d++) { | |
if (!b[d].pd(a[d])) { | |
return !1 | |
} | |
} | |
return !0 | |
}; | |
g = bd.prototype; | |
g.toString = function(a) { | |
void 0 === a && (a = -1); | |
for (var b = 0 > a ? "M" + this.va.toString() + " " + this.wa.toString() : "M" + this.va.toFixed(a) + " " + this.wa.toFixed(a), c = this.Ga.n, d = c.length, e = 0; e < d; e++) { | |
b += " " + c[e].toString(a) | |
} | |
return b | |
}; | |
g.freeze = function() { | |
this.Ea = !0; | |
var a = this.Ga; | |
a.freeze(); | |
for (var b = a.n, a = a.length, c = 0; c < a; c++) { | |
b[c].freeze() | |
} | |
return this | |
}; | |
g.Ma = function() { | |
this.Ea = !1; | |
var a = this.Ga; | |
a.Ma(); | |
for (var a = a.n, b = a.length, c = 0; c < b; c++) { | |
a[c].Ma() | |
} | |
return this | |
}; | |
g.wz = function() { | |
if (this.Ua) { | |
return !0 | |
} | |
var a = this.Ga; | |
if (this.ev !== a.T) { | |
return !0 | |
} | |
for (var a = a.n, b = a.length, c = 0; c < b; c++) { | |
if (a[c].Ua) { | |
return !0 | |
} | |
} | |
return !1 | |
}; | |
g.oA = function() { | |
this.Ua = !1; | |
var a = this.Ga; | |
this.ev = a.T; | |
for (var a = a.n, b = a.length, c = 0; c < b; c++) { | |
var d = a[c]; | |
d.Ua = !1; | |
d.Wf = null | |
} | |
}; | |
u.defineProperty(bd, { | |
Os: "isFilled" | |
}, function() { | |
return this.Ml | |
}, function(a) { | |
u.J(this, a); | |
this.Ml = a | |
}); | |
u.defineProperty(bd, { | |
il: "isShadowed" | |
}, function() { | |
return this.Gn | |
}, function(a) { | |
u.J(this, a); | |
this.Gn = a | |
}); | |
u.defineProperty(bd, { | |
va: "startX" | |
}, function() { | |
return this.nc | |
}, function(a) { | |
u.J(this, a); | |
this.nc = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(bd, { | |
wa: "startY" | |
}, function() { | |
return this.tc | |
}, function(a) { | |
u.J(this, a); | |
this.tc = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(bd, { | |
Ga: "segments" | |
}, function() { | |
return this.$n | |
}, function(a) { | |
u.J(this, a); | |
this.$n = a; | |
this.Ua = !0 | |
}); | |
bd.prototype.add = bd.prototype.add = function(a) { | |
this.$n.add(a); | |
return this | |
}; | |
bd.prototype.Da = function(a, b, c) { | |
for (var d = this.va, e = this.wa, f = d, h = e, k = this.Ga.n, l = k.length, m = 0; m < l; m++) { | |
var n = k[m]; | |
switch (n.type) { | |
case yd: | |
f = n.F; | |
h = n.G; | |
d = n.F; | |
e = n.G; | |
break; | |
case pd: | |
if (K.sd(d, e, n.F, n.G, c, a, b)) { | |
return !0 | |
} | |
d = n.F; | |
e = n.G; | |
break; | |
case zd: | |
if (K.Jv(d, e, n.Rb, n.jc, n.ff, n.gf, n.F, n.G, 0.5, a, b, c)) { | |
return !0 | |
} | |
d = n.F; | |
e = n.G; | |
break; | |
case Ad: | |
if (K.Pz(d, e, n.Rb, n.jc, n.F, n.G, 0.5, a, b, c)) { | |
return !0 | |
} | |
d = n.F; | |
e = n.G; | |
break; | |
case Bd: | |
case Gd: | |
var p = n.type === Bd ? Hd(n, this) : Id(n, this, d, e), | |
q = p.length; | |
if (0 === q) { | |
if (K.sd(d, e, n.ma, n.ya, c, a, b)) { | |
return !0 | |
} | |
d = n.ma; | |
e = n.ya; | |
break | |
} | |
for (var r = null, s = 0; s < q; s++) { | |
if (r = p[s], 0 === s && K.sd(d, e, r[0], r[1], c, a, b) || K.Jv(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], 0.5, a, b, c)) { | |
return !0 | |
} | |
} | |
null !== r && (d = r[6], e = r[7]); | |
break; | |
default: | |
u.k("Unknown Segment type: " + n.type) | |
} | |
if (n.fw && (d !== f || e !== h) && K.sd(d, e, f, h, c, a, b)) { | |
return !0 | |
} | |
} | |
return !1 | |
}; | |
function Jd(a, b, c, d, e, f, h, k) { | |
u.gc(this); | |
this.Ea = !1; | |
void 0 === a && (a = pd); | |
this.pa = a; | |
this.pb = void 0 !== b ? b : 0; | |
this.Bb = void 0 !== c ? c : 0; | |
a === Gd ? (void 0 !== f && (a = f % 360, 0 > a && (a += 360), this.dd = a), void 0 !== d && (this.fg = Math.max(d, 0)), void 0 !== e && (this.gg = Math.max(e, 0)), this.Nn = !!h, this.dn = !!k) : (void 0 !== d && (this.dd = d), void 0 !== e && (this.ze = e), void 0 !== f && (a === Bd && (f = Math.max(f, 0)), this.fg = f), void 0 !== h && "number" === typeof h && (a === Bd && (h = Math.max(h, 0)), this.gg = h)); | |
this.Bh = !1; | |
this.Ua = !0; | |
this.Wf = null | |
} | |
u.fa("PathSegment", Jd); | |
u.Nh(Jd); | |
Jd.prototype.copy = function() { | |
var a = new Jd; | |
a.pa = this.pa; | |
a.pb = this.pb; | |
a.Bb = this.Bb; | |
void 0 !== this.dd && (a.dd = this.dd); | |
void 0 !== this.ze && (a.ze = this.ze); | |
void 0 !== this.fg && (a.fg = this.fg); | |
void 0 !== this.gg && (a.gg = this.gg); | |
void 0 !== this.Nn && (a.Nn = this.Nn); | |
void 0 !== this.dn && (a.dn = this.dn); | |
a.Bh = this.Bh; | |
a.Ua = this.Ua; | |
return a | |
}; | |
Jd.prototype.equalsApprox = Jd.prototype.pd = function(a) { | |
if (!(a instanceof Jd) || this.type !== a.type || this.fw !== a.fw) { | |
return !1 | |
} | |
switch (this.type) { | |
case yd: | |
case pd: | |
return K.D(this.F, a.F) && K.D(this.G, a.G); | |
case zd: | |
return K.D(this.F, a.F) && K.D(this.G, a.G) && K.D(this.Rb, a.Rb) && K.D(this.jc, a.jc) && K.D(this.ff, a.ff) && K.D(this.gf, a.gf); | |
case Ad: | |
return K.D(this.F, a.F) && K.D(this.G, a.G) && K.D(this.Rb, a.Rb) && K.D(this.jc, a.jc); | |
case Bd: | |
return K.D(this.Ke, a.Ke) && K.D(this.Rf, a.Rf) && K.D(this.ma, a.ma) && K.D(this.ya, a.ya) && K.D(this.radiusX, a.radiusX) && K.D(this.radiusY, a.radiusY); | |
case Gd: | |
return this.fl === a.fl && this.iw === a.iw && K.D(this.Qi, a.Qi) && K.D(this.F, a.F) && K.D(this.G, a.G) && K.D(this.radiusX, a.radiusX) && K.D(this.radiusY, a.radiusY); | |
default: | |
return !1 | |
} | |
}; | |
Jd.prototype.toString = function(a) { | |
void 0 === a && (a = -1); | |
var b = ""; | |
switch (this.type) { | |
case yd: | |
b = 0 > a ? "M" + this.F.toString() + " " + this.G.toString() : "M" + this.F.toFixed(a) + " " + this.G.toFixed(a); | |
break; | |
case pd: | |
b = 0 > a ? "L" + this.F.toString() + " " + this.G.toString() : "L" + this.F.toFixed(a) + " " + this.G.toFixed(a); | |
break; | |
case zd: | |
b = 0 > a ? "C" + this.Rb.toString() + " " + this.jc.toString() + " " + this.ff.toString() + " " + this.gf.toString() + " " + this.F.toString() + " " + this.G.toString() : "C" + this.Rb.toFixed(a) + " " + this.jc.toFixed(a) + " " + this.ff.toFixed(a) + " " + this.gf.toFixed(a) + " " + this.F.toFixed(a) + " " + this.G.toFixed(a); | |
break; | |
case Ad: | |
b = 0 > a ? "Q" + this.Rb.toString() + " " + this.jc.toString() + " " + this.F.toString() + " " + this.G.toString() : "Q" + this.Rb.toFixed(a) + " " + this.jc.toFixed(a) + " " + this.F.toFixed(a) + " " + this.G.toFixed(a); | |
break; | |
case Bd: | |
b = 0 > a ? "B" + this.Ke.toString() + " " + this.Rf.toString() + " " + this.ma.toString() + " " + this.ya.toString() + " " + this.radiusX : "B" + this.Ke.toFixed(a) + " " + this.Rf.toFixed(a) + " " + this.ma.toFixed(a) + " " + this.ya.toFixed(a) + " " + this.radiusX; | |
break; | |
case Gd: | |
b = 0 > a ? "A" + this.radiusX.toString() + " " + this.radiusY.toString() + " " + this.Qi.toString() + " " + (this.iw ? 1 : 0) + " " + (this.fl ? 1 : 0) + " " + this.F.toString() + " " + this.G.toString() : "A" + this.radiusX.toFixed(a) + " " + this.radiusY.toFixed(a) + " " + this.Qi.toFixed(a) + " " + (this.iw ? 1 : 0) + " " + (this.fl ? 1 : 0) + " " + this.F.toFixed(a) + " " + this.G.toFixed(a); | |
break; | |
default: | |
b = this.type.toString() | |
} | |
return b + (this.Bh ? "z" : "") | |
}; | |
var yd; | |
Jd.Move = yd = u.s(Jd, "Move", 0); | |
var pd; | |
Jd.Line = pd = u.s(Jd, "Line", 1); | |
var zd; | |
Jd.Bezier = zd = u.s(Jd, "Bezier", 2); | |
var Ad; | |
Jd.QuadraticBezier = Ad = u.s(Jd, "QuadraticBezier", 3); | |
var Bd; | |
Jd.Arc = Bd = u.s(Jd, "Arc", 4); | |
var Gd; | |
Jd.SvgArc = Gd = u.s(Jd, "SvgArc", 4); | |
Jd.prototype.freeze = function() { | |
this.Ea = !0; | |
return this | |
}; | |
Jd.prototype.Ma = function() { | |
this.Ea = !1; | |
return this | |
}; | |
Jd.prototype.close = Jd.prototype.close = function() { | |
this.Bh = !0; | |
return this | |
}; | |
function Hd(a, b) { | |
if (null !== a.Wf && !1 === b.Ua) { | |
return a.Wf | |
} | |
var c = a.radiusX, | |
d = a.radiusY; | |
void 0 === d && (d = c); | |
if (0 === c || 0 === d) { | |
return a.Wf = [], a.Wf | |
} | |
var e = a.dd, | |
f = a.ze, | |
h = K.gD(0, 0, c < d ? c : d, a.Ke, a.Ke + a.Rf, !1); | |
if (c !== d) { | |
var k = u.lh(); | |
k.reset(); | |
c < d ? k.scale(1, d / c) : k.scale(c / d, 1); | |
wd(h, k); | |
u.Ze(k) | |
} | |
c = h.length; | |
for (d = 0; d < c; d++) { | |
k = h[d], k[0] += e, k[1] += f, k[2] += e, k[3] += f, k[4] += e, k[5] += f, k[6] += e, k[7] += f | |
} | |
a.Wf = h; | |
return a.Wf | |
} | |
function Id(a, b, c, d) { | |
function e(a, b, c, d) { | |
return (a * d < b * c ? -1 : 1) * Math.acos(f(a, b, c, d)) | |
} | |
function f(a, b, c, d) { | |
return (a * c + b * d) / (Math.sqrt(a * a + b * b) * Math.sqrt(c * c + d * d)) | |
} | |
if (null !== a.Wf && !1 === b.Ua) { | |
return a.Wf | |
} | |
b = a.fg; | |
var h = a.gg; | |
if (0 === b || 0 === h) { | |
return a.Wf = [], a.Wf | |
} | |
var k = Math.PI / 180 * a.dd, | |
l = a.Nn, | |
m = a.dn, | |
n = a.pb, | |
p = a.Bb, | |
q = Math.cos(k), | |
r = Math.sin(k), | |
s = q * (c - n) / 2 + r * (d - p) / 2, | |
k = -r * (c - n) / 2 + q * (d - p) / 2, | |
t = s * s / (b * b) + k * k / (h * h); | |
1 < t && (b *= Math.sqrt(t), h *= Math.sqrt(t)); | |
t = (l === m ? -1 : 1) * Math.sqrt((b * b * h * h - b * b * k * k - h * h * s * s) / (b * b * k * k + h * h * s * s)); | |
isNaN(t) && (t = 0); | |
l = t * b * k / h; | |
t = t * -h * s / b; | |
isNaN(l) && (l = 0); | |
isNaN(t) && (t = 0); | |
c = (c + n) / 2 + q * l - r * t; | |
d = (d + p) / 2 + r * l + q * t; | |
p = e(1, 0, (s - l) / b, (k - t) / h); | |
q = (s - l) / b; | |
n = (k - t) / h; | |
s = (-s - l) / b; | |
l = (-k - t) / h; | |
k = e(q, n, s, l); | |
s = f(q, n, s, l); - 1 >= s ? k = Math.PI : 1 <= s && (k = 0); | |
!m && 0 < k && (k -= 2 * Math.PI); | |
m && 0 > k && (k += 2 * Math.PI); | |
m = b > h ? 1 : b / h; | |
s = b > h ? h / b : 1; | |
b = K.gD(0, 0, b > h ? b : h, p, p + k, !0); | |
h = u.lh(); | |
h.reset(); | |
h.translate(c, d); | |
h.rotate(a.dd, 0, 0); | |
h.scale(m, s); | |
wd(b, h); | |
u.Ze(h); | |
a.Wf = b; | |
return a.Wf | |
} | |
u.defineProperty(Jd, { | |
fw: "isClosed" | |
}, function() { | |
return this.Bh | |
}, function(a) { | |
this.Bh !== a && (this.Bh = a, this.Ua = !0) | |
}); | |
u.defineProperty(Jd, { | |
type: "type" | |
}, function() { | |
return this.pa | |
}, function(a) { | |
u.J(this, a); | |
this.pa = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
F: "endX" | |
}, function() { | |
return this.pb | |
}, function(a) { | |
u.J(this, a); | |
this.pb = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
G: "endY" | |
}, function() { | |
return this.Bb | |
}, function(a) { | |
u.J(this, a); | |
this.Bb = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
Rb: "point1X" | |
}, function() { | |
return this.dd | |
}, function(a) { | |
u.J(this, a); | |
this.dd = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
jc: "point1Y" | |
}, function() { | |
return this.ze | |
}, function(a) { | |
u.J(this, a); | |
this.ze = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
ff: "point2X" | |
}, function() { | |
return this.fg | |
}, function(a) { | |
u.J(this, a); | |
this.fg = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
gf: "point2Y" | |
}, function() { | |
return this.gg | |
}, function(a) { | |
u.J(this, a); | |
this.gg = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
ma: "centerX" | |
}, function() { | |
return this.dd | |
}, function(a) { | |
u.J(this, a); | |
this.dd = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
ya: "centerY" | |
}, function() { | |
return this.ze | |
}, function(a) { | |
u.J(this, a); | |
this.ze = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
radiusX: "radiusX" | |
}, function() { | |
return this.fg | |
}, function(a) { | |
0 > a && u.xa(a, ">= zero", Jd, "radiusX"); | |
u.J(this, a); | |
this.fg = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
radiusY: "radiusY" | |
}, function() { | |
return this.gg | |
}, function(a) { | |
0 > a && u.xa(a, ">= zero", Jd, "radiusY"); | |
u.J(this, a); | |
this.gg = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
Ke: "startAngle" | |
}, function() { | |
return this.pb | |
}, function(a) { | |
this.pb !== a && (u.J(this, a), a %= 360, 0 > a && (a += 360), this.pb = a, this.Ua = !0) | |
}); | |
u.defineProperty(Jd, { | |
Rf: "sweepAngle" | |
}, function() { | |
return this.Bb | |
}, function(a) { | |
u.J(this, a); | |
360 < a && (a = 360); - 360 > a && (a = -360); | |
this.Bb = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
fl: "isClockwiseArc" | |
}, function() { | |
return this.dn | |
}, function(a) { | |
u.J(this, a); | |
this.dn = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
iw: "isLargeArc" | |
}, function() { | |
return this.Nn | |
}, function(a) { | |
u.J(this, a); | |
this.Nn = a; | |
this.Ua = !0 | |
}); | |
u.defineProperty(Jd, { | |
Qi: "xAxisRotation" | |
}, function() { | |
return this.dd | |
}, function(a) { | |
a %= 360; | |
0 > a && (a += 360); | |
u.J(this, a); | |
this.dd = a; | |
this.Ua = !0 | |
}); | |
function Md() { | |
this.Y = null; | |
this.Jy = (new w(0, 0)).freeze(); | |
this.Ex = (new w(0, 0)).freeze(); | |
this.St = this.Ou = 0; | |
this.Bu = ""; | |
this.sv = this.hu = !1; | |
this.du = this.Ut = 0; | |
this.Si = this.ou = this.xu = !1; | |
this.Xp = null; | |
this.rv = 0; | |
this.hg = this.pv = null | |
} | |
u.fa("InputEvent", Md); | |
Md.prototype.copy = function() { | |
var a = new Md; | |
a.Y = this.Y; | |
a.Jy.assign(this.hf); | |
a.Ex.assign(this.da); | |
a.Ou = this.Ou; | |
a.St = this.St; | |
a.Bu = this.Bu; | |
a.hu = this.hu; | |
a.sv = this.sv; | |
a.Ut = this.Ut; | |
a.du = this.du; | |
a.xu = this.xu; | |
a.ou = this.ou; | |
a.Si = this.Si; | |
a.Xp = this.Xp; | |
a.rv = this.rv; | |
a.pv = this.pv; | |
a.hg = this.hg; | |
return a | |
}; | |
Md.prototype.toString = function() { | |
var a = "^"; | |
0 !== this.jd && (a += "M:" + this.jd); | |
0 !== this.button && (a += "B:" + this.button); | |
"" !== this.key && (a += "K:" + this.key); | |
0 !== this.Ue && (a += "C:" + this.Ue); | |
0 !== this.Uk && (a += "D:" + this.Uk); | |
this.Tc && (a += "h"); | |
this.bubbles && (a += "b"); | |
null !== this.da && (a += "@" + this.da.toString()); | |
return a | |
}; | |
u.defineProperty(Md, { | |
g: "diagram" | |
}, function() { | |
return this.Y | |
}, function(a) { | |
this.Y = a | |
}); | |
u.defineProperty(Md, { | |
hf: "viewPoint" | |
}, function() { | |
return this.Jy | |
}, function(a) { | |
u.C(a, w, Md, "viewPoint"); | |
this.Jy.assign(a) | |
}); | |
u.defineProperty(Md, { | |
da: "documentPoint" | |
}, function() { | |
return this.Ex | |
}, function(a) { | |
u.C(a, w, Md, "documentPoint"); | |
this.Ex.assign(a) | |
}); | |
u.defineProperty(Md, { | |
jd: "modifiers" | |
}, function() { | |
return this.Ou | |
}, function(a) { | |
this.Ou = a | |
}); | |
u.defineProperty(Md, { | |
button: "button" | |
}, function() { | |
return this.St | |
}, function(a) { | |
this.St = a | |
}); | |
u.defineProperty(Md, { | |
key: "key" | |
}, function() { | |
return this.Bu | |
}, function(a) { | |
this.Bu = a | |
}); | |
u.defineProperty(Md, { | |
Wk: "down" | |
}, function() { | |
return this.hu | |
}, function(a) { | |
this.hu = a | |
}); | |
u.defineProperty(Md, { | |
up: "up" | |
}, function() { | |
return this.sv | |
}, function(a) { | |
this.sv = a | |
}); | |
u.defineProperty(Md, { | |
Ue: "clickCount" | |
}, function() { | |
return this.Ut | |
}, function(a) { | |
this.Ut = a | |
}); | |
u.defineProperty(Md, { | |
Uk: "delta" | |
}, function() { | |
return this.du | |
}, function(a) { | |
this.du = a | |
}); | |
u.defineProperty(Md, { | |
Qs: "isMultiTouch" | |
}, function() { | |
return this.xu | |
}, function(a) { | |
this.xu = a | |
}); | |
u.defineProperty(Md, { | |
Tc: "handled" | |
}, function() { | |
return this.ou | |
}, function(a) { | |
this.ou = a | |
}); | |
u.defineProperty(Md, { | |
bubbles: "bubbles" | |
}, function() { | |
return this.Si | |
}, function(a) { | |
this.Si = a | |
}); | |
u.defineProperty(Md, { | |
event: "event" | |
}, function() { | |
return this.Xp | |
}, function(a) { | |
this.Xp = a | |
}); | |
u.u(Md, { | |
kl: "isTouchEvent" | |
}, function() { | |
var a = window.TouchEvent; | |
return a && this.event instanceof a ? !0 : (a = window.PointerEvent) && this.event instanceof a && "touch" === this.event.pointerType | |
}); | |
u.defineProperty(Md, { | |
timestamp: "timestamp" | |
}, function() { | |
return this.rv | |
}, function(a) { | |
this.rv = a | |
}); | |
u.defineProperty(Md, { | |
Eg: "targetDiagram" | |
}, function() { | |
return this.pv | |
}, function(a) { | |
this.pv = a | |
}); | |
u.defineProperty(Md, { | |
qe: "targetObject" | |
}, function() { | |
return this.hg | |
}, function(a) { | |
this.hg = a | |
}); | |
u.defineProperty(Md, { | |
control: "control" | |
}, function() { | |
return 0 !== (this.jd & 1) | |
}, function(a) { | |
this.jd = a ? this.jd | 1 : this.jd & -2 | |
}); | |
u.defineProperty(Md, { | |
shift: "shift" | |
}, function() { | |
return 0 !== (this.jd & 4) | |
}, function(a) { | |
this.jd = a ? this.jd | 4 : this.jd & -5 | |
}); | |
u.defineProperty(Md, { | |
alt: "alt" | |
}, function() { | |
return 0 !== (this.jd & 2) | |
}, function(a) { | |
this.jd = a ? this.jd | 2 : this.jd & -3 | |
}); | |
u.defineProperty(Md, { | |
Zs: "meta" | |
}, function() { | |
return 0 !== (this.jd & 8) | |
}, function(a) { | |
this.jd = a ? this.jd | 8 : this.jd & -9 | |
}); | |
u.defineProperty(Md, { | |
left: "left" | |
}, function() { | |
return 0 === this.button | |
}, function(a) { | |
this.button = a ? 0 : 2 | |
}); | |
u.defineProperty(Md, { | |
aK: "middle" | |
}, function() { | |
return 1 === this.button | |
}, function(a) { | |
this.button = a ? 1 : 0 | |
}); | |
u.defineProperty(Md, { | |
right: "right" | |
}, function() { | |
return 2 === this.button | |
}, function(a) { | |
this.button = a ? 2 : 0 | |
}); | |
function Nd() { | |
this.Y = null; | |
this.Vb = ""; | |
this.Xu = this.kv = null; | |
this.Tt = !1 | |
} | |
u.fa("DiagramEvent", Nd); | |
Nd.prototype.copy = function() { | |
var a = new Nd; | |
a.Y = this.Y; | |
a.Vb = this.Vb; | |
a.kv = this.kv; | |
a.Xu = this.Xu; | |
a.Tt = this.Tt; | |
return a | |
}; | |
Nd.prototype.toString = function() { | |
var a = "*" + this.name; | |
this.cancel && (a += "x"); | |
null !== this.iA && (a += ":" + this.iA.toString()); | |
null !== this.Nz && (a += "(" + this.Nz.toString() + ")"); | |
return a | |
}; | |
u.defineProperty(Nd, { | |
g: "diagram" | |
}, function() { | |
return this.Y | |
}, function(a) { | |
this.Y = a | |
}); | |
u.defineProperty(Nd, { | |
name: "name" | |
}, function() { | |
return this.Vb | |
}, function(a) { | |
this.Vb = a | |
}); | |
u.defineProperty(Nd, { | |
iA: "subject" | |
}, function() { | |
return this.kv | |
}, function(a) { | |
this.kv = a | |
}); | |
u.defineProperty(Nd, { | |
Nz: "parameter" | |
}, function() { | |
return this.Xu | |
}, function(a) { | |
this.Xu = a | |
}); | |
u.defineProperty(Nd, { | |
cancel: "cancel" | |
}, function() { | |
return this.Tt | |
}, function(a) { | |
this.Tt = a | |
}); | |
function Od() { | |
this.Dp = $d; | |
this.am = this.Nu = ""; | |
this.Yq = this.Zq = this.cr = this.dr = this.br = this.Y = this.Pd = null | |
} | |
u.fa("ChangedEvent", Od); | |
var ae; | |
Od.Transaction = ae = u.s(Od, "Transaction", -1); | |
var $d; | |
Od.Property = $d = u.s(Od, "Property", 0); | |
var be; | |
Od.Insert = be = u.s(Od, "Insert", 1); | |
var ce; | |
Od.Remove = ce = u.s(Od, "Remove", 2); | |
Od.prototype.clear = Od.prototype.clear = function() { | |
this.Yq = this.Zq = this.cr = this.dr = this.br = this.Y = this.Pd = null | |
}; | |
Od.prototype.copy = function() { | |
var a = new Od; | |
a.Pd = this.Pd; | |
a.Y = this.Y; | |
a.Dp = this.Dp; | |
a.Nu = this.Nu; | |
a.am = this.am; | |
a.br = this.br; | |
var b = this.dr; | |
a.dr = u.Ta(b) && "function" === typeof b.Z ? b.Z() : b; | |
b = this.cr; | |
a.cr = u.Ta(b) && "function" === typeof b.Z ? b.Z() : b; | |
b = this.Zq; | |
a.Zq = u.Ta(b) && "function" === typeof b.Z ? b.Z() : b; | |
b = this.Yq; | |
a.Yq = u.Ta(b) && "function" === typeof b.Z ? b.Z() : b; | |
return a | |
}; | |
Od.prototype.toString = function() { | |
var a = "", | |
a = this.Cd === ae ? a + "* " : this.Cd === $d ? a + (null !== this.ha ? "!m" : "!d") : a + ((null !== this.ha ? "!m" : "!d") + this.Cd); | |
this.propertyName && "string" === typeof this.propertyName && (a += " " + this.propertyName); | |
this.Mf && this.Mf !== this.propertyName && (a += " " + this.Mf); | |
a += ": "; | |
this.Cd === ae ? null !== this.oldValue && (a += " " + this.oldValue) : (null !== this.object && (a += de(this.object)), null !== this.oldValue && (a += " old: " + de(this.oldValue)), null !== this.Bg && (a += " " + this.Bg), null !== this.newValue && (a += " new: " + de(this.newValue)), null !== this.zg && (a += " " + this.zg)); | |
return a | |
}; | |
Od.prototype.getValue = Od.prototype.ua = function(a) { | |
return a ? this.oldValue : this.newValue | |
}; | |
Od.prototype.getParam = function(a) { | |
return a ? this.Bg : this.zg | |
}; | |
Od.prototype.canUndo = Od.prototype.canUndo = function() { | |
return null !== this.ha || null !== this.g ? !0 : !1 | |
}; | |
Od.prototype.undo = Od.prototype.undo = function() { | |
this.canUndo() && (null !== this.ha ? this.ha.tm(this, !0) : null !== this.g && this.g.tm(this, !0)) | |
}; | |
Od.prototype.canRedo = Od.prototype.canRedo = function() { | |
return null !== this.ha || null !== this.g ? !0 : !1 | |
}; | |
Od.prototype.redo = Od.prototype.redo = function() { | |
this.canRedo() && (null !== this.ha ? this.ha.tm(this, !1) : null !== this.g && this.g.tm(this, !1)) | |
}; | |
u.defineProperty(Od, { | |
ha: "model" | |
}, function() { | |
return this.Pd | |
}, function(a) { | |
this.Pd = a | |
}); | |
u.defineProperty(Od, { | |
g: "diagram" | |
}, function() { | |
return this.Y | |
}, function(a) { | |
this.Y = a | |
}); | |
u.defineProperty(Od, { | |
Cd: "change" | |
}, function() { | |
return this.Dp | |
}, function(a) { | |
this.Dp = a | |
}); | |
u.defineProperty(Od, { | |
Mf: "modelChange" | |
}, function() { | |
return this.Nu | |
}, function(a) { | |
this.Nu = a | |
}); | |
u.defineProperty(Od, { | |
propertyName: "propertyName" | |
}, function() { | |
return this.am | |
}, function(a) { | |
this.am = a | |
}); | |
u.u(Od, { | |
iH: "isTransactionFinished" | |
}, function() { | |
return this.Dp === ae && ("CommittedTransaction" === this.am || "FinishedUndo" === this.am || "FinishedRedo" === this.am) | |
}); | |
u.defineProperty(Od, { | |
object: "object" | |
}, function() { | |
return this.br | |
}, function(a) { | |
this.br = a | |
}); | |
u.defineProperty(Od, { | |
oldValue: "oldValue" | |
}, function() { | |
return this.dr | |
}, function(a) { | |
this.dr = a | |
}); | |
u.defineProperty(Od, { | |
Bg: "oldParam" | |
}, function() { | |
return this.cr | |
}, function(a) { | |
this.cr = a | |
}); | |
u.defineProperty(Od, { | |
newValue: "newValue" | |
}, function() { | |
return this.Zq | |
}, function(a) { | |
this.Zq = a | |
}); | |
u.defineProperty(Od, { | |
zg: "newParam" | |
}, function() { | |
return this.Yq | |
}, function(a) { | |
this.Yq = a | |
}); | |
function J(a) { | |
1 < arguments.length && u.k("Model constructor can only take one optional argument, the Array of node data."); | |
u.gc(this); | |
this.yx = this.Vb = ""; | |
this.vk = !1; | |
this.hy = {}; | |
this.of = []; | |
this.sc = new la(null, Object); | |
this.Xl = "key"; | |
this.Yt = this.Gu = null; | |
this.px = this.qx = !1; | |
this.$q = "category"; | |
this.wh = new la(null, F); | |
this.jj = null; | |
this.ri = !1; | |
this.Iy = null; | |
this.ga = new ee; | |
void 0 !== a && (this.dh = a) | |
} | |
u.fa("Model", J); | |
J.prototype.clear = J.prototype.clear = function() { | |
this.of = []; | |
this.sc.clear(); | |
this.wh.clear(); | |
this.ga.clear() | |
}; | |
g = J.prototype; | |
g.Bt = function() { | |
var a = ""; | |
"" !== this.name && (a += ',\n "name": ' + this.quote(this.name)); | |
"" !== this.Sk && (a += ',\n "dataFormat": ' + this.quote(this.Sk)); | |
this.nb && (a += ',\n "isReadOnly": ' + this.nb); | |
"key" !== this.Nm && "string" === typeof this.Nm && (a += ',\n "nodeKeyProperty": ' + this.quote(this.Nm)); | |
this.Yy && (a += ',\n "copiesArrays": true'); | |
this.Xy && (a += ',\n "copiesArrayObjects": true'); | |
"category" !== this.Mm && "string" === typeof this.Mm && (a += ',\n "nodeCategoryProperty": ' + this.quote(this.Mm)); | |
return a | |
}; | |
g.qA = function() { | |
var a = "", | |
b = this.$s, | |
c = !1, | |
d; | |
for (d in b) { | |
if (!fe(d, b[d])) { | |
c = !0; | |
break | |
} | |
} | |
c && (a = ',\n "modelData": ' + oe(this, b)); | |
return a + ',\n "nodeDataArray": ' + pe(this, this.dh, !0) | |
}; | |
g.gt = function(a) { | |
a.name && (this.name = a.name); | |
a.dataFormat && (this.Sk = a.dataFormat); | |
a.isReadOnly && (this.nb = a.isReadOnly); | |
a.nodeKeyProperty && (this.Nm = a.nodeKeyProperty); | |
a.copiesArrays && (this.Yy = a.copiesArrays); | |
a.copiesArrayObjects && (this.Xy = a.copiesArrayObjects); | |
a.nodeCategoryProperty && (this.Mm = a.nodeCategoryProperty) | |
}; | |
g.Rz = function(a) { | |
var b = a.modelData; | |
u.Ta(b) && (this.it(b), this.$s = b); | |
a = a.nodeDataArray; | |
u.isArray(a) && (this.it(a), this.dh = a) | |
}; | |
g.toString = function(a) { | |
void 0 === a && (a = 0); | |
if (1 < a) { | |
return this.lA() | |
} | |
var b = ("" !== this.name ? this.name : "") + " Model"; | |
if (0 < a) { | |
b += "\n node data:"; | |
a = this.dh; | |
for (var c = u.qb(a), d = 0; d < c; d++) { | |
var e = u.ib(a, d), | |
b = b + (" " + this.wb(e) + ":" + de(e)) | |
} | |
} | |
return b | |
}; | |
J.prototype.toJson = J.prototype.toJSON = J.prototype.lA = function(a) { | |
void 0 === a && (a = this.constructor === J ? "go.Model" : this.constructor === Q ? "go.GraphLinksModel" : this.constructor === qe ? "go.TreeModel" : u.tg(this)); | |
return '{ "class": ' + this.quote(a) + this.Bt() + this.qA() + "}" | |
}; | |
J.fromJson = J.fromJSON = function(a, b) { | |
void 0 === b && (b = null); | |
null !== b && u.C(b, J, J, "fromJson:model"); | |
var c = null; | |
if ("string" === typeof a) { | |
if (window.JSON && window.JSON.parse) { | |
try { | |
c = window.JSON.parse(a) | |
} catch (d) {} | |
} else { | |
u.trace("WARNING: no JSON.parse available") | |
} | |
} else { | |
"object" === typeof a ? c = a : u.k("Unable to construct a Model from: " + a) | |
} | |
if (null === b) { | |
var e; | |
e = null; | |
var f = c["class"]; | |
if ("string" === typeof f) { | |
try { | |
var h = null; | |
0 === f.indexOf("go.") ? (f = f.substr(3), h = da[f]) : (h = da[f], void 0 === h && (h = window[f])); | |
"function" === typeof h && (e = new h) | |
} catch (k) {} | |
} | |
null === e || e instanceof J ? b = e : u.k("Unable to construct a Model of declared class: " + c["class"]) | |
} | |
null === b && (b = new Q); | |
b.gt(c); | |
b.Rz(c); | |
return b | |
}; | |
J.prototype.replaceJsonObjects = J.prototype.it = function(a) { | |
if (u.isArray(a)) { | |
for (var b = u.qb(a), c = 0; c < b; c++) { | |
var d = u.ib(a, c); | |
u.Ta(d) && u.RC(a, c, this.it(d)) | |
} | |
} else { | |
if (u.Ta(a)) { | |
for (c in a) { | |
if (d = a[c], u.Ta(d) && (d = this.it(d), a[c] = d, "points" === c && Array.isArray(d))) { | |
for (var e = 0 === d.length % 2, f = 0; f < d.length; f++) { | |
if ("number" !== typeof d[f]) { | |
e = !1; | |
break | |
} | |
} | |
if (e) { | |
e = new E(w); | |
for (f = 0; f < d.length / 2; f++) { | |
e.add(new w(d[2 * f], d[2 * f + 1])) | |
} | |
e.freeze(); | |
a[c] = e | |
} | |
} | |
} | |
if ("object" === typeof a) { | |
c = a; | |
d = a["class"]; | |
if ("NaN" === d) { | |
c = NaN | |
} else { | |
if ("Date" === d) { | |
c = new Date(a.value) | |
} else { | |
if ("go.Point" === d) { | |
c = new w(re(a.x), re(a.y)) | |
} else { | |
if ("go.Size" === d) { | |
c = new ia(re(a.width), re(a.height)) | |
} else { | |
if ("go.Rect" === d) { | |
c = new z(re(a.x), re(a.y), re(a.width), re(a.height)) | |
} else { | |
if ("go.Margin" === d) { | |
c = new rb(re(a.top), re(a.right), re(a.bottom), re(a.left)) | |
} else { | |
if ("go.Spot" === d) { | |
c = "string" === typeof a["enum"] ? tb(a["enum"]) : new L(re(a.x), re(a.y), re(a.offsetX), re(a.offsetY)) | |
} else { | |
if ("go.Brush" === d) { | |
if (c = new ga, c.type = Da(ga, a.type), "string" === typeof a.color && (c.color = a.color), a.start instanceof L && (c.start = a.start), a.end instanceof L && (c.end = a.end), "number" === typeof a.startRadius && (c.vt = re(a.startRadius)), "number" === typeof a.endRadius && (c.vs = re(a.endRadius)), a = a.colorStops, u.Ta(a)) { | |
for (b in a) { | |
c.addColorStop(parseFloat(b), a[b]) | |
} | |
} | |
} else { | |
"go.Geometry" === d && (b = null, b = "string" === typeof a.path ? sd(a.path) : new $c, b.type = Da($c, a.type), "number" === typeof a.startX && (b.va = re(a.startX)), "number" === typeof a.startY && (b.wa = re(a.startY)), "number" === typeof a.endX && (b.F = re(a.endX)), "number" === typeof a.endY && (b.G = re(a.endY)), a.spot1 instanceof L && (b.A = a.spot1), a.spot2 instanceof L && (b.B = a.spot2), c = b) | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
a = c | |
} | |
} | |
} | |
return a | |
}; | |
J.prototype.quote = function(a) { | |
for (var b = "", c = a.length, d = 0; d < c; d++) { | |
var e = a[d]; | |
if ('"' === e || "\\" === e) { | |
b += "\\" + e | |
} else { | |
if ("\b" === e) { | |
b += "\\b" | |
} else { | |
if ("\f" === e) { | |
b += "\\f" | |
} else { | |
if ("\n" === e) { | |
b += "\\n" | |
} else { | |
if ("\r" === e) { | |
b += "\\r" | |
} else { | |
if ("\t" === e) { | |
b += "\\t" | |
} else { | |
var f = a.charCodeAt(d), | |
b = 16 > f ? b + ("\\u000" + a.charCodeAt(d).toString(16)) : 32 > f ? b + ("\\u00" + a.charCodeAt(d).toString(16)) : 8232 === f ? b + "\\u2028" : 8233 === f ? b + "\\u2029" : b + e | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
return '"' + b + '"' | |
}; | |
J.prototype.writeJsonValue = J.prototype.Ct = 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.Ct(a.valueOf()) : u.isArray(a) ? pe(this, a) : u.Ta(a) ? oe(this, a) : "function" === typeof a ? "null" : a.toString() | |
}; | |
function pe(a, b, c) { | |
void 0 === c && (c = !1); | |
var d = u.qb(b); | |
if (0 >= d) { | |
return "[]" | |
} | |
var e = new Ca; | |
e.add("[ "); | |
c && 1 < d && e.add("\n"); | |
for (var f = 0; f < d; f++) { | |
var h = u.ib(b, f); | |
void 0 !== h && (0 < f && (e.add(","), c && e.add("\n")), e.add(a.Ct(h))) | |
} | |
c && 1 < d && e.add("\n"); | |
e.add(" ]"); | |
return e.toString() | |
} | |
function fe(a, b) { | |
return void 0 === b || "__gohashid" === a || "_" === a[0] || "function" === typeof b ? !0 : !1 | |
} | |
function se(a) { | |
return isNaN(a) ? "NaN" : Infinity === a ? "9e9999" : -Infinity === a ? "-9e9999" : a | |
} | |
function oe(a, b) { | |
var c = b; | |
if (c instanceof w) { | |
var d = c; | |
b = { | |
"class": "go.Point", | |
x: se(d.x), | |
y: se(d.y) | |
} | |
} else { | |
if (c instanceof ia) { | |
var e = c; | |
b = { | |
"class": "go.Size", | |
width: se(e.width), | |
height: se(e.height) | |
} | |
} else { | |
if (c instanceof z) { | |
b = { | |
"class": "go.Rect", | |
x: se(c.x), | |
y: se(c.y), | |
width: se(c.width), | |
height: se(c.height) | |
} | |
} else { | |
if (c instanceof rb) { | |
b = { | |
"class": "go.Margin", | |
top: se(c.top), | |
right: se(c.right), | |
bottom: se(c.bottom), | |
left: se(c.left) | |
} | |
} else { | |
if (c instanceof L) { | |
e = c, b = e.Vc() ? { | |
"class": "go.Spot", | |
x: se(e.x), | |
y: se(e.y), | |
offsetX: se(e.offsetX), | |
offsetY: se(e.offsetY) | |
} : { | |
"class": "go.Spot", | |
"enum": e.toString() | |
} | |
} else { | |
if (c instanceof ga) { | |
b = { | |
"class": "go.Brush", | |
type: c.type.name | |
}; | |
if (c.type === te) { | |
b.color = c.color | |
} else { | |
if (c.type === ue || c.type === ve) { | |
b.start = c.start, b.end = c.end, c.type === ve && (0 !== c.vt && (b.startRadius = se(c.vt)), isNaN(c.vs) || (b.endRadius = se(c.vs))) | |
} | |
} | |
if (null !== c.qs) { | |
for (var f = {}, h = c.qs.i; h.next();) { | |
f[h.key] = h.value | |
} | |
b.colorStops = f | |
} | |
} else { | |
if (c instanceof $c) { | |
b = { | |
"class": "go.Geometry", | |
type: c.type.name | |
}, 0 !== c.va && (b.startX = se(c.va)), 0 !== c.wa && (b.startY = se(c.wa)), 0 !== c.F && (b.endX = se(c.F)), 0 !== c.G && (b.endY = se(c.G)), c.A.L(xb) || (b.spot1 = c.A), c.B.L(Vb) || (b.spot2 = c.B), c.type === ad && (b.path = qd(c)) | |
} else { | |
if (c instanceof T || c instanceof D || c instanceof we || c instanceof J || c instanceof xe || c instanceof sa || c instanceof Je || c instanceof xa || c instanceof ee || c instanceof Ke) { | |
return u.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: " + c.toString()), "{}" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
f = "{"; | |
c = !0; | |
for (d in b) { | |
if (e = u.sb(b, d), !fe(d, e)) { | |
if (c ? c = !1 : f += ", ", f += '"' + d + '":', "points" === d && e instanceof E && e.pa === w) { | |
h = e; | |
e = "["; | |
for (h = h.i; h.next();) { | |
var k = h.value; | |
1 < e.length && (e += ","); | |
e += a.Ct(k.x); | |
e += ","; | |
e += a.Ct(k.y) | |
} | |
e += "]"; | |
f += e | |
} else { | |
f += a.Ct(e) | |
} | |
} | |
} | |
return f + "}" | |
} | |
function re(a) { | |
return "number" === typeof a ? a : "NaN" === a ? NaN : "9e9999" === a ? Infinity : "-9e9999" === a ? -Infinity : parseFloat(a) | |
} | |
u.defineProperty(J, { | |
name: "name" | |
}, function() { | |
return this.Vb | |
}, function(a) { | |
var b = this.Vb; | |
b !== a && (u.j(a, "string", J, "name"), this.Vb = a, this.h("name", b, a)) | |
}); | |
u.defineProperty(J, { | |
Sk: "dataFormat" | |
}, function() { | |
return this.yx | |
}, function(a) { | |
var b = this.yx; | |
b !== a && (u.j(a, "string", J, "dataFormat"), this.yx = a, this.h("dataFormat", b, a)) | |
}); | |
u.defineProperty(J, { | |
nb: "isReadOnly" | |
}, function() { | |
return this.vk | |
}, function(a) { | |
var b = this.vk; | |
b !== a && (u.j(a, "boolean", J, "isReadOnly"), this.vk = a, this.h("isReadOnly", b, a)) | |
}); | |
u.defineProperty(J, { | |
$s: "modelData" | |
}, function() { | |
return this.hy | |
}, function(a) { | |
var b = this.hy; | |
b !== a && (u.j(a, "object", J, "modelData"), this.hy = a, this.h("modelData", b, a), this.Ob(a)) | |
}); | |
J.prototype.addChangedListener = J.prototype.Ly = function(a) { | |
u.j(a, "function", J, "addChangedListener:listener"); | |
null === this.jj && (this.jj = new E("function")); | |
this.jj.add(a) | |
}; | |
J.prototype.removeChangedListener = J.prototype.Uz = function(a) { | |
u.j(a, "function", J, "removeChangedListener:listener"); | |
null !== this.jj && (this.jj.remove(a), 0 === this.jj.count && (this.jj = null)) | |
}; | |
J.prototype.Kv = function(a) { | |
this.gb || this.ga.ED(a); | |
if (null !== this.jj) { | |
var b = this.jj, | |
c = b.length; | |
if (1 === c) { | |
b = b.ja(0), b(a) | |
} else { | |
if (0 !== c) { | |
for (var d = b.Le(), e = 0; e < c; e++) { | |
b = d[e], b(a) | |
} | |
} | |
} | |
} | |
}; | |
J.prototype.raiseChangedEvent = J.prototype.Cc = function(a, b, c, d, e, f, h) { | |
Le(this, "", a, b, c, d, e, f, h) | |
}; | |
J.prototype.raiseChanged = J.prototype.h = function(a, b, c, d, e) { | |
Le(this, "", $d, a, this, b, c, d, e) | |
}; | |
J.prototype.raiseDataChanged = J.prototype.Qz = function(a, b, c, d, e, f) { | |
Le(this, "", $d, b, a, c, d, e, f) | |
}; | |
function Le(a, b, c, d, e, f, h, k, l) { | |
void 0 === k && (k = null); | |
void 0 === l && (l = null); | |
var m = new Od; | |
m.ha = a; | |
m.Cd = c; | |
m.Mf = b; | |
m.propertyName = d; | |
m.object = e; | |
m.oldValue = f; | |
m.Bg = k; | |
m.newValue = h; | |
m.zg = l; | |
a.Kv(m) | |
} | |
u.defineProperty(J, { | |
ga: "undoManager" | |
}, function() { | |
return this.Iy | |
}, function(a) { | |
var b = this.Iy; | |
b !== a && (u.C(a, ee, J, "undoManager"), null !== b && b.UH(this), this.Iy = a, null !== a && a.NF(this)) | |
}); | |
u.defineProperty(J, { | |
gb: "skipsUndoManager" | |
}, function() { | |
return this.ri | |
}, function(a) { | |
u.j(a, "boolean", J, "skipsUndoManager"); | |
this.ri = a | |
}); | |
J.prototype.tm = function(a, b) { | |
if (null !== a && a.ha === this) { | |
if (a.Cd === $d) { | |
var c = a.object, | |
d = a.propertyName, | |
e = a.ua(b); | |
u.Pa(c, d, e) | |
} else { | |
a.Cd === be ? "nodeDataArray" === a.Mf ? (c = a.newValue, u.Ta(c) && (d = this.wb(c), void 0 !== d && (b ? (u.Ai(this.of, a.zg), this.sc.remove(d)) : (u.zi(this.of, a.zg, c), this.sc.add(d, c))))) : "" === a.Mf ? (c = a.object, !u.isArray(c) && a.propertyName && (c = u.sb(a.object, a.propertyName)), u.isArray(c) && (d = a.newValue, e = a.zg, b ? u.Ai(c, e) : u.zi(c, e, d))) : u.k("unknown ChangedEvent.Insert object: " + a.toString()) : a.Cd === ce ? "nodeDataArray" === a.Mf ? (c = a.oldValue, u.Ta(c) && (d = this.wb(c), void 0 !== d && (b ? (u.zi(this.of, a.Bg, c), this.sc.add(d, c)) : (u.Ai(this.of, a.Bg), this.sc.remove(d))))) : "" === a.Mf ? (c = a.object, !u.isArray(c) && a.propertyName && (c = u.sb(a.object, a.propertyName)), u.isArray(c) && (d = a.oldValue, e = a.Bg, b ? u.zi(c, e, d) : u.Ai(c, e))) : u.k("unknown ChangedEvent.Remove object: " + a.toString()) : a.Cd !== ae && u.k("unknown ChangedEvent: " + a.toString()) | |
} | |
} | |
}; | |
J.prototype.startTransaction = J.prototype.Xb = function(a) { | |
return this.ga.Xb(a) | |
}; | |
J.prototype.commitTransaction = J.prototype.Xd = function(a) { | |
return this.ga.Xd(a) | |
}; | |
J.prototype.rollbackTransaction = J.prototype.cp = function() { | |
return this.ga.cp() | |
}; | |
J.prototype.updateTargetBindings = J.prototype.Ob = function(a, b) { | |
void 0 === b && (b = ""); | |
Le(this, "SourceChanged", ae, b, a, null, null) | |
}; | |
u.defineProperty(J, { | |
Nm: "nodeKeyProperty" | |
}, function() { | |
return this.Xl | |
}, function(a) { | |
var b = this.Xl; | |
b !== a && (Me(a, J, "nodeKeyProperty"), 0 < this.sc.count && u.k("Cannot set Model.nodeKeyProperty when there is existing node data"), this.Xl = a, this.h("nodeKeyProperty", b, a)) | |
}); | |
function Me(a, b, c) { | |
"string" !== typeof a && "function" !== typeof a && u.Ld(a, "string or function", b, c) | |
} | |
J.prototype.getKeyForNodeData = J.prototype.wb = function(a) { | |
if (null !== a) { | |
var b = this.Xl; | |
if ("" !== b && (b = u.sb(a, b), void 0 !== b)) { | |
if (Ne(b)) { | |
return b | |
} | |
u.k("Key value for node data " + a + " is not a number or a string: " + b) | |
} | |
} | |
}; | |
J.prototype.setKeyForNodeData = J.prototype.cA = function(a, b) { | |
void 0 !== b && null !== b && Ne(b) || u.Ld(b, "number or string", J, "setKeyForNodeData:key"); | |
if (null !== a) { | |
var c = this.Xl; | |
if ("" !== c) { | |
if (this.Ve(a)) { | |
var d = u.sb(a, c); | |
d !== b && null === this.sf(b) && (u.Pa(a, c, b), this.sc.remove(d), this.sc.add(b, a), Le(this, "nodeKey", $d, c, a, d, b), "string" === typeof c && this.Ob(a, c), this.ht(d, b)) | |
} else { | |
u.Pa(a, c, b) | |
} | |
} | |
} | |
}; | |
u.defineProperty(J, { | |
VJ: "makeUniqueKeyFunction" | |
}, function() { | |
return this.Gu | |
}, function(a) { | |
var b = this.Gu; | |
b !== a && (null !== a && u.j(a, "function", J, "makeUniqueKeyFunction"), this.Gu = a, this.h("makeUniqueKeyFunction", b, a)) | |
}); | |
function Ne(a) { | |
return "number" === typeof a || "string" === typeof a | |
} | |
J.prototype.containsNodeData = J.prototype.Ve = function(a) { | |
a = this.wb(a); | |
return void 0 === a ? !1 : this.sc.contains(a) | |
}; | |
J.prototype.findNodeDataForKey = J.prototype.sf = function(a) { | |
null === a && u.k("Model.findNodeDataForKey:key must not be null"); | |
return void 0 !== a && Ne(a) ? this.sc.ua(a) : null | |
}; | |
u.defineProperty(J, { | |
dh: "nodeDataArray" | |
}, function() { | |
return this.of | |
}, function(a) { | |
var b = this.of; | |
if (b !== a) { | |
u.Sy(a, J, "nodeDataArray"); | |
this.sc.clear(); | |
this.nA(); | |
for (var c = u.qb(a), d = 0; d < c; d++) { | |
var e = u.ib(a, d); | |
if (!u.Ta(e)) { | |
u.k("Model.nodeDataArray must only contain Objects, not: " + e); | |
return | |
} | |
u.Js(e) | |
} | |
this.of = a; | |
for (var f = new E(Object), d = 0; d < c; d++) { | |
var e = u.ib(a, d), | |
h = this.wb(e); | |
void 0 === h ? f.add(e) : null !== this.sc.ua(h) ? f.add(e) : this.sc.add(h, e) | |
} | |
for (d = f.i; d.next();) { | |
e = d.value, this.VD(e), f = this.wb(e), void 0 !== f && this.sc.add(f, e) | |
} | |
Le(this, "nodeDataArray", $d, "nodeDataArray", this, b, a); | |
for (d = 0; d < c; d++) { | |
e = u.ib(a, d), this.bp(e), this.ap(e) | |
} | |
this.XC(); | |
u.eH(a) || (this.nb = !0) | |
} | |
}); | |
J.prototype.makeNodeDataKeyUnique = J.prototype.VD = function(a) { | |
if (null !== a) { | |
var b = this.Xl; | |
if ("" !== b) { | |
var c = this.wb(a); | |
if (void 0 === c || this.sc.contains(c)) { | |
var d = this.Gu; | |
if (null !== d && (c = d(this, a), void 0 !== c && null !== c && !this.sc.contains(c))) { | |
u.Pa(a, b, c); | |
return | |
} | |
if ("string" === typeof c) { | |
for (d = 2; this.sc.contains(c + d);) { | |
d++ | |
} | |
u.Pa(a, b, c + d) | |
} else { | |
if (void 0 === c || "number" === typeof c) { | |
for (d = -this.sc.count - 1; this.sc.contains(d);) { | |
d-- | |
} | |
u.Pa(a, b, d) | |
} else { | |
u.k("Model.getKeyForNodeData returned something other than a string or a number: " + c) | |
} | |
} | |
} | |
} | |
} | |
}; | |
J.prototype.addNodeData = J.prototype.om = function(a) { | |
if (null !== a) { | |
u.Js(a); | |
var b = this.wb(a); | |
if (void 0 === b || this.sc.ua(b) !== a) { | |
this.VD(a), b = this.wb(a), void 0 === b ? u.k("Model.makeNodeDataKeyUnique failed on " + a + ". Data not added to Model.") : (this.sc.add(b, a), b = u.qb(this.of), u.zi(this.of, b, a), Le(this, "nodeDataArray", be, "nodeDataArray", this, null, a, null, b), this.bp(a), this.ap(a)) | |
} | |
} | |
}; | |
J.prototype.addNodeDataCollection = function(a) { | |
if (u.isArray(a)) { | |
for (var b = u.qb(a), c = 0; c < b; c++) { | |
this.om(u.ib(a, c)) | |
} | |
} else { | |
for (a = a.i; a.next();) { | |
this.om(a.value) | |
} | |
} | |
}; | |
J.prototype.removeNodeData = J.prototype.Wz = function(a) { | |
if (null !== a) { | |
var b = this.wb(a); | |
void 0 !== b && this.sc.contains(b) && (this.sc.remove(b), b = u.Ry(this.of, a), 0 > b || (u.Ai(this.of, b), Le(this, "nodeDataArray", ce, "nodeDataArray", this, a, null, b, null), this.At(a))) | |
} | |
}; | |
J.prototype.removeNodeDataCollection = function(a) { | |
if (u.isArray(a)) { | |
for (var b = u.qb(a), c = 0; c < b; c++) { | |
this.Wz(u.ib(a, c)) | |
} | |
} else { | |
for (a = a.i; a.next();) { | |
this.Wz(a.value) | |
} | |
} | |
}; | |
g = J.prototype; | |
g.ht = function(a, b) { | |
var c = Oe(this, a); | |
c instanceof F && this.wh.add(b, c) | |
}; | |
g.nA = function() {}; | |
g.bp = function() {}; | |
g.ap = function() {}; | |
g.At = function() {}; | |
function Pe(a, b, c) { | |
if (void 0 !== b) { | |
var d = a.wh.ua(b); | |
null === d && (d = new F(Object), a.wh.add(b, d)); | |
d.add(c) | |
} | |
} | |
function Qe(a, b, c) { | |
if (void 0 !== b) { | |
var d = a.wh.ua(b); | |
d instanceof F && (void 0 === c || null === c ? a.wh.remove(b) : (d.remove(c), 0 === d.count && a.wh.remove(b))) | |
} | |
} | |
function Oe(a, b) { | |
if (void 0 === b) { | |
return null | |
} | |
var c = a.wh.ua(b); | |
return c instanceof F ? c : null | |
} | |
J.prototype.clearUnresolvedReferences = J.prototype.XC = function(a) { | |
void 0 === a ? this.wh.clear() : this.wh.remove(a) | |
}; | |
u.defineProperty(J, { | |
jJ: "copyNodeDataFunction" | |
}, function() { | |
return this.Yt | |
}, function(a) { | |
var b = this.Yt; | |
b !== a && (null !== a && u.j(a, "function", J, "copyNodeDataFunction"), this.Yt = a, this.h("copyNodeDataFunction", b, a)) | |
}); | |
u.defineProperty(J, { | |
Yy: "copiesArrays" | |
}, function() { | |
return this.qx | |
}, function(a) { | |
var b = this.qx; | |
b !== a && (null !== a && u.j(a, "boolean", J, "copiesArrays"), this.qx = a, this.h("copiesArrays", b, a)) | |
}); | |
u.defineProperty(J, { | |
Xy: "copiesArrayObjects" | |
}, function() { | |
return this.px | |
}, function(a) { | |
var b = this.px; | |
b !== a && (null !== a && u.j(a, "boolean", J, "copiesArrayObjects"), this.px = a, this.h("copiesArrayObjects", b, a)) | |
}); | |
J.prototype.copyNodeData = function(a) { | |
if (null === a) { | |
return null | |
} | |
var b = null, | |
b = this.Yt, | |
b = null !== b ? b(a, this) : Re(this, a, !0); | |
u.Ta(b) && u.gc(b); | |
return b | |
}; | |
function Re(a, b, c) { | |
if (a.Yy && Array.isArray(b)) { | |
var d = []; | |
for (c = 0; c < b.length; c++) { | |
var e = Re(a, b[c], a.Xy); | |
d.push(e) | |
} | |
u.gc(d); | |
return d | |
} | |
if (c && u.Ta(b)) { | |
c = (c = b.constructor) ? new c : {}; | |
for (d in b) { | |
if ("__gohashid" !== d) { | |
var e = u.sb(b, d), | |
f; | |
f = e; | |
f instanceof T || f instanceof D || f instanceof we || f instanceof Se || f instanceof Te || f instanceof xe || f instanceof sa || f instanceof Je || f instanceof Md || f instanceof Nd ? ("_" !== d[0] && u.trace('Warning: found GraphObject or Diagram reference when copying model data on property "' + d + '" of data object: ' + b.toString() + " \nModel data should not have any references to a Diagram or any part of a diagram, such as: " + f.toString()), f = !0) : f = f instanceof J || f instanceof ee || f instanceof Ke || f instanceof Od ? !0 : !1; | |
f || (e = Re(a, e, !1)); | |
u.Pa(c, d, e) | |
} | |
} | |
u.gc(c); | |
return c | |
} | |
return b | |
} | |
var Ue = !1; | |
J.prototype.setDataProperty = function(a, b, c) { | |
if (this.Ve(a)) { | |
if (b === this.Nm) { | |
this.cA(a, c) | |
} else { | |
if (b === this.Mm) { | |
this.Fw(a, c); | |
return | |
} | |
} | |
} else { | |
!Ue && a instanceof T && (Ue = !0, u.trace('Model.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), u.trace(" Is that really your intent?")) | |
} | |
var d = u.sb(a, b); | |
d !== c && (u.Pa(a, b, c), this.Qz(a, b, d, c)) | |
}; | |
J.prototype.addArrayItem = function(a, b) { | |
this.YG(a, -1, b) | |
}; | |
J.prototype.insertArrayItem = J.prototype.YG = function(a, b, c) { | |
a === this.of && u.k("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray"); | |
0 > b && (b = u.qb(a)); | |
u.zi(a, b, c); | |
Le(this, "", be, "", a, null, c, null, b) | |
}; | |
J.prototype.removeArrayItem = function(a, b) { | |
void 0 === b && (b = -1); | |
a === this.of && u.k("Model.removeArrayItem should not be called on the Model.nodeDataArray"); - 1 === b && (b = u.qb(a) - 1); | |
var c = u.ib(a, b); | |
u.Ai(a, b); | |
Le(this, "", ce, "", a, c, null, b, null) | |
}; | |
u.defineProperty(J, { | |
Mm: "nodeCategoryProperty" | |
}, function() { | |
return this.$q | |
}, function(a) { | |
var b = this.$q; | |
b !== a && (Me(a, J, "nodeCategoryProperty"), this.$q = a, this.h("nodeCategoryProperty", b, a)) | |
}); | |
J.prototype.getCategoryForNodeData = J.prototype.gz = function(a) { | |
if (null === a) { | |
return "" | |
} | |
var b = this.$q; | |
if ("" === b) { | |
return "" | |
} | |
b = u.sb(a, b); | |
if (void 0 === b) { | |
return "" | |
} | |
if ("string" === typeof b) { | |
return b | |
} | |
u.k("getCategoryForNodeData found a non-string category for " + a + ": " + b); | |
return "" | |
}; | |
J.prototype.setCategoryForNodeData = J.prototype.Fw = function(a, b) { | |
u.j(b, "string", J, "setCategoryForNodeData:cat"); | |
if (null !== a) { | |
var c = this.$q; | |
if ("" !== c) { | |
if (this.Ve(a)) { | |
var d = u.sb(a, c); | |
void 0 === d && (d = ""); | |
d !== b && (u.Pa(a, c, b), Le(this, "nodeCategory", $d, c, a, d, b)) | |
} else { | |
u.Pa(a, c, b) | |
} | |
} | |
} | |
}; | |
function Q(a, b) { | |
2 < arguments.length && u.k("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data."); | |
J.call(this); | |
this.Dh = []; | |
this.Vl = new F(Object); | |
this.ik = this.Xt = null; | |
this.fj = "from"; | |
this.ij = "to"; | |
this.Fq = this.Eq = ""; | |
this.Bq = "category"; | |
this.Eh = ""; | |
this.Qu = "isGroup"; | |
this.pj = "group"; | |
this.sx = !1; | |
void 0 !== a && (this.dh = a); | |
void 0 !== b && (this.Qj = b) | |
} | |
u.Ha(Q, J); | |
u.fa("GraphLinksModel", Q); | |
Q.prototype.clear = Q.prototype.clear = function() { | |
J.prototype.clear.call(this); | |
this.Dh = []; | |
this.Vl.clear() | |
}; | |
g = Q.prototype; | |
g.toString = function(a) { | |
void 0 === a && (a = 0); | |
if (2 <= a) { | |
return this.lA() | |
} | |
var b = ("" !== this.name ? this.name : "") + " GraphLinksModel"; | |
if (0 < a) { | |
b += "\n node data:"; | |
a = this.dh; | |
for (var c = u.qb(a), d = 0, d = 0; d < c; d++) { | |
var e = u.ib(a, d), | |
b = b + (" " + this.wb(e) + ":" + de(e)) | |
} | |
b += "\n link data:"; | |
a = this.Qj; | |
c = u.qb(a); | |
for (d = 0; d < c; d++) { | |
e = u.ib(a, d), b += " " + this.$k(e) + "--\x3e" + this.cl(e) | |
} | |
} | |
return b | |
}; | |
g.Bt = function() { | |
var a = J.prototype.Bt.call(this), | |
b = ""; | |
"category" !== this.Us && "string" === typeof this.Us && (b += ',\n "linkCategoryProperty": ' + this.quote(this.Us)); | |
"from" !== this.Mo && "string" === typeof this.Mo && (b += ',\n "linkFromKeyProperty": ' + this.quote(this.Mo)); | |
"to" !== this.Oo && "string" === typeof this.Oo && (b += ',\n "linkToKeyProperty": ' + this.quote(this.Oo)); | |
"" !== this.Vs && "string" === typeof this.Vs && (b += ',\n "linkFromPortIdProperty": ' + this.quote(this.Vs)); | |
"" !== this.Xs && "string" === typeof this.Xs && (b += ',\n "linkToPortIdProperty": ' + this.quote(this.Xs)); | |
"" !== this.Ws && "string" === typeof this.Ws && (b += ',\n "linkLabelKeysProperty": ' + this.quote(this.Ws)); | |
"isGroup" !== this.ct && "string" === typeof this.ct && (b += ',\n "nodeIsGroupProperty": ' + this.quote(this.ct)); | |
"group" !== this.Xo && "string" === typeof this.Xo && (b += ',\n "nodeGroupKeyProperty": ' + this.quote(this.Xo)); | |
return a + b | |
}; | |
g.qA = function() { | |
var a = J.prototype.qA.call(this), | |
b = ',\n "linkDataArray": ' + pe(this, this.Qj, !0); | |
return a + b | |
}; | |
g.gt = function(a) { | |
J.prototype.gt.call(this, a); | |
a.linkFromKeyProperty && (this.Mo = a.linkFromKeyProperty); | |
a.linkToKeyProperty && (this.Oo = a.linkToKeyProperty); | |
a.linkFromPortIdProperty && (this.Vs = a.linkFromPortIdProperty); | |
a.linkToPortIdProperty && (this.Xs = a.linkToPortIdProperty); | |
a.linkCategoryProperty && (this.Us = a.linkCategoryProperty); | |
a.linkLabelKeysProperty && (this.Ws = a.linkLabelKeysProperty); | |
a.nodeIsGroupProperty && (this.ct = a.nodeIsGroupProperty); | |
a.nodeGroupKeyProperty && (this.Xo = a.nodeGroupKeyProperty) | |
}; | |
g.Rz = function(a) { | |
J.prototype.Rz.call(this, a); | |
a = a.linkDataArray; | |
u.isArray(a) && (this.it(a), this.Qj = a) | |
}; | |
g.tm = function(a, b) { | |
var c = null; | |
if (a.Cd === be) { | |
if ("linkDataArray" === a.Mf ? c = this.Dh : "linkLabelKeys" === a.Mf && (c = this.Pj(a.object)), u.isArray(c)) { | |
b ? u.Ai(c, a.zg) : u.zi(c, a.zg, a.newValue); | |
return | |
} | |
} else { | |
if (a.Cd === ce && ("linkDataArray" === a.Mf ? c = this.Dh : "linkLabelKeys" === a.Mf && (c = this.Pj(a.object)), u.isArray(c))) { | |
b ? u.zi(c, a.Bg, a.oldValue) : u.Ai(c, a.Bg); | |
return | |
} | |
} | |
J.prototype.tm.call(this, a, b) | |
}; | |
u.defineProperty(Q, { | |
Qy: "archetypeNodeData" | |
}, function() { | |
return this.ik | |
}, function(a) { | |
var b = this.ik; | |
b !== a && (null !== a && u.C(a, Object, Q, "archetypeNodeData"), this.ik = a, this.h("archetypeNodeData", b, a)) | |
}); | |
Q.prototype.Km = function(a) { | |
if (void 0 !== a) { | |
var b = this.ik; | |
if (null !== b) { | |
var c = this.sf(a); | |
null === c && (c = this.copyNodeData(b), u.Pa(c, this.Xl, a), this.om(c)) | |
} | |
return a | |
} | |
}; | |
u.defineProperty(Q, { | |
Mo: "linkFromKeyProperty" | |
}, function() { | |
return this.fj | |
}, function(a) { | |
var b = this.fj; | |
b !== a && (Me(a, Q, "linkFromKeyProperty"), this.fj = a, this.h("linkFromKeyProperty", b, a)) | |
}); | |
Q.prototype.getFromKeyForLinkData = Q.prototype.$k = function(a) { | |
if (null !== a) { | |
var b = this.fj; | |
if ("" !== b && (b = u.sb(a, b), void 0 !== b)) { | |
if (Ne(b)) { | |
return b | |
} | |
u.k("FromKey value for link data " + a + " is not a number or a string: " + b) | |
} | |
} | |
}; | |
Q.prototype.setFromKeyForLinkData = Q.prototype.Gw = function(a, b) { | |
null === b && (b = void 0); | |
void 0 === b || Ne(b) || u.Ld(b, "number or string", Q, "setFromKeyForLinkData:key"); | |
if (null !== a) { | |
var c = this.fj; | |
if ("" !== c) { | |
if (b = this.Km(b), this.Di(a)) { | |
var d = u.sb(a, c); | |
d !== b && (Qe(this, d, a), u.Pa(a, c, b), null === this.sf(b) && Pe(this, b, a), Le(this, "linkFromKey", $d, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else { | |
u.Pa(a, c, b) | |
} | |
} | |
} | |
}; | |
u.defineProperty(Q, { | |
Oo: "linkToKeyProperty" | |
}, function() { | |
return this.ij | |
}, function(a) { | |
var b = this.ij; | |
b !== a && (Me(a, Q, "linkToKeyProperty"), this.ij = a, this.h("linkToKeyProperty", b, a)) | |
}); | |
Q.prototype.getToKeyForLinkData = Q.prototype.cl = function(a) { | |
if (null !== a) { | |
var b = this.ij; | |
if ("" !== b && (b = u.sb(a, b), void 0 !== b)) { | |
if (Ne(b)) { | |
return b | |
} | |
u.k("ToKey value for link data " + a + " is not a number or a string: " + b) | |
} | |
} | |
}; | |
Q.prototype.setToKeyForLinkData = Q.prototype.Iw = function(a, b) { | |
null === b && (b = void 0); | |
void 0 === b || Ne(b) || u.Ld(b, "number or string", Q, "setToKeyForLinkData:key"); | |
if (null !== a) { | |
var c = this.ij; | |
if ("" !== c) { | |
if (b = this.Km(b), this.Di(a)) { | |
var d = u.sb(a, c); | |
d !== b && (Qe(this, d, a), u.Pa(a, c, b), null === this.sf(b) && Pe(this, b, a), Le(this, "linkToKey", $d, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else { | |
u.Pa(a, c, b) | |
} | |
} | |
} | |
}; | |
u.defineProperty(Q, { | |
Vs: "linkFromPortIdProperty" | |
}, function() { | |
return this.Eq | |
}, function(a) { | |
var b = this.Eq; | |
b !== a && (Me(a, Q, "linkFromPortIdProperty"), this.Eq = a, this.h("linkFromPortIdProperty", b, a)) | |
}); | |
Q.prototype.getFromPortIdForLinkData = Q.prototype.GG = function(a) { | |
if (null === a) { | |
return "" | |
} | |
var b = this.Eq; | |
if ("" === b) { | |
return "" | |
} | |
a = u.sb(a, b); | |
return void 0 === a ? "" : a | |
}; | |
Q.prototype.setFromPortIdForLinkData = Q.prototype.bA = function(a, b) { | |
u.j(b, "string", Q, "setFromPortIdForLinkData:portname"); | |
if (null !== a) { | |
var c = this.Eq; | |
if ("" !== c) { | |
if (this.Di(a)) { | |
var d = u.sb(a, c); | |
void 0 === d && (d = ""); | |
d !== b && (u.Pa(a, c, b), Le(this, "linkFromPortId", $d, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else { | |
u.Pa(a, c, b) | |
} | |
} | |
} | |
}; | |
u.defineProperty(Q, { | |
Xs: "linkToPortIdProperty" | |
}, function() { | |
return this.Fq | |
}, function(a) { | |
var b = this.Fq; | |
b !== a && (Me(a, Q, "linkToPortIdProperty"), this.Fq = a, this.h("linkToPortIdProperty", b, a)) | |
}); | |
Q.prototype.getToPortIdForLinkData = Q.prototype.JG = function(a) { | |
if (null === a) { | |
return "" | |
} | |
var b = this.Fq; | |
if ("" === b) { | |
return "" | |
} | |
a = u.sb(a, b); | |
return void 0 === a ? "" : a | |
}; | |
Q.prototype.setToPortIdForLinkData = Q.prototype.fA = function(a, b) { | |
u.j(b, "string", Q, "setToPortIdForLinkData:portname"); | |
if (null !== a) { | |
var c = this.Fq; | |
if ("" !== c) { | |
if (this.Di(a)) { | |
var d = u.sb(a, c); | |
void 0 === d && (d = ""); | |
d !== b && (u.Pa(a, c, b), Le(this, "linkToPortId", $d, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else { | |
u.Pa(a, c, b) | |
} | |
} | |
} | |
}; | |
u.defineProperty(Q, { | |
Ws: "linkLabelKeysProperty" | |
}, function() { | |
return this.Eh | |
}, function(a) { | |
var b = this.Eh; | |
b !== a && (Me(a, Q, "linkLabelKeysProperty"), this.Eh = a, this.h("linkLabelKeysProperty", b, a)) | |
}); | |
Q.prototype.getLabelKeysForLinkData = Q.prototype.Pj = function(a) { | |
if (null === a) { | |
return u.nh | |
} | |
var b = this.Eh; | |
if ("" === b) { | |
return u.nh | |
} | |
a = u.sb(a, b); | |
return void 0 === a ? u.nh : a | |
}; | |
Q.prototype.setLabelKeysForLinkData = Q.prototype.GE = function(a, b) { | |
u.Sy(b, Q, "setLabelKeysForLinkData:arr"); | |
if (null !== a) { | |
var c = this.Eh; | |
if ("" !== c) { | |
if (this.Di(a)) { | |
var d = u.sb(a, c); | |
void 0 === d && (d = u.nh); | |
if (d !== b) { | |
for (var e = u.qb(d), f = 0; f < e; f++) { | |
var h = u.ib(d, f); | |
Qe(this, h, a) | |
} | |
u.Pa(a, c, b); | |
e = u.qb(b); | |
for (f = 0; f < e; f++) { | |
h = u.ib(b, f), null === this.sf(h) && Pe(this, h, a) | |
} | |
Le(this, "linkLabelKeys", $d, c, a, d, b); | |
"string" === typeof c && this.Ob(a, c) | |
} | |
} else { | |
u.Pa(a, c, b) | |
} | |
} | |
} | |
}; | |
Q.prototype.addLabelKeyForLinkData = Q.prototype.Ny = function(a, b) { | |
if (null !== b && void 0 !== b && (Ne(b) || u.Ld(b, "number or string", Q, "addLabelKeyForLinkData:key"), null !== a)) { | |
var c = this.Eh; | |
if ("" !== c) { | |
var d = u.sb(a, c); | |
void 0 === d ? (c = [], c.push(b), this.GE(a, c)) : u.isArray(d) ? 0 <= u.Ry(d, b) || (u.zi(d, Infinity, b), this.Di(a) && (null === this.sf(b) && Pe(this, b, a), Le(this, "linkLabelKeys", be, c, a, null, b))) : u.k(c + " property is not an Array; cannot addLabelKeyForLinkData: " + a) | |
} | |
} | |
}; | |
Q.prototype.removeLabelKeyForLinkData = Q.prototype.nE = function(a, b) { | |
if (null !== b && void 0 !== b && (Ne(b) || u.Ld(b, "number or string", Q, "removeLabelKeyForLinkData:key"), null !== a)) { | |
var c = this.Eh; | |
if ("" !== c) { | |
var d = u.sb(a, c); | |
if (u.isArray(d)) { | |
var e = u.Ry(d, b); | |
0 > e || (u.Ai(d, e), this.Di(a) && (Qe(this, b, a), Le(this, "linkLabelKeys", ce, c, a, b, null))) | |
} else { | |
void 0 !== d && u.k(c + " property is not an Array; cannot removeLabelKeyforLinkData: " + a) | |
} | |
} | |
} | |
}; | |
u.defineProperty(Q, { | |
Qj: "linkDataArray" | |
}, function() { | |
return this.Dh | |
}, function(a) { | |
var b = this.Dh; | |
if (b !== a) { | |
u.Sy(a, Q, "linkDataArray"); | |
for (var c = u.qb(a), d = 0; d < c; d++) { | |
var e = u.ib(a, d); | |
if (!u.Ta(e)) { | |
u.k("GraphLinksModel.linkDataArray must only contain Objects, not: " + e); | |
return | |
} | |
u.Js(e) | |
} | |
this.Dh = a; | |
for (var f = new F(Object), d = 0; d < c; d++) { | |
e = u.ib(a, d), f.add(e) | |
} | |
this.Vl = f; | |
Le(this, "linkDataArray", $d, "linkDataArray", this, b, a); | |
for (d = 0; d < c; d++) { | |
e = u.ib(a, d), Ve(this, e) | |
} | |
} | |
}); | |
Q.prototype.containsLinkData = Q.prototype.Di = function(a) { | |
return null === a ? !1 : this.Vl.contains(a) | |
}; | |
Q.prototype.addLinkData = Q.prototype.yv = function(a) { | |
if (null !== a) { | |
if (void 0 === u.Uc(a)) { | |
u.gc(a) | |
} else { | |
if (this.Di(a)) { | |
return | |
} | |
} | |
this.Vl.add(a); | |
var b = u.qb(this.Dh); | |
u.zi(this.Dh, b, a); | |
Le(this, "linkDataArray", be, "linkDataArray", this, null, a, null, b); | |
Ve(this, a) | |
} | |
}; | |
Q.prototype.addLinkDataCollection = function(a) { | |
if (u.isArray(a)) { | |
for (var b = u.qb(a), c = 0; c < b; c++) { | |
this.yv(u.ib(a, c)) | |
} | |
} else { | |
for (a = a.i; a.next();) { | |
this.yv(a.value) | |
} | |
} | |
}; | |
Q.prototype.removeLinkData = Q.prototype.Vz = function(a) { | |
if (null !== a) { | |
this.Vl.remove(a); | |
var b = this.Dh.indexOf(a); | |
if (!(0 > b)) { | |
u.Ai(this.Dh, b); | |
Le(this, "linkDataArray", ce, "linkDataArray", this, a, null, b, null); | |
b = this.$k(a); | |
Qe(this, b, a); | |
b = this.cl(a); | |
Qe(this, b, a); | |
var c = this.Pj(a); | |
if (u.isArray(c)) { | |
for (var d = u.qb(c), e = 0; e < d; e++) { | |
b = u.ib(c, e), Qe(this, b, a) | |
} | |
} | |
} | |
} | |
}; | |
Q.prototype.removeLinkDataCollection = function(a) { | |
if (u.isArray(a)) { | |
for (var b = u.qb(a), c = 0; c < b; c++) { | |
this.Vz(u.ib(a, c)) | |
} | |
} else { | |
for (a = a.i; a.next();) { | |
this.Vz(a.value) | |
} | |
} | |
}; | |
function Ve(a, b) { | |
var c = a.$k(b), | |
c = a.Km(c); | |
null === a.sf(c) && Pe(a, c, b); | |
c = a.cl(b); | |
c = a.Km(c); | |
null === a.sf(c) && Pe(a, c, b); | |
var d = a.Pj(b); | |
if (u.isArray(d)) { | |
for (var e = u.qb(d), f = 0; f < e; f++) { | |
c = u.ib(d, f), null === a.sf(c) && Pe(a, c, b) | |
} | |
} | |
} | |
u.defineProperty(Q, { | |
iJ: "copyLinkDataFunction" | |
}, function() { | |
return this.Xt | |
}, function(a) { | |
var b = this.Xt; | |
b !== a && (null !== a && u.j(a, "function", Q, "copyLinkDataFunction"), this.Xt = a, this.h("copyLinkDataFunction", b, a)) | |
}); | |
Q.prototype.copyLinkData = Q.prototype.fD = function(a) { | |
if (null === a) { | |
return null | |
} | |
var b = null, | |
b = this.Xt; | |
if (null !== b) { | |
b = b(a, this) | |
} else { | |
var b = new a.constructor, | |
c; | |
for (c in a) { | |
if ("__gohashid" !== c) { | |
var d = u.sb(a, c); | |
u.Pa(b, c, d) | |
} | |
} | |
} | |
null !== b && (u.gc(b), "" !== this.fj && u.Pa(b, this.fj, void 0), "" !== this.ij && u.Pa(b, this.ij, void 0), "" !== this.Eh && u.Pa(b, this.Eh, [])); | |
return b | |
}; | |
u.defineProperty(Q, { | |
ct: "nodeIsGroupProperty" | |
}, function() { | |
return this.Qu | |
}, function(a) { | |
var b = this.Qu; | |
b !== a && (Me(a, Q, "nodeIsGroupProperty"), this.Qu = a, this.h("nodeIsGroupProperty", b, a)) | |
}); | |
Q.prototype.isGroupForNodeData = Q.prototype.uz = function(a) { | |
if (null === a) { | |
return !1 | |
} | |
var b = this.Qu; | |
return "" === b ? !1 : u.sb(a, b) ? !0 : !1 | |
}; | |
u.defineProperty(Q, { | |
Xo: "nodeGroupKeyProperty" | |
}, function() { | |
return this.pj | |
}, function(a) { | |
var b = this.pj; | |
b !== a && (Me(a, Q, "nodeGroupKeyProperty"), this.pj = a, this.h("nodeGroupKeyProperty", b, a)) | |
}); | |
u.defineProperty(Q, { | |
xm: "copiesGroupKeyOfNodeData" | |
}, function() { | |
return this.sx | |
}, function(a) { | |
this.sx !== a && (u.j(a, "boolean", Q, "copiesGroupKeyOfNodeData"), this.sx = a) | |
}); | |
Q.prototype.getGroupKeyForNodeData = Q.prototype.Fm = function(a) { | |
if (null !== a) { | |
var b = this.pj; | |
if ("" !== b && (b = u.sb(a, b), void 0 !== b)) { | |
if (Ne(b)) { | |
return b | |
} | |
u.k("GroupKey value for node data " + a + " is not a number or a string: " + b) | |
} | |
} | |
}; | |
Q.prototype.setGroupKeyForNodeData = Q.prototype.Hw = function(a, b) { | |
null === b && (b = void 0); | |
void 0 === b || Ne(b) || u.Ld(b, "number or string", Q, "setGroupKeyForNodeData:key"); | |
if (null !== a) { | |
var c = this.pj; | |
if ("" !== c) { | |
if (this.Ve(a)) { | |
var d = u.sb(a, c); | |
d !== b && (Qe(this, d, a), u.Pa(a, c, b), null === this.sf(b) && Pe(this, b, a), Le(this, "nodeGroupKey", $d, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else { | |
u.Pa(a, c, b) | |
} | |
} | |
} | |
}; | |
Q.prototype.copyNodeData = function(a) { | |
if (null === a) { | |
return null | |
} | |
a = J.prototype.copyNodeData.call(this, a); | |
this.xm || "" === this.pj || u.Pa(a, this.pj, void 0); | |
return a | |
}; | |
Q.prototype.setDataProperty = function(a, b, c) { | |
if (this.Ve(a)) { | |
if (b === this.Nm) { | |
this.cA(a, c) | |
} else { | |
if (b === this.Mm) { | |
this.Fw(a, c); | |
return | |
} | |
if (b === this.Xo) { | |
this.Hw(a, c); | |
return | |
} | |
b === this.ct && u.k("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: " + b) | |
} | |
} else { | |
if (this.Di(a)) { | |
if (b === this.Mo) { | |
this.Gw(a, c); | |
return | |
} | |
if (b === this.Oo) { | |
this.Iw(a, c); | |
return | |
} | |
if (b === this.Vs) { | |
this.bA(a, c); | |
return | |
} | |
if (b === this.Xs) { | |
this.fA(a, c); | |
return | |
} | |
if (b === this.Us) { | |
this.FE(a, c); | |
return | |
} | |
if (b === this.Ws) { | |
this.GE(a, c); | |
return | |
} | |
} else { | |
!Ue && a instanceof T && (Ue = !0, u.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), u.trace(" Is that really your intent?")) | |
} | |
} | |
var d = u.sb(a, b); | |
d !== c && (u.Pa(a, b, c), this.Qz(a, b, d, c)) | |
}; | |
g = Q.prototype; | |
g.ht = function(a, b) { | |
J.prototype.ht.call(this, a, b); | |
for (var c = this.sc.i; c.next();) { | |
this.Yz(c.value, a, b) | |
} | |
for (c = this.Vl.i; c.next();) { | |
var d = c.value, | |
e = a, | |
f = b; | |
if (this.$k(d) === e) { | |
var h = this.fj; | |
u.Pa(d, h, f); | |
Le(this, "linkFromKey", $d, h, d, e, f); | |
"string" === typeof h && this.Ob(d, h) | |
} | |
this.cl(d) === e && (h = this.ij, u.Pa(d, h, f), Le(this, "linkToKey", $d, h, d, e, f), "string" === typeof h && this.Ob(d, h)); | |
var k = this.Pj(d); | |
if (u.isArray(k)) { | |
for (var l = u.qb(k), h = this.Eh, m = 0; m < l; m++) { | |
u.ib(k, m) === e && (u.RC(k, m, f), Le(this, "linkLabelKeys", be, h, d, e, f)) | |
} | |
} | |
} | |
}; | |
g.Yz = function(a, b, c) { | |
if (this.Fm(a) === b) { | |
var d = this.pj; | |
u.Pa(a, d, c); | |
Le(this, "nodeGroupKey", $d, d, a, b, c); | |
"string" === typeof d && this.Ob(a, d) | |
} | |
}; | |
g.nA = function() { | |
J.prototype.nA.call(this); | |
for (var a = this.Qj, b = u.qb(a), c = 0; c < b; c++) { | |
var d = u.ib(a, c); | |
Ve(this, d) | |
} | |
}; | |
g.bp = function(a) { | |
J.prototype.bp.call(this, a); | |
a = this.wb(a); | |
var b = Oe(this, a); | |
if (null !== b) { | |
for (var c = new E(Object), b = b.i; b.next();) { | |
var d = b.value; | |
if (this.Ve(d)) { | |
if (this.Fm(d) === a) { | |
var e = this.pj; | |
Le(this, "nodeGroupKey", $d, e, d, a, a); | |
"string" === typeof e && this.Ob(d, e); | |
c.add(d) | |
} | |
} else { | |
this.$k(d) === a && (e = this.fj, Le(this, "linkFromKey", $d, e, d, a, a), "string" === typeof e && this.Ob(d, e), c.add(d)); | |
this.cl(d) === a && (e = this.ij, Le(this, "linkToKey", $d, e, d, a, a), "string" === typeof e && this.Ob(d, e), c.add(d)); | |
var f = this.Pj(d); | |
if (u.isArray(f)) { | |
for (var h = u.qb(f), e = this.Eh, k = 0; k < h; k++) { | |
u.ib(f, k) === a && (Le(this, "linkLabelKeys", be, e, d, a, a), c.add(d)) | |
} | |
} | |
} | |
} | |
for (c = c.i; c.next();) { | |
Qe(this, a, c.value) | |
} | |
} | |
}; | |
g.ap = function(a) { | |
J.prototype.ap.call(this, a); | |
var b = this.Fm(a); | |
null === this.sf(b) && Pe(this, b, a) | |
}; | |
g.At = function(a) { | |
J.prototype.At.call(this, a); | |
var b = this.Fm(a); | |
Qe(this, b, a) | |
}; | |
u.defineProperty(Q, { | |
Us: "linkCategoryProperty" | |
}, function() { | |
return this.Bq | |
}, function(a) { | |
var b = this.Bq; | |
b !== a && (Me(a, Q, "linkCategoryProperty"), this.Bq = a, this.h("linkCategoryProperty", b, a)) | |
}); | |
Q.prototype.getCategoryForLinkData = Q.prototype.Zv = function(a) { | |
if (null === a) { | |
return "" | |
} | |
var b = this.Bq; | |
if ("" === b) { | |
return "" | |
} | |
b = u.sb(a, b); | |
if (void 0 === b) { | |
return "" | |
} | |
if ("string" === typeof b) { | |
return b | |
} | |
u.k("getCategoryForLinkData found a non-string category for " + a + ": " + b); | |
return "" | |
}; | |
Q.prototype.setCategoryForLinkData = Q.prototype.FE = function(a, b) { | |
u.j(b, "string", Q, "setCategoryForLinkData:cat"); | |
if (null !== a) { | |
var c = this.Bq; | |
if ("" === c) { | |
return "" | |
} | |
if (this.Di(a)) { | |
var d = u.sb(a, c); | |
void 0 === d && (d = ""); | |
d !== b && (u.Pa(a, c, b), Le(this, "linkCategory", $d, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else { | |
u.Pa(a, c, b) | |
} | |
} | |
}; | |
function qe(a) { | |
1 < arguments.length && u.k("TreeModel constructor can only take one optional argument, the Array of node data."); | |
J.call(this); | |
this.qj = "parent"; | |
this.tx = !1; | |
this.gr = "parentLinkCategory"; | |
void 0 !== a && (this.dh = a) | |
} | |
u.Ha(qe, J); | |
u.fa("TreeModel", qe); | |
qe.prototype.toString = function(a) { | |
void 0 === a && (a = 0); | |
if (2 <= a) { | |
return this.lA() | |
} | |
var b = ("" !== this.name ? this.name : "") + " TreeModel"; | |
if (0 < a) { | |
b += "\n node data:"; | |
a = this.dh; | |
for (var c = u.qb(a), d = 0; d < c; d++) { | |
var e = u.ib(a, d), | |
b = b + (" " + this.wb(e) + ":" + de(e)) | |
} | |
} | |
return b | |
}; | |
qe.prototype.Bt = function() { | |
var a = J.prototype.Bt.call(this), | |
b = ""; | |
"parent" !== this.Yo && "string" === typeof this.Yo && (b += ',\n "nodeParentKeyProperty": ' + this.quote(this.Yo)); | |
return a + b | |
}; | |
qe.prototype.gt = function(a) { | |
J.prototype.gt.call(this, a); | |
a.nodeParentKeyProperty && (this.Yo = a.nodeParentKeyProperty) | |
}; | |
qe.prototype.Km = function(a) { | |
return a | |
}; | |
u.defineProperty(qe, { | |
Yo: "nodeParentKeyProperty" | |
}, function() { | |
return this.qj | |
}, function(a) { | |
var b = this.qj; | |
b !== a && (Me(a, qe, "nodeParentKeyProperty"), this.qj = a, this.h("nodeParentKeyProperty", b, a)) | |
}); | |
u.defineProperty(qe, { | |
ym: "copiesParentKeyOfNodeData" | |
}, function() { | |
return this.tx | |
}, function(a) { | |
this.tx !== a && (u.j(a, "boolean", qe, "copiesParentKeyOfNodeData"), this.tx = a) | |
}); | |
qe.prototype.getParentKeyForNodeData = qe.prototype.Gm = function(a) { | |
if (null !== a) { | |
var b = this.qj; | |
if ("" !== b && (b = u.sb(a, b), void 0 !== b)) { | |
if (Ne(b)) { | |
return b | |
} | |
u.k("ParentKey value for node data " + a + " is not a number or a string: " + b) | |
} | |
} | |
}; | |
qe.prototype.setParentKeyForNodeData = qe.prototype.kh = function(a, b) { | |
null === b && (b = void 0); | |
void 0 === b || Ne(b) || u.Ld(b, "number or string", qe, "setParentKeyForNodeData:key"); | |
if (null !== a) { | |
var c = this.qj; | |
if ("" !== c) { | |
if (b = this.Km(b), this.Ve(a)) { | |
var d = u.sb(a, c); | |
d !== b && (Qe(this, d, a), u.Pa(a, c, b), null === this.sf(b) && Pe(this, b, a), Le(this, "nodeParentKey", $d, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else { | |
u.Pa(a, c, b) | |
} | |
} | |
} | |
}; | |
u.defineProperty(qe, { | |
oK: "parentLinkCategoryProperty" | |
}, function() { | |
return this.gr | |
}, function(a) { | |
var b = this.gr; | |
b !== a && (Me(a, qe, "parentLinkCategoryProperty"), this.gr = a, this.h("parentLinkCategoryProperty", b, a)) | |
}); | |
qe.prototype.getParentLinkCategoryForNodeData = qe.prototype.IG = function(a) { | |
if (null === a) { | |
return "" | |
} | |
var b = this.gr; | |
if ("" === b) { | |
return "" | |
} | |
b = u.sb(a, b); | |
if (void 0 === b) { | |
return "" | |
} | |
if ("string" === typeof b) { | |
return b | |
} | |
u.k("getParentLinkCategoryForNodeData found a non-string category for " + a + ": " + b); | |
return "" | |
}; | |
qe.prototype.setParentLinkCategoryForNodeData = qe.prototype.jI = function(a, b) { | |
u.j(b, "string", qe, "setParentLinkCategoryForNodeData:cat"); | |
if (null !== a) { | |
var c = this.gr; | |
if ("" === c) { | |
return "" | |
} | |
if (this.Ve(a)) { | |
var d = u.sb(a, c); | |
void 0 === d && (d = ""); | |
d !== b && (u.Pa(a, c, b), Le(this, "parentLinkCategory", $d, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else { | |
u.Pa(a, c, b) | |
} | |
} | |
}; | |
qe.prototype.copyNodeData = function(a) { | |
if (null === a) { | |
return null | |
} | |
a = J.prototype.copyNodeData.call(this, a); | |
this.ym || "" === this.qj || u.Pa(a, this.qj, void 0); | |
return a | |
}; | |
qe.prototype.setDataProperty = function(a, b, c) { | |
if (this.Ve(a)) { | |
if (b === this.Nm) { | |
this.cA(a, c) | |
} else { | |
if (b === this.Mm) { | |
this.Fw(a, c); | |
return | |
} | |
if (b === this.Yo) { | |
this.kh(a, c); | |
return | |
} | |
} | |
} else { | |
!Ue && a instanceof T && (Ue = !0, u.trace('TreeModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), u.trace(" Is that really your intent?")) | |
} | |
var d = u.sb(a, b); | |
d !== c && (u.Pa(a, b, c), this.Qz(a, b, d, c)) | |
}; | |
g = qe.prototype; | |
g.ht = function(a, b) { | |
J.prototype.ht.call(this, a, b); | |
for (var c = this.sc.i; c.next();) { | |
this.Yz(c.value, a, b) | |
} | |
}; | |
g.Yz = function(a, b, c) { | |
if (this.Gm(a) === b) { | |
var d = this.qj; | |
u.Pa(a, d, c); | |
Le(this, "nodeParentKey", $d, d, a, b, c); | |
"string" === typeof d && this.Ob(a, d) | |
} | |
}; | |
g.bp = function(a) { | |
J.prototype.bp.call(this, a); | |
a = this.wb(a); | |
var b = Oe(this, a); | |
if (null !== b) { | |
for (var c = new E(Object), b = b.i; b.next();) { | |
var d = b.value; | |
if (this.Ve(d) && this.Gm(d) === a) { | |
var e = this.qj; | |
Le(this, "nodeParentKey", $d, e, d, a, a); | |
"string" === typeof e && this.Ob(d, e); | |
c.add(d) | |
} | |
} | |
for (c = c.i; c.next();) { | |
Qe(this, a, c.value) | |
} | |
} | |
}; | |
g.ap = function(a) { | |
J.prototype.ap.call(this, a); | |
var b = this.Gm(a), | |
b = this.Km(b); | |
null === this.sf(b) && Pe(this, b, a) | |
}; | |
g.At = function(a) { | |
J.prototype.At.call(this, a); | |
var b = this.Gm(a); | |
Qe(this, b, a) | |
}; | |
function bf(a, b, c) { | |
u.gc(this); | |
this.Ea = !1; | |
void 0 === a ? a = "" : u.j(a, "string", bf, "constructor:targetprop"); | |
void 0 === b ? b = a : u.j(b, "string", bf, "constructor:sourceprop"); | |
void 0 === c ? c = null : null !== c && u.j(c, "function", bf, "constructor:conv"); | |
this.mC = -1; | |
this.hg = null; | |
this.qv = a; | |
this.ov = this.By = 0; | |
this.hC = null; | |
this.Gy = !1; | |
this.hv = b; | |
this.ox = c; | |
this.gy = cf; | |
this.ix = null | |
} | |
u.fa("Binding", bf); | |
var cf; | |
bf.OneWay = cf = u.s(bf, "OneWay", 1); | |
var df; | |
bf.TwoWay = df = u.s(bf, "TwoWay", 2); | |
bf.parseEnum = function(a, b) { | |
u.j(a, "function", bf, "parseEnum:ctor"); | |
u.rb(b, a, bf, "parseEnum:defval"); | |
return function(c) { | |
c = Da(a, c); | |
return null === c ? b : c | |
} | |
}; | |
var de; | |
bf.toString = de = function(a) { | |
var b = a; | |
u.Ta(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() | |
}; | |
bf.prototype.toString = function() { | |
return "Binding(" + this.Nw + ":" + this.LE + (-1 !== this.ul ? " " + this.ul : "") + " " + this.mode.name + ")" | |
}; | |
bf.prototype.freeze = function() { | |
this.Ea = !0; | |
return this | |
}; | |
bf.prototype.Ma = function() { | |
this.Ea = !1; | |
return this | |
}; | |
u.defineProperty(bf, { | |
ul: null | |
}, function() { | |
return this.mC | |
}, function(a) { | |
u.J(this); | |
u.j(a, "number", bf, "targetId"); | |
this.mC = a | |
}); | |
u.defineProperty(bf, { | |
Nw: "targetProperty" | |
}, function() { | |
return this.qv | |
}, function(a) { | |
u.J(this); | |
u.j(a, "string", bf, "targetProperty"); | |
this.qv = a | |
}); | |
u.defineProperty(bf, { | |
Rm: "sourceName" | |
}, function() { | |
return this.hC | |
}, function(a) { | |
u.J(this); | |
null !== a && u.j(a, "string", bf, "sourceName"); | |
this.hC = a; | |
null !== a && (this.Gy = !1) | |
}); | |
u.defineProperty(bf, { | |
yt: "toModel" | |
}, function() { | |
return this.Gy | |
}, function(a) { | |
u.J(this); | |
u.j(a, "boolean", bf, "toModel"); | |
this.Gy = a | |
}); | |
u.defineProperty(bf, { | |
LE: "sourceProperty" | |
}, function() { | |
return this.hv | |
}, function(a) { | |
u.J(this); | |
u.j(a, "string", bf, "sourceProperty"); | |
this.hv = a | |
}); | |
u.defineProperty(bf, { | |
fG: "converter" | |
}, function() { | |
return this.ox | |
}, function(a) { | |
u.J(this); | |
null !== a && u.j(a, "function", bf, "converter"); | |
this.ox = a | |
}); | |
u.defineProperty(bf, { | |
TF: "backConverter" | |
}, function() { | |
return this.ix | |
}, function(a) { | |
u.J(this); | |
null !== a && u.j(a, "function", bf, "backConverter"); | |
this.ix = a | |
}); | |
u.defineProperty(bf, { | |
mode: "mode" | |
}, function() { | |
return this.gy | |
}, function(a) { | |
u.J(this); | |
u.rb(a, bf, bf, "mode"); | |
this.gy = a | |
}); | |
bf.prototype.makeTwoWay = function(a) { | |
void 0 === a && (a = null); | |
null !== a && u.j(a, "function", bf, "makeTwoWay"); | |
this.mode = df; | |
this.TF = a; | |
return this | |
}; | |
bf.prototype.ofObject = bf.prototype.tw = function(a) { | |
void 0 === a && (a = ""); | |
this.Rm = a; | |
this.yt = !1; | |
return this | |
}; | |
bf.prototype.ofModel = function() { | |
this.Rm = null; | |
this.yt = !0; | |
return this | |
}; | |
bf.prototype.ofData = function() { | |
this.Rm = null; | |
this.yt = !1; | |
return this | |
}; | |
function ef(a, b, c) { | |
a = a.Rm; | |
var d = null; | |
return d = null === a || "" === a ? b : "." === a ? c : ".." === a ? c.P : b.ke(a) | |
} | |
bf.prototype.updateTarget = bf.prototype.ZE = function(a, b, c) { | |
var d = this.hv; | |
if (void 0 === c || d === c) { | |
c = this.qv; | |
var e = this.ox; | |
if (null === e && "" === c) { | |
u.trace("Binding error: target property is the empty string: " + this.toString()) | |
} else { | |
var f = b; | |
"" !== d && (f = u.sb(b, d)); | |
if (void 0 !== f) { | |
if (null === e) { | |
"" !== c && u.Pa(a, c, f) | |
} else { | |
try { | |
if ("" !== c) { | |
var h = e(f, a); | |
u.Pa(a, c, h) | |
} else { | |
e(f, a) | |
} | |
} catch (k) {} | |
} | |
} | |
} | |
} | |
}; | |
bf.prototype.updateSource = bf.prototype.Ow = function(a, b, c, d) { | |
void 0 === d && (d = null); | |
if (this.gy === df) { | |
var e = this.qv; | |
if (void 0 === c || e === c) { | |
c = this.hv; | |
var f = this.ix; | |
if (null !== f || "" !== c) { | |
var h = a; | |
"" !== e && (h = u.sb(a, e)); | |
if (void 0 !== h) { | |
if (null === f) { | |
null !== d && d.ha ? d.ha.setDataProperty(b, c, h) : u.Pa(b, c, h) | |
} else { | |
try { | |
if ("" !== c) { | |
var k = f(h, b); | |
null !== d && d.ha ? d.ha.setDataProperty(b, c, k) : u.Pa(b, c, k) | |
} else { | |
f(h, b) | |
} | |
} catch (l) {} | |
} | |
} | |
} | |
} | |
} | |
}; | |
function Ke() { | |
this.mF = (new E(Od)).freeze(); | |
this.Vb = ""; | |
this.nB = !1 | |
} | |
u.fa("Transaction", Ke); | |
Ke.prototype.toString = function(a) { | |
var b = "Transaction: " + this.name + " " + this.Wg.count.toString() + (this.Ns ? "" : ", incomplete"); | |
if (void 0 !== a && 0 < a) { | |
a = this.Wg.count; | |
for (var c = 0; c < a; c++) { | |
var d = this.Wg.ja(c); | |
null !== d && (b += "\n " + d.toString()) | |
} | |
} | |
return b | |
}; | |
Ke.prototype.clear = Ke.prototype.clear = function() { | |
var a = this.Wg; | |
a.Ma(); | |
for (var b = a.count - 1; 0 <= b; b--) { | |
var c = a.ja(b); | |
null !== c && c.clear() | |
} | |
a.clear(); | |
a.freeze() | |
}; | |
Ke.prototype.canUndo = Ke.prototype.canUndo = function() { | |
return this.Ns | |
}; | |
Ke.prototype.undo = Ke.prototype.undo = function() { | |
if (this.canUndo()) { | |
for (var a = this.Wg.count - 1; 0 <= a; a--) { | |
var b = this.Wg.ja(a); | |
null !== b && b.undo() | |
} | |
} | |
}; | |
Ke.prototype.canRedo = Ke.prototype.canRedo = function() { | |
return this.Ns | |
}; | |
Ke.prototype.redo = Ke.prototype.redo = function() { | |
if (this.canRedo()) { | |
for (var a = this.Wg.count, b = 0; b < a; b++) { | |
var c = this.Wg.ja(b); | |
null !== c && c.redo() | |
} | |
} | |
}; | |
u.u(Ke, { | |
Wg: "changes" | |
}, function() { | |
return this.mF | |
}); | |
u.defineProperty(Ke, { | |
name: "name" | |
}, function() { | |
return this.Vb | |
}, function(a) { | |
this.Vb = a | |
}); | |
u.defineProperty(Ke, { | |
Ns: "isComplete" | |
}, function() { | |
return this.nB | |
}, function(a) { | |
this.nB = a | |
}); | |
function ee() { | |
this.iy = new F(J); | |
this.Oe = !1; | |
this.tF = (new E(Ke)).freeze(); | |
this.Kg = -1; | |
this.CB = 999; | |
this.gi = !1; | |
this.cu = null; | |
this.Jk = 0; | |
this.GA = !1; | |
this.Qg = (new E("string")).freeze(); | |
this.Sn = new E("number"); | |
this.Mx = !0; | |
this.Zx = !1 | |
} | |
u.fa("UndoManager", ee); | |
ee.prototype.toString = function(a) { | |
for (var b = "UndoManager " + this.Ji + "<" + this.history.count + "<=" + this.WD, b = b + "[", c = this.cE.count, d = 0; d < c; d++) { | |
0 < d && (b += " "), b += this.cE.ja(d) | |
} | |
b += "]"; | |
if (void 0 !== a && 0 < a) { | |
for (c = this.history.count, d = 0; d < c; d++) { | |
b += "\n " + this.history.ja(d).toString(a - 1) | |
} | |
} | |
return b | |
}; | |
ee.prototype.clear = ee.prototype.clear = function() { | |
var a = this.history; | |
a.Ma(); | |
for (var b = a.count - 1; 0 <= b; b--) { | |
var c = a.ja(b); | |
null !== c && c.clear() | |
} | |
a.clear(); | |
this.Kg = -1; | |
a.freeze(); | |
this.gi = !1; | |
this.cu = null; | |
this.Jk = 0; | |
this.Qg.Ma(); | |
this.Qg.clear(); | |
this.Qg.freeze(); | |
this.Sn.clear() | |
}; | |
ee.prototype.addModel = ee.prototype.NF = function(a) { | |
this.iy.add(a) | |
}; | |
ee.prototype.removeModel = ee.prototype.UH = function(a) { | |
this.iy.remove(a) | |
}; | |
ee.prototype.startTransaction = ee.prototype.Xb = function(a) { | |
void 0 === a && (a = ""); | |
null === a && (a = ""); | |
if (this.fb) { | |
return !1 | |
}!0 === this.Mx && (this.Mx = !1, this.Jk++, this.Rc("StartingFirstTransaction", a, this.Ei), 0 < this.Jk && this.Jk--); | |
this.isEnabled && (this.Qg.Ma(), this.Qg.add(a), this.Qg.freeze(), null === this.Ei ? this.Sn.add(0) : this.Sn.add(this.Ei.Wg.count)); | |
this.Jk++; | |
var b = 1 === this.Me; | |
b && this.Rc("StartedTransaction", a, this.Ei); | |
return b | |
}; | |
ee.prototype.commitTransaction = ee.prototype.Xd = function(a) { | |
void 0 === a && (a = ""); | |
return ff(this, !0, a) | |
}; | |
ee.prototype.rollbackTransaction = ee.prototype.cp = function() { | |
return ff(this, !1, "") | |
}; | |
function ff(a, b, c) { | |
if (a.fb) { | |
return !1 | |
} | |
a.Ty && 1 > a.Me && u.trace("Ending transaction without having started a transaction: " + c); | |
var d = 1 === a.Me; | |
d && b && a.isEnabled && a.Rc("CommittingTransaction", c, a.Ei); | |
var e = 0; | |
if (0 < a.Me && (a.Jk--, a.isEnabled)) { | |
var f = a.Qg.count; | |
0 < f && ("" === c && (c = a.Qg.ja(0)), a.Qg.Ma(), a.Qg.kd(f - 1), a.Qg.freeze()); | |
f = a.Sn.count; | |
0 < f && (e = a.Sn.ja(f - 1), a.Sn.kd(f - 1)) | |
} | |
f = a.Ei; | |
if (d) { | |
if (b) { | |
a.Zx = !1; | |
if (a.isEnabled && null !== f) { | |
b = f; | |
b.Ns = !0; | |
b.name = c; | |
d = a.history; | |
d.Ma(); | |
for (e = d.count - 1; e > a.Ji; e--) { | |
f = d.ja(e), null !== f && f.clear(), d.kd(e), a.Zx = !0 | |
} | |
e = a.WD; | |
0 === e && (e = 1); | |
0 < e && d.count >= e && (f = d.ja(0), null !== f && f.clear(), d.kd(0), a.Kg--); | |
d.add(b); | |
a.Kg++; | |
d.freeze(); | |
f = b | |
} | |
a.Rc("CommittedTransaction", c, f) | |
} else { | |
a.gi = !0; | |
try { | |
a.isEnabled && null !== f && (f.Ns = !0, f.undo()) | |
} finally { | |
a.Rc("RolledBackTransaction", c, f), a.gi = !1 | |
} | |
null !== f && f.clear() | |
} | |
a.cu = null; | |
return !0 | |
} | |
if (a.isEnabled && !b && null !== f) { | |
a = e; | |
c = f.Wg; | |
for (b = c.count - 1; b >= a; b--) { | |
d = c.ja(b), null !== d && d.undo(), c.Ma(), c.kd(b) | |
} | |
c.freeze() | |
} | |
return !1 | |
} | |
ee.prototype.canUndo = ee.prototype.canUndo = function() { | |
if (!this.isEnabled || 0 < this.Me || this.fb) { | |
return !1 | |
} | |
var a = this.UE; | |
return null !== a && a.canUndo() ? !0 : !1 | |
}; | |
ee.prototype.undo = ee.prototype.undo = function() { | |
if (this.canUndo()) { | |
var a = this.UE; | |
try { | |
this.Rc("StartingUndo", "Undo", a), this.gi = !0, this.Kg--, a.undo() | |
} catch (b) { | |
u.trace("undo error: " + b.toString()) | |
} finally { | |
this.gi = !1, this.Rc("FinishedUndo", "Undo", a) | |
} | |
} | |
}; | |
ee.prototype.canRedo = ee.prototype.canRedo = function() { | |
if (!this.isEnabled || 0 < this.Me || this.fb) { | |
return !1 | |
} | |
var a = this.TE; | |
return null !== a && a.canRedo() ? !0 : !1 | |
}; | |
ee.prototype.redo = ee.prototype.redo = function() { | |
if (this.canRedo()) { | |
var a = this.TE; | |
try { | |
this.Rc("StartingRedo", "Redo", a), this.gi = !0, this.Kg++, a.redo() | |
} catch (b) { | |
u.trace("redo error: " + b.toString()) | |
} finally { | |
this.gi = !1, this.Rc("FinishedRedo", "Redo", a) | |
} | |
} | |
}; | |
ee.prototype.Rc = function(a, b, c) { | |
void 0 === c && (c = null); | |
var d = new Od; | |
d.Cd = ae; | |
d.propertyName = a; | |
d.object = c; | |
d.oldValue = b; | |
for (a = this.DH; a.next();) { | |
b = a.value, d.ha = b, b.Kv(d) | |
} | |
}; | |
ee.prototype.handleChanged = ee.prototype.ED = function(a) { | |
if (this.isEnabled && !this.fb && !this.skipsEvent(a)) { | |
var b = this.Ei; | |
null === b && (this.cu = b = new Ke); | |
var c = a.copy(), | |
b = b.Wg; | |
b.Ma(); | |
b.add(c); | |
b.freeze(); | |
this.Ty && 0 >= this.Me && !this.Mx && (a = a.g, null !== a && !1 === a.nf || u.trace("Change not within a transaction: " + c.toString())) | |
} | |
}; | |
ee.prototype.skipsEvent = function(a) { | |
if (null === a || 0 > a.Cd.value) { | |
return !0 | |
} | |
a = a.object; | |
if (a instanceof T) { | |
if (a = a.layer, null !== a && a.zc) { | |
return !0 | |
} | |
} else { | |
if (a instanceof we && a.zc) { | |
return !0 | |
} | |
} | |
return !1 | |
}; | |
u.u(ee, { | |
DH: "models" | |
}, function() { | |
return this.iy.i | |
}); | |
u.defineProperty(ee, { | |
isEnabled: "isEnabled" | |
}, function() { | |
return this.Oe | |
}, function(a) { | |
this.Oe = a | |
}); | |
u.u(ee, { | |
UE: "transactionToUndo" | |
}, function() { | |
return 0 <= this.Ji && this.Ji <= this.history.count - 1 ? this.history.ja(this.Ji) : null | |
}); | |
u.u(ee, { | |
TE: "transactionToRedo" | |
}, function() { | |
return this.Ji < this.history.count - 1 ? this.history.ja(this.Ji + 1) : null | |
}); | |
u.u(ee, { | |
fb: "isUndoingRedoing" | |
}, function() { | |
return this.gi | |
}); | |
u.u(ee, { | |
history: "history" | |
}, function() { | |
return this.tF | |
}); | |
u.defineProperty(ee, { | |
WD: "maxHistoryLength" | |
}, function() { | |
return this.CB | |
}, function(a) { | |
this.CB = a | |
}); | |
u.u(ee, { | |
Ji: "historyIndex" | |
}, function() { | |
return this.Kg | |
}); | |
u.u(ee, { | |
Ei: "currentTransaction" | |
}, function() { | |
return this.cu | |
}); | |
u.u(ee, { | |
Me: "transactionLevel" | |
}, function() { | |
return this.Jk | |
}); | |
u.u(ee, { | |
OD: "isInTransaction" | |
}, function() { | |
return 0 < this.Jk | |
}); | |
u.defineProperty(ee, { | |
Ty: "checksTransactionLevel" | |
}, function() { | |
return this.GA | |
}, function(a) { | |
this.GA = a | |
}); | |
u.u(ee, { | |
cE: "nestedTransactionNames" | |
}, function() { | |
return this.Qg | |
}); | |
function sa() { | |
0 < arguments.length && u.Xc(sa); | |
u.gc(this); | |
this.Y = null; | |
this.JA = !0; | |
this.LA = this.MA = this.XA = this.NA = !1; | |
this.Ak = this.ex = null; | |
this.EC = 1.05; | |
this.VA = 1; | |
this.$x = NaN; | |
this.zB = null; | |
this.FC = NaN | |
} | |
u.fa("CommandHandler", sa); | |
var gf = null, | |
hf = ""; | |
sa.prototype.toString = function() { | |
return "CommandHandler" | |
}; | |
u.u(sa, { | |
g: "diagram" | |
}, function() { | |
return this.Y | |
}); | |
sa.prototype.Dc = function(a) { | |
this.Y = a | |
}; | |
sa.prototype.doKeyDown = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.N, | |
c = u.Im ? b.Zs : b.control, | |
d = b.shift, | |
e = b.alt, | |
f = b.key; | |
!c || "C" !== f && "Insert" !== f ? c && "X" === f || d && "Del" === f ? this.canCutSelection() && this.cutSelection() : c && "V" === f || d && "Insert" === f ? this.canPasteSelection() && this.pasteSelection() : c && "Y" === f || e && d && "Backspace" === f ? this.canRedo() && this.redo() : c && "Z" === f || e && "Backspace" === f ? this.canUndo() && this.undo() : "Del" === f || "Backspace" === f ? this.canDeleteSelection() && this.deleteSelection() : c && "A" === f ? this.canSelectAll() && this.selectAll() : "Esc" === f ? this.canStopCommand() && this.stopCommand() : "Up" === f ? a.Te && (c ? a.scroll("pixel", "up") : a.scroll("line", "up")) : "Down" === f ? a.Te && (c ? a.scroll("pixel", "down") : a.scroll("line", "down")) : "Left" === f ? a.Se && (c ? a.scroll("pixel", "left") : a.scroll("line", "left")) : "Right" === f ? a.Se && (c ? a.scroll("pixel", "right") : a.scroll("line", "right")) : "PageUp" === f ? d && a.Se ? a.scroll("page", "left") : a.Te && a.scroll("page", "up") : "PageDown" === f ? d && a.Se ? a.scroll("page", "right") : a.Te && a.scroll("page", "down") : "Home" === f ? (b = a.Ed, c && a.Te ? a.position = new w(a.position.x, b.y) : !c && a.Se && (a.position = new w(b.x, a.position.y))) : "End" === f ? (b = a.Ed, d = a.ob, c && a.Te ? a.position = new w(d.x, b.bottom - d.height) : !c && a.Se && (a.position = new w(b.right - d.width, d.y))) : "Subtract" === f ? this.canDecreaseZoom() && this.decreaseZoom() : "Add" === f ? this.canIncreaseZoom() && this.increaseZoom() : c && "0" === f ? this.canResetZoom() && this.resetZoom() : d && "Z" === f ? this.canZoomToFit() && this.zoomToFit() : c && !d && "G" === f ? this.canGroupSelection() && this.groupSelection() : c && d && "G" === f ? this.canUngroupSelection() && this.ungroupSelection() : b.event && 113 === b.event.which ? this.canEditTextBlock() && this.editTextBlock() : b.event && 93 === b.event.which ? this.canShowContextMenu() && this.showContextMenu() : b.bubbles = !0 : this.canCopySelection() && this.copySelection() | |
} | |
}; | |
sa.prototype.doKeyUp = function() { | |
var a = this.g; | |
null !== a && (a.N.bubbles = !0) | |
}; | |
sa.prototype.stopCommand = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.Va; | |
b instanceof jf && a.qf && a.Mv(); | |
null !== b && b.doCancel() | |
} | |
}; | |
sa.prototype.canStopCommand = function() { | |
return !0 | |
}; | |
sa.prototype.selectAll = function() { | |
var a = this.g; | |
if (null !== a) { | |
a.na(); | |
try { | |
a.bc = "wait"; | |
a.Ba("ChangingSelection"); | |
for (var b = a.Sj; b.next();) { | |
b.value.$a = !0 | |
} | |
for (var c = a.Ag; c.next();) { | |
c.value.$a = !0 | |
} | |
for (var d = a.links; d.next();) { | |
d.value.$a = !0 | |
} | |
} finally { | |
a.Ba("ChangedSelection"), a.bc = "" | |
} | |
} | |
}; | |
sa.prototype.canSelectAll = function() { | |
var a = this.g; | |
return null !== a && a.qf | |
}; | |
sa.prototype.deleteSelection = function() { | |
var a = this.g; | |
if (null !== a && !a.Ba("SelectionDeleting", a.selection)) { | |
try { | |
a.bc = "wait"; | |
a.Xb("Delete"); | |
a.Ba("ChangingSelection"); | |
for (var b = new F(G), c = a.selection.i; c.next();) { | |
kf(b, c.value, !0, this.rG ? Infinity : 0, !0, function(a) { | |
return a.canDelete() | |
}) | |
} | |
a.Xz(b, !0); | |
a.Ba("SelectionDeleted", b) | |
} finally { | |
a.Ba("ChangedSelection"), a.Xd("Delete"), a.bc = "" | |
} | |
} | |
}; | |
sa.prototype.canDeleteSelection = function() { | |
var a = this.g; | |
return null === a || a.nb || a.vf || !a.pm || 0 === a.selection.count ? !1 : !0 | |
}; | |
function kf(a, b, c, d, e, f) { | |
void 0 === f && (f = null); | |
if (!(a.contains(b) || null !== f && !f(b) || b instanceof lf)) { | |
if (a.add(b), b instanceof U) { | |
if (c && b instanceof V) { | |
for (var h = b.Lc; h.next();) { | |
kf(a, h.value, c, d, e, f) | |
} | |
} | |
if (e) { | |
for (h = b.pe; h.next();) { | |
var k = h.value; | |
if (!a.contains(k)) { | |
var l = k.V, | |
m = k.ba; | |
null !== l && a.contains(l) && null !== m && a.contains(m) ? kf(a, k, c, d, e, f) : null !== l && null !== m || kf(a, k, c, d, e, f) | |
} | |
} | |
} | |
if (1 < d) { | |
for (b = b.uD(); b.next();) { | |
kf(a, b.value, c, d - 1, e, f) | |
} | |
} | |
} else { | |
if (b instanceof W) { | |
for (h = b.wg; h.next();) { | |
kf(a, h.value, c, d, e, f) | |
} | |
} | |
} | |
} | |
} | |
sa.prototype.vo = function(a, b, c) { | |
var d = new la(G, G); | |
for (a = a.i; a.next();) { | |
mf(this, a.value, b, d, c) | |
} | |
if (null !== b) { | |
c = b.ha; | |
a = !1; | |
null !== b.tb.Gd && (a = b.tb.Gd.Hi); | |
for (var e = new F(W), f = new la(W, W), h = d.i; h.next();) { | |
var k = h.value; | |
if (k instanceof W) { | |
var l = k; | |
a || null !== l.V && null !== l.ba || e.add(l) | |
} else { | |
if (c instanceof qe && k instanceof U && null !== k.data) { | |
var l = c, | |
m = k, | |
k = h.key, | |
n = k.Dm(); | |
null !== n && (n = d.ua(n), null !== n ? (l.kh(m.data, l.wb(n.data)), l = b.pg(m.data), k = k.Bs(), null !== k && null !== l && f.add(k, l)) : l.kh(m.data, void 0)) | |
} | |
} | |
} | |
0 < e.count && b.Xz(e, !1); | |
if (0 < f.count) { | |
for (b = f.i; b.next();) { | |
d.add(b.key, b.value) | |
} | |
} | |
} | |
for (b = d.i; b.next();) { | |
b.value.Ob() | |
} | |
return d | |
}; | |
function mf(a, b, c, d, e) { | |
if (null === b || e && !b.canCopy()) { | |
return null | |
} | |
if (d.contains(b)) { | |
return d.ua(b) | |
} | |
var f = null, | |
h = b.data; | |
if (null !== h && null !== c) { | |
var k = c.ha; | |
b instanceof W ? k instanceof Q && (h = k.fD(h), u.Ta(h) && (k.yv(h), f = c.pg(h))) : (h = k.copyNodeData(h), u.Ta(h) && (k.om(h), f = c.Ph(h))) | |
} else { | |
nf(b), f = b.copy(), null !== c && null !== f && c.add(f) | |
} | |
if (!(f instanceof G)) { | |
return null | |
} | |
f.$a = !1; | |
f.Yg = !1; | |
d.add(b, f); | |
if (b instanceof U) { | |
for (k = b.pe; k.next();) { | |
h = k.value; | |
if (h.V === b) { | |
var l = d.ua(h); | |
null !== l && (l.V = f) | |
} | |
h.ba === b && (l = d.ua(h), null !== l && (l.ba = f)) | |
} | |
if (b instanceof V && f instanceof V) { | |
for (k = f, b = b.Lc; b.next();) { | |
h = mf(a, b.value, c, d, e), h instanceof W || null === h || (h.Sa = k) | |
} | |
} | |
} else { | |
if (b instanceof W) { | |
for (k = b.V, null !== k && (k = d.ua(k), null !== k && (f.V = k)), k = b.ba, null !== k && (k = d.ua(k), null !== k && (f.ba = k)), b = b.wg; b.next();) { | |
k = mf(a, b.value, c, d, e), null !== k && (k.de = f) | |
} | |
} | |
} | |
return f | |
} | |
sa.prototype.copySelection = function() { | |
var a = this.g; | |
if (null !== a) { | |
for (var b = new F(G), a = a.selection.i; a.next();) { | |
kf(b, a.value, !0, this.iG ? Infinity : 0, this.gG, function(a) { | |
return a.canCopy() | |
}) | |
} | |
this.copyToClipboard(b) | |
} | |
}; | |
sa.prototype.canCopySelection = function() { | |
var a = this.g; | |
return null !== a && a.Ij && a.Oy && 0 !== a.selection.count ? !0 : !1 | |
}; | |
sa.prototype.cutSelection = function() { | |
this.copySelection(); | |
this.deleteSelection() | |
}; | |
sa.prototype.canCutSelection = function() { | |
var a = this.g; | |
return null !== a && !a.nb && !a.vf && a.Ij && a.pm && a.Oy && 0 !== a.selection.count ? !0 : !1 | |
}; | |
sa.prototype.copyToClipboard = function(a) { | |
var b = this.g; | |
if (null !== b) { | |
var c = null; | |
if (null === a) { | |
gf = null, hf = "" | |
} else { | |
var c = b.ha, | |
d = !1, | |
e = !1, | |
f = null; | |
try { | |
if (c instanceof qe) { | |
var h = c, | |
d = h.ym; | |
h.ym = this.eD | |
} | |
c instanceof Q && (h = c, e = h.xm, h.xm = this.dD); | |
f = b.vo(a, null, !0) | |
} finally { | |
c instanceof qe && (c.ym = d), c instanceof Q && (c.xm = e), c = new E(G), c.Ud(f), gf = c, hf = b.ha.Sk | |
} | |
} | |
b.Ba("ClipboardChanged", c) | |
} | |
}; | |
sa.prototype.pasteFromClipboard = function() { | |
var a = new F(G), | |
b = gf; | |
if (null === b) { | |
return a | |
} | |
var c = this.g; | |
if (null === c || hf !== c.ha.Sk) { | |
return a | |
} | |
var d = c.ha, | |
e = !1, | |
f = !1, | |
h = null; | |
try { | |
if (d instanceof qe) { | |
var k = d, | |
e = k.ym; | |
k.ym = this.eD | |
} | |
d instanceof Q && (k = d, f = k.xm, k.xm = this.dD); | |
h = c.vo(b, c, !1) | |
} finally { | |
for (d instanceof qe && (d.ym = e), d instanceof Q && (d.xm = f), b = h.i; b.next();) { | |
c = b.value, d = b.key, c.location.I() || (d.location.I() ? c.location = d.location : !c.position.I() && d.position.I() && (c.position = d.position)), a.add(c) | |
} | |
} | |
return a | |
}; | |
sa.prototype.pasteSelection = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null !== b) { | |
try { | |
b.bc = "wait"; | |
b.Xb("Paste"); | |
b.Ba("ChangingSelection"); | |
var c = this.pasteFromClipboard(); | |
0 < c.count && of (b); | |
for (var d = c.i; d.next();) { | |
d.value.$a = !0 | |
} | |
b.Ba("ChangedSelection"); | |
if (null !== a) { | |
var e = b.computePartsBounds(b.selection); | |
if (e) { | |
var f = b.tb.Gd; | |
null === f && (f = new uf, f.Dc(b)); | |
var h = f.computeEffectiveCollection(b.selection); | |
f.moveParts(h, new w(a.x - e.ma, a.y - e.ya), !1) | |
} | |
} | |
b.Ba("ClipboardPasted", c) | |
} finally { | |
b.Xd("Paste"), b.bc = "" | |
} | |
} | |
}; | |
sa.prototype.canPasteSelection = function() { | |
var a = this.g; | |
return null === a || a.nb || a.vf || !a.no || !a.Oy || null === gf || hf !== a.ha.Sk ? !1 : !0 | |
}; | |
sa.prototype.undo = function() { | |
var a = this.g; | |
null !== a && a.ga.undo() | |
}; | |
sa.prototype.canUndo = function() { | |
var a = this.g; | |
return null === a || a.nb || a.vf ? !1 : a.NC && a.ga.canUndo() | |
}; | |
sa.prototype.redo = function() { | |
var a = this.g; | |
null !== a && a.ga.redo() | |
}; | |
sa.prototype.canRedo = function() { | |
var a = this.g; | |
return null === a || a.nb || a.vf ? !1 : a.NC && a.ga.canRedo() | |
}; | |
sa.prototype.decreaseZoom = function(a) { | |
void 0 === a && (a = 1 / this.Qw); | |
u.Be(a, sa, "decreaseZoom:factor"); | |
var b = this.g; | |
null !== b && b.po === vf && (a *= b.scale, a < b.$g || a > b.Zg || (b.scale = a)) | |
}; | |
sa.prototype.canDecreaseZoom = function(a) { | |
void 0 === a && (a = 1 / this.Qw); | |
u.Be(a, sa, "canDecreaseZoom:factor"); | |
var b = this.g; | |
if (null === b || b.po !== vf) { | |
return !1 | |
} | |
a *= b.scale; | |
return a < b.$g || a > b.Zg ? !1 : b.Hv | |
}; | |
sa.prototype.increaseZoom = function(a) { | |
void 0 === a && (a = this.Qw); | |
u.Be(a, sa, "increaseZoom:factor"); | |
var b = this.g; | |
null !== b && b.po === vf && (a *= b.scale, a < b.$g || a > b.Zg || (b.scale = a)) | |
}; | |
sa.prototype.canIncreaseZoom = function(a) { | |
void 0 === a && (a = this.Qw); | |
u.Be(a, sa, "canIncreaseZoom:factor"); | |
var b = this.g; | |
if (null === b || b.po !== vf) { | |
return !1 | |
} | |
a *= b.scale; | |
return a < b.$g || a > b.Zg ? !1 : b.Hv | |
}; | |
sa.prototype.resetZoom = function(a) { | |
void 0 === a && (a = this.Pv); | |
u.Be(a, sa, "resetZoom:newscale"); | |
var b = this.g; | |
null === b || a < b.$g || a > b.Zg || (b.scale = a) | |
}; | |
sa.prototype.canResetZoom = function(a) { | |
void 0 === a && (a = this.Pv); | |
u.Be(a, sa, "canResetZoom:newscale"); | |
var b = this.g; | |
return null === b || a < b.$g || a > b.Zg ? !1 : b.Hv | |
}; | |
sa.prototype.zoomToFit = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.scale, | |
c = a.position; | |
b !== this.FC || isNaN(this.$x) ? (this.$x = b, this.zB = c.copy(), a.zoomToFit(), a.df(), this.FC = a.scale) : (a.scale = this.$x, a.position = this.zB) | |
} | |
}; | |
sa.prototype.canZoomToFit = function() { | |
var a = this.g; | |
return null === a ? !1 : a.Hv | |
}; | |
sa.prototype.collapseTree = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b) { | |
return !1 | |
} | |
try { | |
b.Xb("Collapse Tree"); | |
var c = new E(U); | |
if (null !== a && a.Wc) { | |
a.collapseTree(), c.add(a) | |
} else { | |
for (var d = b.selection.i; d.next();) { | |
var e = d.value; | |
e instanceof U && (a = e, a.Wc && (a.collapseTree(), c.add(a))) | |
} | |
} | |
b.Ba("TreeCollapsed", c) | |
} finally { | |
b.Xd("Collapse Tree") | |
} | |
}; | |
sa.prototype.canCollapseTree = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b || b.nb) { | |
return !1 | |
} | |
if (null !== a) { | |
if (!a.Wc) { | |
return !1 | |
} | |
if (0 < a.Yv().count) { | |
return !0 | |
} | |
} else { | |
for (a = b.selection.i; a.next();) { | |
if (b = a.value, b instanceof U && b.Wc && 0 < b.Yv().count) { | |
return !0 | |
} | |
} | |
} | |
return !1 | |
}; | |
sa.prototype.expandTree = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b) { | |
return !1 | |
} | |
try { | |
b.Xb("Expand Tree"); | |
var c = new E(U); | |
if (null === a || a.Wc) { | |
for (var d = b.selection.i; d.next();) { | |
var e = d.value; | |
e instanceof U && (a = e, a.Wc || (a.expandTree(), c.add(a))) | |
} | |
} else { | |
a.expandTree(), c.add(a) | |
} | |
b.Ba("TreeExpanded", c) | |
} finally { | |
b.Xd("Expand Tree") | |
} | |
}; | |
sa.prototype.canExpandTree = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b || b.nb) { | |
return !1 | |
} | |
if (null !== a) { | |
if (a.Wc) { | |
return !1 | |
} | |
if (0 < a.Yv().count) { | |
return !0 | |
} | |
} else { | |
for (a = b.selection.i; a.next();) { | |
if (b = a.value, b instanceof U && !b.Wc && 0 < b.Yv().count) { | |
return !0 | |
} | |
} | |
} | |
return !1 | |
}; | |
sa.prototype.groupSelection = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.ha; | |
if (b instanceof Q) { | |
var c = this.OC; | |
if (null !== c) { | |
var d = null; | |
try { | |
a.bc = "wait"; | |
a.Xb("Group"); | |
a.Ba("ChangingSelection"); | |
for (var e = new E(G), f = a.selection.i; f.next();) { | |
var h = f.value; | |
h.Hd() && h.canGroup() && e.add(h) | |
} | |
for (var k = new E(G), l = e.i; l.next();) { | |
for (var m = l.value, f = !1, n = e.i; n.next();) { | |
if (m.Rh(n.value)) { | |
f = !0; | |
break | |
} | |
} | |
f || k.add(m) | |
} | |
if (0 < k.count) { | |
var p = k.first().Sa; | |
if (null !== p) { | |
for (; null !== p;) { | |
for (var e = !1, q = k.i; q.next();) { | |
if (!q.value.Rh(p)) { | |
e = !0; | |
break | |
} | |
} | |
if (e) { | |
p = p.Sa | |
} else { | |
break | |
} | |
} | |
} | |
if (c instanceof V) { | |
nf(c), d = c.copy(), null !== d && a.add(d) | |
} else { | |
if (b.uz(c)) { | |
var r = b.copyNodeData(c); | |
u.Ta(r) && (b.om(r), d = a.Xv(r)) | |
} | |
} | |
if (null !== d) { | |
null !== p && this.isValidMember(p, d) && (d.Sa = p); | |
for (var s = k.i; s.next();) { | |
var t = s.value; | |
this.isValidMember(d, t) && (t.Sa = d) | |
} | |
a.select(d) | |
} | |
} | |
a.Ba("ChangedSelection"); | |
a.Ba("SelectionGrouped", d) | |
} finally { | |
a.Xd("Group"), a.bc = "" | |
} | |
} | |
} | |
} | |
}; | |
sa.prototype.canGroupSelection = function() { | |
var a = this.g; | |
if (null === a || a.nb || a.vf || !a.no || !a.Cv || !(a.ha instanceof Q) || null === this.OC) { | |
return !1 | |
} | |
for (a = a.selection.i; a.next();) { | |
var b = a.value; | |
if (b.Hd() && b.canGroup()) { | |
return !0 | |
} | |
} | |
return !1 | |
}; | |
function wf(a) { | |
var b = u.hb(); | |
for (a = a.i; a.next();) { | |
var c = a.value; | |
c instanceof W || b.push(c) | |
} | |
a = new F(G); | |
for (var c = b.length, d = 0; d < c; d++) { | |
for (var e = b[d], f = !0, h = 0; h < c; h++) { | |
if (e.Rh(b[h])) { | |
f = !1; | |
break | |
} | |
} | |
f && a.add(e) | |
} | |
u.sa(b); | |
return a | |
} | |
sa.prototype.isValidMember = function(a, b) { | |
if (null === b || a === b || b instanceof W) { | |
return !1 | |
} | |
if (null !== a) { | |
if (a === b || a.Rh(b)) { | |
return !1 | |
} | |
var c = a.Cz; | |
if (null !== c && !c(a, b) || null === a.data && null !== b.data || null !== a.data && null === b.data) { | |
return !1 | |
} | |
} | |
c = this.Cz; | |
return null !== c ? c(a, b) : !0 | |
}; | |
sa.prototype.ungroupSelection = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null !== b) { | |
var c = b.ha; | |
if (c instanceof Q) { | |
try { | |
b.bc = "wait"; | |
b.Xb("Ungroup"); | |
b.Ba("ChangingSelection"); | |
var d = new E(V); | |
if (null !== a) { | |
d.add(a) | |
} else { | |
for (var e = b.selection.i; e.next();) { | |
var f = e.value; | |
f instanceof V && (a = f, a.canUngroup() && d.add(a)) | |
} | |
} | |
if (0 < d.count) { | |
b.Mv(); | |
for (var h = d.i; h.next();) { | |
var k = h.value; | |
k.expandSubGraph(); | |
var l = k.Sa, | |
m = null !== l && null !== l.data ? c.wb(l.data) : void 0, | |
n = new E(G); | |
n.Ud(k.Lc); | |
for (var p = n.i; p.next();) { | |
var q = p.value; | |
q.$a = !0; | |
if (!(q instanceof W)) { | |
var r = q.data; | |
null !== r ? c.Hw(r, m) : q.Sa = l | |
} | |
} | |
b.remove(k) | |
} | |
} | |
b.Ba("ChangedSelection"); | |
b.Ba("SelectionUngrouped", d, n) | |
} finally { | |
b.Xd("Ungroup"), b.bc = "" | |
} | |
} | |
} | |
}; | |
sa.prototype.canUngroupSelection = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b || b.nb || b.vf || !b.pm || !b.Gv || !(b.ha instanceof Q)) { | |
return !1 | |
} | |
if (null !== a) { | |
if (a.canUngroup()) { | |
return !0 | |
} | |
} else { | |
for (a = b.selection.i; a.next();) { | |
if (b = a.value, b instanceof V && b.canUngroup()) { | |
return !0 | |
} | |
} | |
} | |
return !1 | |
}; | |
sa.prototype.addTopLevelParts = function(a, b) { | |
for (var c = !0, d = wf(a).i; d.next();) { | |
var e = d.value; | |
null !== e.Sa && (!b || this.isValidMember(null, e) ? e.Sa = null : c = !1) | |
} | |
return c | |
}; | |
sa.prototype.collapseSubGraph = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b) { | |
return !1 | |
} | |
try { | |
b.Xb("Collapse SubGraph"); | |
var c = new E(V); | |
if (null !== a && a.ce) { | |
a.collapseSubGraph(), c.add(a) | |
} else { | |
for (var d = b.selection.i; d.next();) { | |
var e = d.value; | |
e instanceof V && (a = e, a.ce && (a.collapseSubGraph(), c.add(a))) | |
} | |
} | |
b.Ba("SubGraphCollapsed", c) | |
} finally { | |
b.Xd("Collapse SubGraph") | |
} | |
}; | |
sa.prototype.canCollapseSubGraph = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b || b.nb) { | |
return !1 | |
} | |
if (null !== a) { | |
return a.ce ? !0 : !1 | |
} | |
for (a = b.selection.i; a.next();) { | |
if (b = a.value, b instanceof V && b.ce) { | |
return !0 | |
} | |
} | |
return !1 | |
}; | |
sa.prototype.expandSubGraph = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b) { | |
return !1 | |
} | |
try { | |
b.Xb("Expand SubGraph"); | |
var c = new E(V); | |
if (null === a || a.ce) { | |
for (var d = b.selection.i; d.next();) { | |
var e = d.value; | |
e instanceof V && (a = e, a.ce || (a.expandSubGraph(), c.add(a))) | |
} | |
} else { | |
a.expandSubGraph(), c.add(a) | |
} | |
b.Ba("SubGraphExpanded", c) | |
} finally { | |
b.Xd("Expand SubGraph") | |
} | |
}; | |
sa.prototype.canExpandSubGraph = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b || b.nb) { | |
return !1 | |
} | |
if (null !== a) { | |
return a.ce ? !1 : !0 | |
} | |
for (a = b.selection.i; a.next();) { | |
if (b = a.value, b instanceof V && !b.ce) { | |
return !0 | |
} | |
} | |
return !1 | |
}; | |
sa.prototype.editTextBlock = function(a) { | |
void 0 === a && (a = null); | |
null !== a && u.C(a, qa, sa, "editTextBlock"); | |
var b = this.g; | |
if (null !== b) { | |
var c = b.tb.jA; | |
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.ws(function(a) { | |
return a instanceof qa && a.cz | |
}) | |
} | |
null !== a && (b.Va = null, c.te = a, b.Va = c) | |
} | |
} | |
}; | |
sa.prototype.canEditTextBlock = function(a) { | |
void 0 === a && (a = null); | |
null !== a && u.C(a, qa, sa, "canEditTextBlock"); | |
var b = this.g; | |
if (null === b || b.nb || b.vf || !b.Fv || null === b.tb.jA) { | |
return !1 | |
} | |
if (null !== a) { | |
if (a = a.W, null !== a && a.canEdit()) { | |
return !0 | |
} | |
} else { | |
for (b = b.selection.i; b.next();) { | |
if (a = b.value, a.canEdit() && (a = a.ws(function(a) { | |
return a instanceof qa && a.cz | |
}), null !== a)) { | |
return !0 | |
} | |
} | |
} | |
return !1 | |
}; | |
sa.prototype.showContextMenu = function(a) { | |
var b = this.g; | |
if (null !== b) { | |
var c = b.tb.Wy; | |
if (null !== c && (void 0 === a && (a = 0 < b.selection.count ? b.selection.first() : b), a = c.findObjectWithContextMenu(a), null !== a)) { | |
var d = new Md, | |
e = null; | |
a instanceof T ? e = a.eb(Ib) : b.fH || (e = b.ob, e = new w(e.x + e.width / 2, e.y + e.height / 2)); | |
null !== e && (d.hf = b.VE(e), d.da = e, b.N = d); | |
b.Va = c; | |
xf(c, !1, a) | |
} | |
} | |
}; | |
sa.prototype.canShowContextMenu = function(a) { | |
var b = this.g; | |
if (null === b) { | |
return !1 | |
} | |
var c = b.tb.Wy; | |
if (null === c) { | |
return !1 | |
} | |
void 0 === a && (a = 0 < b.selection.count ? b.selection.first() : b); | |
return null === c.findObjectWithContextMenu(a) ? !1 : !0 | |
}; | |
u.defineProperty(sa, { | |
gG: "copiesConnectedLinks" | |
}, function() { | |
return this.JA | |
}, function(a) { | |
u.j(a, "boolean", sa, "copiesConnectedLinks"); | |
this.JA = a | |
}); | |
u.defineProperty(sa, { | |
iG: "copiesTree" | |
}, function() { | |
return this.NA | |
}, function(a) { | |
u.j(a, "boolean", sa, "copiesTree"); | |
this.NA = a | |
}); | |
u.defineProperty(sa, { | |
rG: "deletesTree" | |
}, function() { | |
return this.XA | |
}, function(a) { | |
u.j(a, "boolean", sa, "deletesTree"); | |
this.XA = a | |
}); | |
u.defineProperty(sa, { | |
eD: "copiesParentKey" | |
}, function() { | |
return this.MA | |
}, function(a) { | |
u.j(a, "boolean", sa, "copiesParentKey"); | |
this.MA = a | |
}); | |
u.defineProperty(sa, { | |
dD: "copiesGroupKey" | |
}, function() { | |
return this.LA | |
}, function(a) { | |
u.j(a, "boolean", sa, "copiesGroupKey"); | |
this.LA = a | |
}); | |
u.defineProperty(sa, { | |
OC: "archetypeGroupData" | |
}, function() { | |
return this.ex | |
}, function(a) { | |
null !== a && u.C(a, Object, sa, "archetypeGroupData"); | |
var b = this.g; | |
null !== b && (b = b.ha, b instanceof Q && (a instanceof V || b.uz(a) || u.k("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: " + a))); | |
this.ex = a | |
}); | |
u.defineProperty(sa, { | |
Cz: "memberValidation" | |
}, function() { | |
return this.Ak | |
}, function(a) { | |
null !== a && u.j(a, "function", sa, "memberValidation"); | |
this.Ak = a | |
}); | |
u.defineProperty(sa, { | |
Pv: "defaultScale" | |
}, function() { | |
return this.VA | |
}, function(a) { | |
u.Be(a, sa, "defaultScale"); | |
0 < a || u.k("defaultScale must be larger than zero, not: " + a); | |
this.VA = a | |
}); | |
u.defineProperty(sa, { | |
Qw: "zoomFactor" | |
}, function() { | |
return this.EC | |
}, function(a) { | |
u.Be(a, sa, "zoomFactor"); | |
1 < a || u.k("zoomFactor must be larger than 1.0, not: " + a); | |
this.EC = a | |
}); | |
function xe() { | |
0 < arguments.length && u.Xc(xe); | |
u.gc(this); | |
this.Y = null; | |
this.Vb = ""; | |
this.Oe = !0; | |
this.lB = !1; | |
this.AC = null; | |
this.wv = -1 | |
} | |
u.fa("Tool", xe); | |
xe.prototype.Dc = function(a) { | |
this.Y = a | |
}; | |
xe.prototype.toString = function() { | |
return "" !== this.name ? this.name + " Tool" : u.tg(Object.getPrototypeOf(this)) | |
}; | |
xe.prototype.updateAdornments = function() {}; | |
xe.prototype.canStart = function() { | |
return this.isEnabled | |
}; | |
xe.prototype.doStart = function() {}; | |
xe.prototype.doActivate = function() { | |
this.oa = !0 | |
}; | |
xe.prototype.doDeactivate = function() { | |
this.oa = !1 | |
}; | |
xe.prototype.doStop = function() {}; | |
xe.prototype.doCancel = function() { | |
this.stopTool() | |
}; | |
xe.prototype.stopTool = function() { | |
var a = this.g; | |
null !== a && a.Va === this && (a.Va = null, a.bc = "") | |
}; | |
xe.prototype.doMouseDown = function() { | |
!this.oa && this.canStart() && this.doActivate() | |
}; | |
xe.prototype.doMouseMove = function() {}; | |
xe.prototype.doMouseUp = function() { | |
this.stopTool() | |
}; | |
xe.prototype.doMouseWheel = function() {}; | |
xe.prototype.canStartMultiTouch = function() { | |
return !0 | |
}; | |
xe.prototype.standardPinchZoomStart = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.N.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.Ef[0]) { | |
c = a.Ef[0], d = a.Ef[1] | |
} else { | |
return | |
} | |
} | |
this.doCancel(); | |
if (a.An) { | |
a.Nx = !0; | |
a.MB = a.scale; | |
var e = a.Ab, | |
f = a.zb, | |
h = a.kb.getBoundingClientRect(), | |
k = c.clientX - e / h.width * h.left, | |
l = c.clientY - f / h.height * h.top, | |
c = d, | |
d = c.clientX - e / h.width * h.left - k, | |
f = c.clientY - f / h.height * h.top - l, | |
f = Math.sqrt(d * d + f * f); | |
a.iC = f; | |
b.preventDefault(); | |
b.cancelBubble = !0 | |
} else { | |
yf(a) | |
} | |
} | |
}; | |
xe.prototype.standardPinchZoomMove = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.N.event; | |
this.doCancel(); | |
yf(a); | |
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.Ef[0]) { | |
c = a.Ef[0], d = a.Ef[1] | |
} else { | |
return | |
} | |
} | |
if (a.An && a.Nx) { | |
var e = a.Ab, | |
f = a.zb, | |
h = a.kb.getBoundingClientRect(), | |
k = c, | |
c = k.clientX - e / h.width * h.left, | |
l = k.clientY - f / h.height * h.top, | |
k = d, | |
d = k.clientX - e / h.width * h.left, | |
f = k.clientY - f / h.height * h.top, | |
h = d - c, | |
e = f - l, | |
h = Math.sqrt(h * h + e * e) / a.iC, | |
c = new w((Math.min(d, c) + Math.max(d, c)) / 2, (Math.min(f, l) + Math.max(f, l)) / 2), | |
l = a.MB * h, | |
d = a.Eb; | |
l !== a.scale && d.canResetZoom(l) && (f = a.yl, a.yl = c, d.resetZoom(l), a.yl = f); | |
b.preventDefault(); | |
b.cancelBubble = !0 | |
} | |
} | |
}; | |
xe.prototype.doKeyDown = function() { | |
var a = this.g; | |
null !== a && "Esc" === a.N.key && this.doCancel() | |
}; | |
xe.prototype.doKeyUp = function() {}; | |
xe.prototype.startTransaction = xe.prototype.Xb = function(a) { | |
void 0 === a && (a = this.name); | |
this.Af = null; | |
var b = this.g; | |
return null === b ? !1 : b.Xb(a) | |
}; | |
xe.prototype.stopTransaction = xe.prototype.Uj = function() { | |
var a = this.g; | |
return null === a ? !1 : null === this.Af ? a.cp() : a.Xd(this.Af) | |
}; | |
xe.prototype.standardMouseSelect = function() { | |
var a = this.g; | |
if (null !== a && a.qf) { | |
var b = a.N, | |
c = a.As(b.da, !1); | |
if (null !== c) { | |
if (u.Im ? b.Zs : b.control) { | |
a.Ba("ChangingSelection"); | |
for (b = c; null !== b && !b.canSelect();) { | |
b = b.Sa | |
} | |
null !== b && (b.$a = !b.$a); | |
a.Ba("ChangedSelection") | |
} else { | |
if (b.shift) { | |
if (!c.$a) { | |
a.Ba("ChangingSelection"); | |
for (b = c; null !== b && !b.canSelect();) { | |
b = b.Sa | |
} | |
null !== b && (b.$a = !0); | |
a.Ba("ChangedSelection") | |
} | |
} else { | |
if (!c.$a) { | |
for (b = c; null !== b && !b.canSelect();) { | |
b = b.Sa | |
} | |
null !== b && a.select(b) | |
} | |
} | |
} | |
} else { | |
!b.left || (u.Im ? b.Zs : b.control) || b.shift || a.Mv() | |
} | |
} | |
}; | |
xe.prototype.standardMouseClick = function(a, b) { | |
void 0 === a && (a = null); | |
void 0 === b && (b = function(a) { | |
return !a.layer.zc | |
}); | |
var c = this.g; | |
if (null !== c) { | |
var d = c.N, | |
e = c.le(d.da, a, b); | |
d.qe = e; | |
zf(e, d, c) | |
} | |
}; | |
function zf(a, b, c) { | |
var d = 0; | |
b.left ? d = 1 === b.Ue ? 1 : 2 === b.Ue ? 2 : 1 : b.right && 1 === b.Ue && (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.Ba(e, a) | |
} else { | |
switch (d) { | |
case 1: | |
e = "BackgroundSingleClicked"; | |
break; | |
case 2: | |
e = "BackgroundDoubleClicked"; | |
break; | |
case 3: | |
e = "BackgroundContextClicked" | |
} | |
0 !== d && c.Ba(e) | |
} | |
if (null !== a) { | |
for (b.Tc = !1; null !== a;) { | |
c = null; | |
switch (d) { | |
case 1: | |
c = a.click; | |
break; | |
case 2: | |
c = a.us ? a.us : a.click; | |
break; | |
case 3: | |
c = a.Vy | |
} | |
if (null !== c && (c(b, a), b.Tc)) { | |
break | |
} | |
a = a.P | |
} | |
} else { | |
a = null; | |
switch (d) { | |
case 1: | |
a = c.click; | |
break; | |
case 2: | |
a = c.us ? c.us : c.click; | |
break; | |
case 3: | |
a = c.Vy | |
} | |
null !== a && a(b) | |
} | |
} | |
xe.prototype.standardMouseOver = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.N; | |
if (null !== b.g && !0 !== a.Mb.cd) { | |
var c = a.gb; | |
a.gb = !0; | |
var d = a.le(b.da, null, null); | |
b.qe = d; | |
var e = !1; | |
if (d !== a.gn) { | |
var f = a.gn, | |
h = f; | |
a.gn = d; | |
this.doCurrentObjectChanged(f, d); | |
for (b.Tc = !1; null !== f;) { | |
var k = f.aE; | |
if (null !== k) { | |
if (d === f) { | |
break | |
} | |
if (null !== d && d.gl(f)) { | |
break | |
} | |
k(b, f, d); | |
e = !0; | |
if (b.Tc) { | |
break | |
} | |
} | |
f = f.P | |
} | |
f = h; | |
for (b.Tc = !1; null !== d;) { | |
k = d.$D; | |
if (null !== k) { | |
if (f === d) { | |
break | |
} | |
if (null !== f && f.gl(d)) { | |
break | |
} | |
k(b, d, f); | |
e = !0; | |
if (b.Tc) { | |
break | |
} | |
} | |
d = d.P | |
} | |
d = a.gn | |
} | |
if (null !== d) { | |
f = d; | |
for (k = ""; null !== f;) { | |
k = f.cursor; | |
if ("" !== k) { | |
break | |
} | |
f = f.P | |
} | |
a.bc = k; | |
b.Tc = !1; | |
for (f = d; null !== f;) { | |
k = f.Gz; | |
if (null !== k && (k(b, f), e = !0, b.Tc)) { | |
break | |
} | |
f = f.P | |
} | |
} else { | |
a.bc = "", k = a.Gz, null !== k && (k(b), e = !0) | |
} | |
e && a.ee(); | |
a.gb = c | |
} | |
} | |
}; | |
xe.prototype.doCurrentObjectChanged = function() {}; | |
xe.prototype.standardMouseWheel = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.N, | |
c = b.Uk; | |
if (0 !== c && a.Ed.I()) { | |
var d = a.Eb, | |
e = a.tb.at; | |
if ((e === Af && !b.shift || e === Bf && b.control) && (0 < c ? d.canIncreaseZoom() : d.canDecreaseZoom())) { | |
e = a.yl, a.yl = b.hf, 0 < c ? d.increaseZoom() : d.decreaseZoom(), a.yl = e, b.bubbles = !1 | |
} else { | |
if (e === Af && b.shift || e === Bf && !b.control) { | |
d = a.position.copy(); | |
e = 0 < c ? c : -c; | |
if (!b.shift && a.Te) { | |
var f = a.nt, | |
e = e / 40 * f; | |
0 < c ? a.scroll("pixel", "up", e) : a.scroll("pixel", "down", e) | |
} else { | |
b.shift && a.Se && (f = a.mt, e = e / 40 * f, 0 < c ? a.scroll("pixel", "left", e) : a.scroll("pixel", "right", e)) | |
} | |
a.position.L(d) || (b.bubbles = !1) | |
} | |
} | |
} | |
} | |
}; | |
xe.prototype.standardWaitAfter = function(a) { | |
u.j(a, "number", xe, "standardWaitAfter:delay"); | |
this.cancelWaitAfter(); | |
var b = this; | |
this.wv = u.setTimeout(function() { | |
b.doWaitAfter() | |
}, a) | |
}; | |
xe.prototype.cancelWaitAfter = function() { | |
-1 !== this.wv && u.clearTimeout(this.wv); | |
this.wv = -1 | |
}; | |
xe.prototype.doWaitAfter = function() {}; | |
xe.prototype.findToolHandleAt = function(a, b) { | |
var c = this.g; | |
if (null === c) { | |
return null | |
} | |
c = c.le(a, function(a) { | |
for (; null !== a && !(a.P instanceof lf);) { | |
a = a.P | |
} | |
return a | |
}); | |
return null === c ? null : c.P.Jc === b ? c : null | |
}; | |
xe.prototype.isBeyondDragSize = function(a, b) { | |
var c = this.g; | |
if (null === c) { | |
return !1 | |
} | |
void 0 === a && (a = c.uc.hf); | |
void 0 === b && (b = c.N.hf); | |
var d = c.tb.wG, | |
e = d.width, | |
d = d.height; | |
c.uc.kl && (e += 6, d += 6); | |
return Math.abs(b.x - a.x) > e || Math.abs(b.y - a.y) > d | |
}; | |
u.u(xe, { | |
g: "diagram" | |
}, function() { | |
return this.Y | |
}); | |
u.defineProperty(xe, { | |
name: "name" | |
}, function() { | |
return this.Vb | |
}, function(a) { | |
u.j(a, "string", xe, "name"); | |
this.Vb = a | |
}); | |
u.defineProperty(xe, { | |
isEnabled: "isEnabled" | |
}, function() { | |
return this.Oe | |
}, function(a) { | |
u.j(a, "boolean", xe, "isEnabled"); | |
this.Oe = a | |
}); | |
u.defineProperty(xe, { | |
oa: "isActive" | |
}, function() { | |
return this.lB | |
}, function(a) { | |
u.j(a, "boolean", xe, "isActive"); | |
this.lB = a | |
}); | |
u.defineProperty(xe, { | |
Af: "transactionResult" | |
}, function() { | |
return this.AC | |
}, function(a) { | |
null !== a && u.j(a, "string", xe, "transactionResult"); | |
this.AC = a | |
}); | |
function uf() { | |
0 < arguments.length && u.Xc(uf); | |
xe.call(this); | |
this.name = "Dragging"; | |
this.KA = this.pB = !0; | |
this.kq = this.cB = !1; | |
this.tB = !0; | |
this.Ox = (new ia(NaN, NaN)).freeze(); | |
this.Px = xb; | |
this.Qx = (new w(NaN, NaN)).freeze(); | |
this.bB = !1; | |
this.$A = this.IA = this.aB = this.QA = this.qi = null; | |
this.Tp = this.rB = !1; | |
this.eo = new w(NaN, NaN); | |
this.iv = new w; | |
this.lv = !1; | |
this.gv = this.oB = !0; | |
this.rn = 100; | |
this.Yi = []; | |
this.sF = (new F(G)).freeze() | |
} | |
u.Ha(uf, xe); | |
u.fa("DraggingTool", uf); | |
u.defineProperty(uf, { | |
MD: "isCopyEnabled" | |
}, function() { | |
return this.pB | |
}, function(a) { | |
u.j(a, "boolean", uf, "isCopyEnabled"); | |
this.pB = a | |
}); | |
u.defineProperty(uf, { | |
hG: "copiesEffectiveCollection" | |
}, function() { | |
return this.KA | |
}, function(a) { | |
u.j(a, "boolean", uf, "copiesEffectiveCollection"); | |
this.KA = a | |
}); | |
u.defineProperty(uf, { | |
xG: "dragsTree" | |
}, function() { | |
return this.cB | |
}, function(a) { | |
u.j(a, "boolean", uf, "dragsTree"); | |
this.cB = a | |
}); | |
u.defineProperty(uf, { | |
hw: "isGridSnapEnabled" | |
}, function() { | |
return this.kq | |
}, function(a) { | |
u.j(a, "boolean", uf, "isGridSnapEnabled"); | |
this.kq = a | |
}); | |
u.defineProperty(uf, { | |
ZG: "isComplexRoutingRealtime" | |
}, function() { | |
return this.oB | |
}, function(a) { | |
u.j(a, "boolean", uf, "isComplexRoutingRealtime"); | |
this.oB = a | |
}); | |
u.defineProperty(uf, { | |
aH: "isGridSnapRealtime" | |
}, function() { | |
return this.tB | |
}, function(a) { | |
u.j(a, "boolean", uf, "isGridSnapRealtime"); | |
this.tB = a | |
}); | |
u.defineProperty(uf, { | |
DD: "gridSnapCellSize" | |
}, function() { | |
return this.Ox | |
}, function(a) { | |
u.C(a, ia, uf, "gridSnapCellSize"); | |
this.Ox.L(a) || (this.Ox = a = a.Z()) | |
}); | |
u.defineProperty(uf, { | |
KG: "gridSnapCellSpot" | |
}, function() { | |
return this.Px | |
}, function(a) { | |
u.C(a, L, uf, "gridSnapCellSpot"); | |
this.Px.L(a) || (this.Px = a = a.Z()) | |
}); | |
u.defineProperty(uf, { | |
LG: "gridSnapOrigin" | |
}, function() { | |
return this.Qx | |
}, function(a) { | |
u.C(a, w, uf, "gridSnapOrigin"); | |
this.Qx.L(a) || (this.Qx = a = a.Z()) | |
}); | |
u.defineProperty(uf, { | |
Hi: "dragsLink" | |
}, function() { | |
return this.bB | |
}, function(a) { | |
u.j(a, "boolean", uf, "dragsLink"); | |
this.bB = a | |
}); | |
u.defineProperty(uf, { | |
ts: "currentPart" | |
}, function() { | |
return this.QA | |
}, function(a) { | |
null !== a && u.C(a, G, uf, "currentPart"); | |
this.QA = a | |
}); | |
u.defineProperty(uf, { | |
oc: "copiedParts" | |
}, function() { | |
return this.IA | |
}, function(a) { | |
this.IA = a | |
}); | |
u.defineProperty(uf, { | |
dc: "draggedParts" | |
}, function() { | |
return this.aB | |
}, function(a) { | |
this.aB = a | |
}); | |
u.u(uf, { | |
yJ: "draggingParts" | |
}, function() { | |
return null !== this.oc ? this.oc.Oi() : null !== this.dc ? this.dc.Oi() : this.sF | |
}); | |
u.defineProperty(uf, { | |
Sc: "draggedLink" | |
}, function() { | |
return this.$A | |
}, function(a) { | |
null !== a && u.C(a, W, uf, "draggedLink"); | |
this.$A = a | |
}); | |
u.defineProperty(uf, { | |
gw: "isDragOutStarted" | |
}, function() { | |
return this.rB | |
}, function(a) { | |
this.rB = a | |
}); | |
u.defineProperty(uf, { | |
Tj: "startPoint" | |
}, function() { | |
return this.iv | |
}, function(a) { | |
u.C(a, w, uf, "startPoint"); | |
this.iv.L(a) || (this.iv = a = a.Z()) | |
}); | |
u.defineProperty(uf, { | |
jD: "delay" | |
}, function() { | |
return this.rn | |
}, function(a) { | |
u.j(a, "number", uf, "delay"); | |
this.rn = a | |
}); | |
uf.prototype.canStart = function() { | |
if (!this.isEnabled) { | |
return !1 | |
} | |
var a = this.g; | |
if (null === a || !a.Nk && !a.Ij && !a.Bv || !a.qf) { | |
return !1 | |
} | |
var b = a.N; | |
return !b.left || a.Va !== this && (!this.isBeyondDragSize() || b.kl && b.timestamp - a.uc.timestamp < this.rn) ? !1 : null !== this.findDraggablePart() | |
}; | |
uf.prototype.findDraggablePart = function() { | |
var a = this.g; | |
if (null === a) { | |
return null | |
} | |
a = a.As(a.uc.da, !1); | |
if (null === a) { | |
return null | |
} | |
for (; null !== a && !a.canSelect();) { | |
a = a.Sa | |
} | |
return null !== a && (a.canMove() || a.canCopy()) ? a : null | |
}; | |
uf.prototype.standardMouseSelect = function() { | |
var a = this.g; | |
if (null !== a && a.qf) { | |
var b = a.As(a.uc.da, !1); | |
if (null !== b) { | |
for (; null !== b && !b.canSelect();) { | |
b = b.Sa | |
} | |
this.ts = b; | |
this.ts.$a || (a.Ba("ChangingSelection"), b = a.N, (u.Im ? b.Zs : b.control) || b.shift || of (a), this.ts.$a = !0, a.Ba("ChangedSelection")) | |
} | |
} | |
}; | |
uf.prototype.doActivate = function() { | |
var a = this.g; | |
if (null !== a) { | |
this.standardMouseSelect(); | |
var b = this.ts; | |
null !== b && (b.canMove() || b.canCopy()) && (this.oa = !0, this.eo.set(a.position), Cf(this, a.selection), this.Yi.length = 0, this.dc = this.computeEffectiveCollection(a.selection), a.ut = !0, Df(this, this.dc), this.Xb("Drag"), this.Tj = a.uc.da, a.He = !0, a.Bv && (this.gw = !0, this.Tp = !1, Ef = this, Ff = this.g, this.doSimulatedDragOut())) | |
} | |
}; | |
function Cf(a, b) { | |
if (a.Hi) { | |
var c = a.g; | |
null !== c && c.qm && (c.ha instanceof Q && 1 === b.count && b.first() instanceof W ? (a.Sc = b.first(), a.Sc.canRelinkFrom() && a.Sc.canRelinkTo() && a.Sc.ns(), a.qi = c.tb.jE, null === a.qi && (a.qi = new Gf, a.qi.Dc(c))) : (a.Sc = null, a.qi = null)) | |
} | |
} | |
uf.prototype.computeEffectiveCollection = function(a) { | |
var b = null !== this.g && this.g.Va === this, | |
c = new la(G); | |
if (null === a) { | |
return c | |
} | |
for (var d = a.i; d.next();) { | |
Hf(this, c, d.value, b) | |
} | |
if (null !== this.Sc && this.Hi) { | |
return c | |
} | |
for (d = a.i; d.next();) { | |
a = d.value, a instanceof W && (b = a.V, null === b || c.contains(b) ? (b = a.ba, null === b || c.contains(b) || c.remove(a)) : c.remove(a)) | |
} | |
return c | |
}; | |
function If(a) { | |
return void 0 === a ? new Jf(K.Wj) : new Jf(a.copy()) | |
} | |
function Hf(a, b, c, d) { | |
if (!b.contains(c) && (!d || c.canMove() || c.canCopy())) { | |
if (c instanceof U) { | |
b.add(c, If(c.location)); | |
if (c instanceof V) { | |
for (var e = c.Lc; e.next();) { | |
Hf(a, b, e.value, d) | |
} | |
} | |
for (e = c.pe; e.next();) { | |
var f = e.value; | |
if (!b.contains(f)) { | |
var h = f.V, | |
k = f.ba; | |
null !== h && b.contains(h) && null !== k && b.contains(k) && Hf(a, b, f, d) | |
} | |
} | |
if (a.xG) { | |
for (c = c.uD(); c.next();) { | |
Hf(a, b, c.value, d) | |
} | |
} | |
} else { | |
if (c instanceof W) { | |
for (f = c, b.add(f, If()), e = f.wg; e.next();) { | |
Hf(a, b, e.value, d) | |
} | |
} else { | |
c instanceof lf || b.add(c, If(c.location)) | |
} | |
} | |
} | |
} | |
uf.prototype.doDeactivate = function() { | |
this.oa = !1; | |
var a = this.g; | |
null !== a && Kf(a); | |
Zf(this); | |
$f(this, this.dc); | |
this.dc = null; | |
this.Tp = this.gw = !1; | |
if (0 < ag.count) { | |
for (var b = ag.length, c = 0; c < b; c++) { | |
var d = ag.ja(c); | |
bg(d); | |
cg(d); | |
Zf(d); | |
null !== d.g && Kf(d.g) | |
} | |
ag.clear() | |
} | |
bg(this); | |
this.eo.m(NaN, NaN); | |
Ef = Ff = null; | |
cg(this); | |
a.He = !1; | |
a.bc = ""; | |
a.ut = !1; | |
this.Uj() | |
}; | |
function Zf(a) { | |
var b = a.g; | |
if (null !== b) { | |
var c = b.gb; | |
b.gb = !0; | |
dg(a, b.N, null); | |
b.gb = c | |
} | |
a.Yi.length = 0 | |
} | |
function eg() { | |
var a = Ef; | |
cg(a); | |
fg(a); | |
var b = a.g; | |
null !== b && a.eo.I() && (b.position = a.eo); | |
null !== b && Kf(b) | |
} | |
uf.prototype.doCancel = function() { | |
cg(this); | |
fg(this); | |
var a = this.g; | |
null !== a && this.eo.I() && (a.position = this.eo); | |
this.stopTool() | |
}; | |
function Df(a, b) { | |
if (null !== b) { | |
a.lv = !0; | |
for (var c = b.i; c.next();) { | |
var d = c.key; | |
d instanceof W && (d.kp = !0) | |
} | |
} | |
} | |
function $f(a, b) { | |
if (null !== b) { | |
for (var c = b.i; c.next();) { | |
var d = c.key; | |
d instanceof W && (d.kp = !1, d.el && gg(d) && d.Wb()) | |
} | |
a.lv = !1 | |
} | |
} | |
uf.prototype.doKeyDown = function() { | |
var a = this.g; | |
null !== a && (a = a.N, null !== a && this.oa && ("Esc" === a.key ? this.doCancel() : this.doMouseMove())) | |
}; | |
uf.prototype.doKeyUp = function() { | |
var a = this.g; | |
null !== a && null !== a.N && this.oa && this.doMouseMove() | |
}; | |
function hg(a, b) { | |
for (var c = Infinity, d = Infinity, e = -Infinity, f = -Infinity, h = a.i; h.next();) { | |
var k = h.value; | |
if (k.Hd() && k.Ia()) { | |
var l = k.location, | |
k = l.x, | |
l = l.y; | |
isNaN(k) || isNaN(l) || (k < c && (c = k), l < d && (d = l), k > e && (e = k), l > f && (f = l)) | |
} | |
} | |
Infinity === c ? b.m(0, 0, 0, 0) : b.m(c, d, e - c, f - d) | |
} | |
function ig(a, b) { | |
if (null === a.oc) { | |
var c = a.g; | |
if (!(null === c || b && (c.nb || c.vf)) && null !== a.dc) { | |
var d = c.ga; | |
d.isEnabled && d.OD ? null !== d.Ei && 0 < d.Ei.Wg.count && (c.ga.cp(), c.Xb("Drag")) : fg(a); | |
c.gb = !b; | |
c.Ym = !b; | |
a.Tj = c.uc.da; | |
d = a.hG ? a.dc.Oi() : c.selection; | |
d = c.vo(d, c, !0); | |
for (c = d.i; c.next();) { | |
c.value.location = c.key.location | |
} | |
c = u.Tf(); | |
hg(d, c); | |
u.ic(c); | |
for (var c = new la(G), e = a.dc.i; e.next();) { | |
var f = e.key; | |
f.Hd() && f.canCopy() && (f = d.ua(f), null !== f && (f.rf(), c.add(f, If(f.location)))) | |
} | |
for (d = d.i; d.next();) { | |
e = d.value, e instanceof W && e.canCopy() && c.add(e, If()) | |
} | |
a.oc = c; | |
Cf(a, c.Oi()); | |
null !== a.Sc && (c = a.Sc, d = c.Qm, c.ml(a.Tj.x - (d.x + d.width / 2), a.Tj.y - (d.y + d.height / 2))) | |
} | |
} | |
} | |
function cg(a) { | |
var b = a.g; | |
if (null !== b) { | |
if (null !== a.oc && (b.Xz(a.oc.Oi(), !1), a.oc = null, null !== a.dc)) { | |
for (var c = a.dc.i; c.next();) { | |
c.key instanceof W && (c.value.point = new w(0, 0)) | |
} | |
} | |
b.gb = !1; | |
b.Ym = !1; | |
a.Tj = b.uc.da | |
} | |
} | |
function bg(a) { | |
if (null !== a.Sc) { | |
if (a.Hi && null !== a.qi) { | |
var b = a.qi; | |
b.g.remove(b.re); | |
b.g.remove(b.se) | |
} | |
a.Sc = null; | |
a.qi = null | |
} | |
} | |
function jg(a, b, c) { | |
var d = a.g; | |
if (null !== d) { | |
var e = a.Tj, | |
f = u.K(); | |
f.assign(d.N.da); | |
a.moveParts(b, f.wt(e), c); | |
u.v(f) | |
} | |
} | |
uf.prototype.moveParts = function(a, b, c) { | |
if (null !== a && (u.C(a, la, uf, "moveParts:parts"), 0 !== a.count)) { | |
var d = u.K(), | |
e = u.K(); | |
e.assign(b); | |
isNaN(e.x) && (e.x = 0); | |
isNaN(e.y) && (e.y = 0); | |
(b = this.lv) || Df(this, a); | |
for (var f = new E(kg), h = new E(Pa), k = a.i; k.next();) { | |
var l = k.key; | |
if (l.Hd()) { | |
var m = lg(this, l, a); | |
if (null !== m) { | |
f.add(new kg(l, k.value, m)) | |
} else { | |
if (!c || l.canMove()) { | |
m = k.value.point; | |
d.assign(m); | |
var n = u.K(), | |
p = this.computeMove(l, d.add(e), a, n); | |
l.location = p; | |
k.value.IE = n.wt(m); | |
u.v(n) | |
} | |
} | |
} else { | |
k.key instanceof W && h.add(k.Cb) | |
} | |
} | |
for (c = f.i; c.next();) { | |
f = c.value, m = f.info.point, d.assign(m), f.Bc.location = d.add(f.MG.IE) | |
} | |
c = u.K(); | |
m = u.K(); | |
for (h = h.i; h.next();) { | |
if (k = h.value, f = k.key, f instanceof W) { | |
if (f.kp) { | |
l = f.V, n = f.ba, null !== this.Sc && this.Hi ? (k = k.value.point, a.add(f, If(e)), l = e.x - k.x, k = e.y - k.y, f.ml(l, k)) : (null !== l && (c.assign(l.location), p = a.ua(l), null !== p && c.wt(p.point)), null !== n && (m.assign(n.location), p = a.ua(n), null !== p && m.wt(p.point)), null !== l && null !== n ? c.pd(m) ? (k = k.value.point, l = d, l.assign(c), l.wt(k), a.add(f, If(c)), f.ml(l.x, l.y)) : (f.kp = !1, f.Wb()) : (k = k.value.point, n = null !== l ? c : null !== n ? m : e, a.add(f, If(n)), l = n.x - k.x, k = n.y - k.y, f.ml(l, k))) | |
} else { | |
if (null === f.V || null === f.ba) { | |
k = k.value.point, a.add(f, If(e)), l = e.x - k.x, k = e.y - k.y, f.ml(l, k) | |
} | |
} | |
} | |
} | |
u.v(d); | |
u.v(e); | |
u.v(c); | |
u.v(m); | |
b || $f(this, a) | |
} | |
}; | |
function lg(a, b, c) { | |
b = b.Sa; | |
if (null !== b) { | |
a = lg(a, b, c); | |
if (null !== a) { | |
return a | |
} | |
a = c.ua(b); | |
if (null !== a) { | |
return a | |
} | |
} | |
return null | |
} | |
function fg(a) { | |
if (null !== a.dc) { | |
for (var b = a.g, c = a.dc.i; c.next();) { | |
var d = c.key; | |
d.Hd() && (d.location = c.value.point) | |
} | |
for (c = a.dc.i; c.next();) { | |
if (d = c.key, d instanceof W && d.kp) { | |
var e = c.value.point; | |
a.dc.add(d, If()); | |
d.ml(-e.x, -e.y) | |
} | |
} | |
b.df() | |
} | |
} | |
uf.prototype.computeMove = function(a, b, c, d) { | |
void 0 === d && (d = new w); | |
d.assign(b); | |
if (null === a) { | |
return d | |
} | |
void 0 === c && (c = null); | |
var e = b; | |
if (this.hw && (this.aH || null === c || this.g.N.up) && (e = u.K(), c = e, c.assign(b), null !== a)) { | |
var f = this.g; | |
if (null !== f) { | |
var h = f.Hs, | |
k = this.DD, | |
f = k.width, | |
k = k.height, | |
l = this.LG, | |
m = l.x, | |
l = l.y, | |
n = this.KG; | |
if (null !== h) { | |
var p = h.aw; | |
isNaN(f) && (f = p.width); | |
isNaN(k) && (k = p.height); | |
h = h.CD; | |
isNaN(m) && (m = h.x); | |
isNaN(l) && (l = h.y) | |
} | |
h = u.Yb(0, 0); | |
h.st(0, 0, f, k, n); | |
K.ys(b.x, b.y, m + h.x, l + h.y, f, k, c); | |
u.v(h) | |
} | |
} | |
c = null !== a.nD ? a.nD(a, b, e) : e; | |
k = a.CH; | |
f = k.x; | |
isNaN(f) && (f = a.location.x); | |
k = k.y; | |
isNaN(k) && (k = a.location.y); | |
h = a.xH; | |
m = h.x; | |
isNaN(m) && (m = a.location.x); | |
h = h.y; | |
isNaN(h) && (h = a.location.y); | |
d.m(Math.max(f, Math.min(c.x, m)), Math.max(k, Math.min(c.y, h))); | |
e !== b && u.v(e); | |
return d | |
}; | |
function mg(a, b) { | |
if (null === b) { | |
return !0 | |
} | |
var c = b.W; | |
return null === c || c instanceof lf || c.layer.zc || a.dc && a.dc.contains(c) || a.oc && a.oc.contains(c) ? !0 : !1 | |
} | |
function ng(a, b, c, d) { | |
var e = a.g; | |
if (null !== e) { | |
a.Hi && (null !== a.Sc && (a.Sc.V = null, a.Sc.ba = null), vg(a, !1)); | |
var f = !1; | |
!1 === a.gv && (f = e.gb, e.gb = !0); | |
var h = wg(e, b, null, function(b) { | |
return !mg(a, b) | |
}), | |
k = e.N; | |
k.qe = h; | |
var l = e.gb; | |
e.gb = !0; | |
var m = dg(a, k, h); | |
if (a.oa || null !== Ef) { | |
if (null === h) { | |
var n = e.GH; | |
null !== n && (n(k), m = !0) | |
} | |
if (a.oa || null !== Ef) { | |
if (a.doDragOver(b, h), a.oa || null !== Ef) { | |
e.gb = l, m && e.df(), !1 === a.gv && (e.gb = f), (e.Se || e.Te) && (c || d) && xg(e, k.hf) | |
} | |
} | |
} | |
} | |
} | |
function dg(a, b, c) { | |
var d = !1, | |
e = a.Yi.length, | |
f = 0 < e ? a.Yi[0] : null; | |
if (c === f) { | |
return !1 | |
} | |
b.Tc = !1; | |
for (var h = 0; h < e; h++) { | |
var k = a.Yi[h], | |
l = k.FH; | |
if (null !== l && (l(b, k, c), d = !0, b.Tc)) { | |
break | |
} | |
} | |
a.Yi.length = 0; | |
if (!a.oa && null === Ef || null === c) { | |
return d | |
} | |
for (b.Tc = !1; null !== c;) { | |
a.Yi.push(c), c = yg(c) | |
} | |
e = a.Yi.length; | |
for (h = 0; h < e && (k = a.Yi[h], l = k.EH, null === l || (l(b, k, f), d = !0, !b.Tc)); h++) {} | |
return d | |
} | |
function yg(a) { | |
var b = a.P; | |
return null !== b ? b : a instanceof G && !(a instanceof V) && (a = a.Sa, null !== a && a.PG) ? a : null | |
} | |
function zg(a, b, c) { | |
var d = a.qi; | |
if (null === d) { | |
return null | |
} | |
var e = a.g.Cm(b, d.gE, function(a) { | |
return d.findValidLinkablePort(a, c) | |
}); | |
a = u.K(); | |
for (var f = Infinity, h = null, e = e.i; e.next();) { | |
var k = e.value; | |
if (null !== k.W) { | |
var l = k.eb(Ib, a), | |
l = b.Lj(l); | |
l < f && (h = k, f = l) | |
} | |
} | |
u.v(a); | |
return h | |
} | |
function vg(a, b) { | |
var c = a.Sc; | |
if (null !== c && !(2 > c.ka)) { | |
var d = a.g; | |
if (null !== d && !d.nb && (d = a.qi, null !== d)) { | |
var e = null, | |
f = null; | |
null === c.V && (e = zg(a, c.l(0), !1), null !== e && (f = e.W)); | |
var h = null, | |
k = null; | |
null === c.ba && (h = zg(a, c.l(c.ka - 1), !0), null !== h && (k = h.W)); | |
d.isValidLink(f, e, k, h) ? b ? (c.ln = c.l(0).copy(), c.pn = c.l(c.ka - 1).copy(), c.kp = !1, c.V = f, null !== e && (c.rg = e.Kd), c.ba = k, null !== h && (c.mh = h.Kd)) : Ag(d, f, e, k, h) : Ag(d, null, null, null, null) | |
} | |
} | |
} | |
uf.prototype.doDragOver = function() {}; | |
function Bg(a, b) { | |
var c = a.g; | |
if (null !== c) { | |
a.Hi && vg(a, !0); | |
Zf(a); | |
var d = wg(c, b, null, function(b) { | |
return !mg(a, b) | |
}), | |
e = c.N; | |
e.qe = d; | |
if (null !== d) { | |
e.Tc = !1; | |
for (var f = d; null !== f;) { | |
var h = f.Dz; | |
if (null !== h && (h(e, f), e.Tc)) { | |
break | |
} | |
f = yg(f) | |
} | |
} else { | |
h = c.Dz, null !== h && h(e) | |
} | |
if (a.oa || null !== Ef) { | |
if (a.doDropOnto(b, d), a.oa || null !== Ef) { | |
for (d = c.selection.i; d.next();) { | |
e = d.value, e instanceof U && Cg(c, e.ca) | |
} | |
} | |
} | |
} | |
} | |
uf.prototype.doDropOnto = function() {}; | |
uf.prototype.doMouseMove = function() { | |
if (this.oa) { | |
var a = this.g; | |
if (null !== a && null !== this.ts && null !== this.dc) { | |
var b = !1, | |
c = !1; | |
this.mayCopy() ? (b = !0, a.bc = "copy", ig(this, !1), Df(this, this.oc), jg(this, this.oc, !1), $f(this, this.oc)) : this.mayMove() ? (c = !0, a.bc = "default", cg(this), jg(this, this.dc, !0)) : this.mayDragOut() ? (a.bc = "no-drop", ig(this, !1), jg(this, this.oc, !1)) : cg(this); | |
ng(this, a.N.da, c, b) | |
} | |
} | |
}; | |
uf.prototype.doMouseUp = function() { | |
if (this.oa) { | |
var a = this.g; | |
if (null !== a) { | |
var b = !1, | |
c = this.mayCopy(); | |
c && null !== this.oc ? (cg(this), ig(this, !0), Df(this, this.oc), jg(this, this.oc, !1), $f(this, this.oc), null !== this.oc && a.DE(this.oc.Oi())) : (b = !0, cg(this), this.mayMove() && (jg(this, this.dc, !0), this.gv = !1, ng(this, a.N.da, !0, !1), this.gv = !0)); | |
this.Tp = !0; | |
Bg(this, a.N.da); | |
if (this.oa) { | |
this.oc = null; | |
if (b && null !== this.dc) { | |
for (b = this.dc.i; b.next();) { | |
var d = b.key; | |
d instanceof U && (d = d.Sa, null === d || null === d.placeholder || this.dc.contains(d) || d.aD && d.S()) | |
} | |
} | |
a.pc(); | |
$f(this, this.dc); | |
this.Af = c ? "Copy" : "Move"; | |
a.Ba(c ? "SelectionCopied" : "SelectionMoved", a.selection) | |
} | |
this.stopTool() | |
} | |
} | |
}; | |
uf.prototype.mayCopy = function() { | |
if (!this.MD) { | |
return !1 | |
} | |
var a = this.g; | |
if (null === a || a.nb || a.vf || !a.no || !a.Ij || (u.Im ? !a.N.alt : !a.N.control)) { | |
return !1 | |
} | |
for (a = a.selection.i; a.next();) { | |
var b = a.value; | |
if (b.Hd() && b.canCopy()) { | |
return !0 | |
} | |
} | |
return null !== this.Sc && this.Hi && this.Sc.canCopy() ? !0 : !1 | |
}; | |
uf.prototype.mayDragOut = function() { | |
if (!this.MD) { | |
return !1 | |
} | |
var a = this.g; | |
if (null === a || !a.Bv || !a.Ij || a.Nk) { | |
return !1 | |
} | |
for (a = a.selection.i; a.next();) { | |
var b = a.value; | |
if (b.Hd() && b.canCopy()) { | |
return !0 | |
} | |
} | |
return null !== this.Sc && this.Hi && this.Sc.canCopy() ? !0 : !1 | |
}; | |
uf.prototype.mayMove = function() { | |
var a = this.g; | |
if (null === a || a.nb || !a.Nk) { | |
return !1 | |
} | |
for (a = a.selection.i; a.next();) { | |
var b = a.value; | |
if (b.Hd() && b.canMove()) { | |
return !0 | |
} | |
} | |
return null !== this.Sc && this.Hi && this.Sc.canMove() ? !0 : !1 | |
}; | |
var ag = new E(uf), | |
Ef = null, | |
Ff = null; | |
uf.prototype.mayDragIn = function() { | |
var a = this.g; | |
if (null === a || !a.MC || a.nb || a.vf || !a.no) { | |
return !1 | |
} | |
var b = Ef; | |
return null === b || b.g.ha.Sk !== a.ha.Sk ? !1 : !0 | |
}; | |
uf.prototype.doSimulatedDragEnter = function() { | |
if (this.mayDragIn()) { | |
var a = this.g; | |
a.Mb.Ni(); | |
Dg(a); | |
a = Ef; | |
null !== a && (a.g.bc = "copy") | |
} | |
}; | |
uf.prototype.doSimulatedDragLeave = function() { | |
var a = Ef; | |
null !== a && a.doSimulatedDragOut(); | |
this.doCancel() | |
}; | |
uf.prototype.doSimulatedDragOver = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = Ef; | |
null !== b && null !== b.dc && this.mayDragIn() && (a.bc = "copy", Eg(this, b.dc.Oi(), !1), jg(this, this.oc, !1), ng(this, a.N.da, !1, !0)) | |
} | |
}; | |
uf.prototype.doSimulatedDrop = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = Ef; | |
null !== b && (b.Tp = !0, cg(this), this.mayDragIn() && (this.Xb("Drop"), Eg(this, b.dc.Oi(), !0), jg(this, this.oc, !1), null !== this.oc && a.DE(this.oc.Oi()), this.Af = "ExternalCopy", Bg(this, a.N.da), a.pc(), this.oc = null, a.focus(), a.Ba("ExternalObjectsDropped", a.selection), this.Uj())) | |
} | |
}; | |
function Eg(a, b, c) { | |
if (null === a.oc) { | |
var d = a.g; | |
if (null !== d && !d.nb && !d.vf) { | |
d.gb = !c; | |
d.Ym = !c; | |
a.Tj = d.N.da; | |
d = d.vo(b, d, !0); | |
c = u.Tf(); | |
hg(b, c); | |
var e = c.x + c.width / 2, | |
f = c.y + c.height / 2; | |
u.ic(c); | |
var h = a.iv; | |
c = new la(G); | |
var k = u.K(); | |
for (b = b.i; b.next();) { | |
var l = b.value; | |
if (l.Hd() && l.canCopy()) { | |
var m = l.location, | |
l = d.ua(l); | |
k.m(h.x - (e - m.x), h.y - (f - m.y)); | |
l.location = k; | |
l.rf(); | |
c.add(l, If(k)) | |
} | |
} | |
u.v(k); | |
for (d = d.i; d.next();) { | |
e = d.value, e instanceof W && e.canCopy() && c.add(e, If()) | |
} | |
a.oc = c; | |
Cf(a, c.Oi()); | |
null !== a.Sc && (c = a.Sc, d = c.Qm, c.ml(a.Tj.x - (d.x + d.width / 2), a.Tj.y - (d.y + d.height / 2))) | |
} | |
} | |
} | |
uf.prototype.doSimulatedDragOut = function() { | |
var a = this.g; | |
null !== a && (this.mayCopy() || this.mayMove() ? a.bc = "" : a.bc = "no-drop") | |
}; | |
function Jf(a) { | |
this.point = a; | |
this.IE = K.Wj | |
} | |
u.fa("DraggingInfo", Jf); | |
function kg(a, b, c) { | |
this.Bc = a; | |
this.info = b; | |
this.MG = c | |
} | |
function Fg() { | |
0 < arguments.length && u.Xc(Fg); | |
xe.call(this); | |
this.XB = 100; | |
this.xB = !1; | |
var a = new W, | |
b = new X; | |
b.vg = !0; | |
b.stroke = "blue"; | |
a.add(b); | |
b = new X; | |
b.lp = "Standard"; | |
b.fill = "blue"; | |
b.stroke = "blue"; | |
a.add(b); | |
a.xf = "Tool"; | |
this.tC = a; | |
a = new U; | |
b = new X; | |
b.Kd = ""; | |
b.Fb = "Rectangle"; | |
b.fill = null; | |
b.stroke = "magenta"; | |
b.jb = 2; | |
b.za = K.Vw; | |
a.add(b); | |
a.ql = !1; | |
a.xf = "Tool"; | |
this.rC = a; | |
this.sC = b; | |
a = new U; | |
b = new X; | |
b.Kd = ""; | |
b.Fb = "Rectangle"; | |
b.fill = null; | |
b.stroke = "magenta"; | |
b.jb = 2; | |
b.za = K.Vw; | |
a.add(b); | |
a.ql = !1; | |
a.xf = "Tool"; | |
this.uC = a; | |
this.vC = b; | |
this.TB = this.SB = this.OB = this.NB = this.PB = null; | |
this.sB = !0; | |
this.FF = new la(T, "boolean"); | |
this.YB = this.xk = this.nC = null | |
} | |
u.Ha(Fg, xe); | |
u.fa("LinkingBaseTool", Fg); | |
Fg.prototype.doStop = function() { | |
var a = this.g; | |
null !== a && Kf(a); | |
this.hh = this.gh = this.fh = this.eh = this.qc = null; | |
this.Pw.clear(); | |
this.Sf = null | |
}; | |
u.defineProperty(Fg, { | |
gE: "portGravity" | |
}, function() { | |
return this.XB | |
}, function(a) { | |
u.j(a, "number", Fg, "portGravity"); | |
0 <= a && (this.XB = a) | |
}); | |
u.defineProperty(Fg, { | |
Ko: "isUnconnectedLinkValid" | |
}, function() { | |
return this.xB | |
}, function(a) { | |
u.j(a, "boolean", Fg, "isUnconnectedLinkValid"); | |
this.xB = a | |
}); | |
u.defineProperty(Fg, { | |
Fg: "temporaryLink" | |
}, function() { | |
return this.tC | |
}, function(a) { | |
u.C(a, W, Fg, "temporaryLink"); | |
this.tC = a | |
}); | |
u.defineProperty(Fg, { | |
re: "temporaryFromNode" | |
}, function() { | |
return this.rC | |
}, function(a) { | |
u.C(a, U, Fg, "temporaryFromNode"); | |
this.rC = a | |
}); | |
u.defineProperty(Fg, { | |
Sm: "temporaryFromPort" | |
}, function() { | |
return this.sC | |
}, function(a) { | |
u.C(a, T, Fg, "temporaryFromPort"); | |
this.sC = a | |
}); | |
u.defineProperty(Fg, { | |
se: "temporaryToNode" | |
}, function() { | |
return this.uC | |
}, function(a) { | |
u.C(a, U, Fg, "temporaryToNode"); | |
this.uC = a | |
}); | |
u.defineProperty(Fg, { | |
Tm: "temporaryToPort" | |
}, function() { | |
return this.vC | |
}, function(a) { | |
u.C(a, T, Fg, "temporaryToPort"); | |
this.vC = a | |
}); | |
u.defineProperty(Fg, { | |
qc: "originalLink" | |
}, function() { | |
return this.PB | |
}, function(a) { | |
null !== a && u.C(a, W, Fg, "originalLink"); | |
this.PB = a | |
}); | |
u.defineProperty(Fg, { | |
eh: "originalFromNode" | |
}, function() { | |
return this.NB | |
}, function(a) { | |
null !== a && u.C(a, U, Fg, "originalFromNode"); | |
this.NB = a | |
}); | |
u.defineProperty(Fg, { | |
fh: "originalFromPort" | |
}, function() { | |
return this.OB | |
}, function(a) { | |
null !== a && u.C(a, T, Fg, "originalFromPort"); | |
this.OB = a | |
}); | |
u.defineProperty(Fg, { | |
gh: "originalToNode" | |
}, function() { | |
return this.SB | |
}, function(a) { | |
null !== a && u.C(a, U, Fg, "originalToNode"); | |
this.SB = a | |
}); | |
u.defineProperty(Fg, { | |
hh: "originalToPort" | |
}, function() { | |
return this.TB | |
}, function(a) { | |
null !== a && u.C(a, T, Fg, "originalToPort"); | |
this.TB = a | |
}); | |
u.defineProperty(Fg, { | |
ae: "isForwards" | |
}, function() { | |
return this.sB | |
}, function(a) { | |
u.j(a, "boolean", Fg, "isForwards"); | |
this.sB = a | |
}); | |
u.u(Fg, { | |
Pw: "validPortsCache" | |
}, function() { | |
return this.FF | |
}); | |
u.defineProperty(Fg, { | |
Sf: "targetPort" | |
}, function() { | |
return this.nC | |
}, function(a) { | |
null !== a && u.C(a, T, Fg, "targetPort"); | |
this.nC = a | |
}); | |
Fg.prototype.copyPortProperties = function(a, b, c, d, e) { | |
if (null !== a && null !== b && null !== c && null !== d) { | |
d.za = b.ca.size; | |
e ? (d.xb = b.xb, d.wl = b.wl) : (d.vb = b.vb, d.Yk = b.Yk); | |
c.af = Ib; | |
var f = u.K(); | |
c.location = b.eb(Ib, f); | |
u.v(f); | |
d.angle = b.Zk(); | |
null !== this.yw && this.yw(a, b, c, d, e) | |
} | |
}; | |
Fg.prototype.setNoTargetPortProperties = function(a, b, c) { | |
null !== b && (b.za = K.Vw, b.vb = vb, b.xb = vb); | |
null !== a && (a.location = this.g.N.da); | |
null !== this.yw && this.yw(null, null, a, b, c) | |
}; | |
Fg.prototype.doMouseDown = function() { | |
this.oa && this.doMouseMove() | |
}; | |
Fg.prototype.doMouseMove = function() { | |
if (this.oa) { | |
var a = this.g; | |
if (null !== a) { | |
this.Sf = this.findTargetPort(this.ae); | |
if (null !== this.Sf) { | |
var b = this.Sf.W; | |
if (b instanceof U) { | |
this.ae ? this.copyPortProperties(b, this.Sf, this.se, this.Tm, !0) : this.copyPortProperties(b, this.Sf, this.re, this.Sm, !1); | |
return | |
} | |
} | |
this.ae ? this.setNoTargetPortProperties(this.se, this.Tm, !0) : this.setNoTargetPortProperties(this.re, this.Sm, !1); | |
(a.Se || a.Te) && xg(a, a.N.hf) | |
} | |
} | |
}; | |
Fg.prototype.findValidLinkablePort = function(a, b) { | |
if (null === a) { | |
return null | |
} | |
var c = a.W; | |
if (!(c instanceof U)) { | |
return null | |
} | |
for (; null !== a;) { | |
var d = b ? a.OE : a.wD; | |
if (!0 === d && (null !== a.Kd || a instanceof U) && (b ? this.isValidTo(c, a) : this.isValidFrom(c, a))) { | |
return a | |
} | |
if (!1 === d) { | |
break | |
} | |
a = a.P | |
} | |
return null | |
}; | |
Fg.prototype.findTargetPort = function(a) { | |
var b = this.g, | |
c = b.N.da, | |
d = this.gE; | |
0 >= d && (d = 0.1); | |
for (var e = this, f = b.Cm(c, d, function(b) { | |
return e.findValidLinkablePort(b, a) | |
}, null, !0), d = Infinity, b = null, f = f.i; f.next();) { | |
var h = f.value, | |
k = h.W; | |
if (k instanceof U) { | |
var l = h.eb(Ib, u.K()), | |
m = c.x - l.x, | |
n = c.y - l.y; | |
u.v(l); | |
l = m * m + n * n; | |
l < d && (m = this.Pw.ua(h), null !== m ? m && (b = h, d = l) : a && this.isValidLink(this.eh, this.fh, k, h) || !a && this.isValidLink(k, h, this.gh, this.hh) ? (this.Pw.add(h, !0), b = h, d = l) : this.Pw.add(h, !1)) | |
} | |
} | |
return null !== b && (c = b.W, c instanceof U && (null === c.layer || c.layer.js)) ? b : null | |
}; | |
Fg.prototype.isValidFrom = function(a, b) { | |
if (null === a || null === b) { | |
return this.Ko | |
} | |
if (this.g.Va === this && (null !== a.layer && !a.layer.js || !0 !== b.wD)) { | |
return !1 | |
} | |
var c = b.EG; | |
if (Infinity > c) { | |
if (null !== this.qc && a === this.eh && b === this.fh) { | |
return !0 | |
} | |
var d = b.Kd; | |
null === d && (d = ""); | |
if (a.Wv(d).count >= c) { | |
return !1 | |
} | |
} | |
return !0 | |
}; | |
Fg.prototype.isValidTo = function(a, b) { | |
if (null === a || null === b) { | |
return this.Ko | |
} | |
if (this.g.Va === this && (null !== a.layer && !a.layer.js || !0 !== b.OE)) { | |
return !1 | |
} | |
var c = b.BI; | |
if (Infinity > c) { | |
if (null !== this.qc && a === this.gh && b === this.hh) { | |
return !0 | |
} | |
var d = b.Kd; | |
null === d && (d = ""); | |
if (a.qg(d).count >= c) { | |
return !1 | |
} | |
} | |
return !0 | |
}; | |
Fg.prototype.isInSameNode = function(a, b) { | |
if (null === a || null === b) { | |
return !1 | |
} | |
if (a === b) { | |
return !0 | |
} | |
var c = a.W, | |
d = b.W; | |
return null !== c && c === d | |
}; | |
Fg.prototype.isLinked = function(a, b) { | |
if (null === a || null === b) { | |
return !1 | |
} | |
var c = a.W; | |
if (!(c instanceof U)) { | |
return !1 | |
} | |
var d = a.Kd; | |
null === d && (d = ""); | |
var e = b.W; | |
if (!(e instanceof U)) { | |
return !1 | |
} | |
var f = b.Kd; | |
null === f && (f = ""); | |
for (e = e.qg(f); e.next();) { | |
if (f = e.value, f.V === c && f.rg === d) { | |
return !0 | |
} | |
} | |
return !1 | |
}; | |
Fg.prototype.isValidLink = function(a, b, c, d) { | |
if (!this.isValidFrom(a, b) || !this.isValidTo(c, d) || !(null === b || null === d || (b.DG && d.AI || !this.isInSameNode(b, d)) && (b.CG && d.zI || !this.isLinked(b, d))) || null !== this.qc && (null !== a && this.isLabelDependentOnLink(a, this.qc) || null !== c && this.isLabelDependentOnLink(c, this.qc)) || null !== a && null !== c && (null === a.data && null !== c.data || null !== a.data && null === c.data) || !this.isValidCycle(a, c, this.qc)) { | |
return !1 | |
} | |
if (null !== a) { | |
var e = a.qw; | |
if (null !== e && !e(a, b, c, d, this.qc)) { | |
return !1 | |
} | |
} | |
if (null !== c && (e = c.qw, null !== e && !e(a, b, c, d, this.qc))) { | |
return !1 | |
} | |
e = this.qw; | |
return null !== e ? e(a, b, c, d, this.qc) : !0 | |
}; | |
Fg.prototype.isLabelDependentOnLink = function(a, b) { | |
if (null === a) { | |
return !1 | |
} | |
var c = a.de; | |
if (null === c) { | |
return !1 | |
} | |
if (c === b) { | |
return !0 | |
} | |
var d = new F(U); | |
d.add(a); | |
return Gg(this, c, b, d) | |
}; | |
function Gg(a, b, c, d) { | |
if (b === c) { | |
return !0 | |
} | |
var e = b.V; | |
if (null !== e && e.uf && (d.add(e), Gg(a, e.de, c, d))) { | |
return !0 | |
} | |
b = b.ba; | |
return null !== b && b.uf && (d.add(b), Gg(a, b.de, c, d)) ? !0 : !1 | |
} | |
Fg.prototype.isValidCycle = function(a, b, c) { | |
void 0 === c && (c = null); | |
if (null === a || null === b) { | |
return this.Ko | |
} | |
var d = this.g.GI; | |
if (d !== Hg) { | |
if (d === Ig) { | |
if (null !== c && !c.Ac) { | |
return !0 | |
} | |
for (d = b.pe; d.next();) { | |
var e = d.value; | |
if (e !== c && e.Ac && e.ba === b) { | |
return !1 | |
} | |
} | |
return !Jg(this, a, b, c, !0) | |
} | |
if (d === Kg) { | |
if (null !== c && !c.Ac) { | |
return !0 | |
} | |
for (d = a.pe; d.next();) { | |
if (e = d.value, e !== c && e.Ac && e.V === a) { | |
return !1 | |
} | |
} | |
return !Jg(this, a, b, c, !0) | |
} | |
if (d === Lg) { | |
return a === b ? a = !0 : (d = new F(U), d.add(b), a = Ug(this, d, a, b, c)), !a | |
} | |
if (d === Vg) { | |
return !Jg(this, a, b, c, !1) | |
} | |
if (d === Wg) { | |
return a === b ? a = !0 : (d = new F(U), d.add(b), a = Xg(this, d, a, b, c)), !a | |
} | |
} | |
return !0 | |
}; | |
function Jg(a, b, c, d, e) { | |
if (b === c) { | |
return !0 | |
} | |
if (null === b || null === c) { | |
return !1 | |
} | |
for (var f = b.pe; f.next();) { | |
var h = f.value; | |
if (h !== d && (!e || h.Ac) && h.ba === b && (h = h.V, h !== b && Jg(a, h, c, d, e))) { | |
return !0 | |
} | |
} | |
return !1 | |
} | |
function Ug(a, b, c, d, e) { | |
if (c === d) { | |
return !0 | |
} | |
if (null === c || null === d || b.contains(c)) { | |
return !1 | |
} | |
b.add(c); | |
for (var f = c.pe; f.next();) { | |
var h = f.value; | |
if (h !== e && h.ba === c && (h = h.V, h !== c && Ug(a, b, h, d, e))) { | |
return !0 | |
} | |
} | |
return !1 | |
} | |
function Xg(a, b, c, d, e) { | |
if (c === d) { | |
return !0 | |
} | |
if (null === c || null === d || b.contains(c)) { | |
return !1 | |
} | |
b.add(c); | |
for (var f = c.pe; f.next();) { | |
var h = f.value; | |
if (h !== e) { | |
var k = h.V, | |
h = h.ba, | |
k = k === c ? h : k; | |
if (k !== c && Xg(a, b, k, d, e)) { | |
return !0 | |
} | |
} | |
} | |
return !1 | |
} | |
u.defineProperty(Fg, { | |
qw: "linkValidation" | |
}, function() { | |
return this.xk | |
}, function(a) { | |
null !== a && u.j(a, "function", Fg, "linkValidation"); | |
this.xk = a | |
}); | |
u.defineProperty(Fg, { | |
yw: "portTargeted" | |
}, function() { | |
return this.YB | |
}, function(a) { | |
null !== a && u.j(a, "function", Fg, "portTargeted"); | |
this.YB = a | |
}); | |
function ta() { | |
0 < arguments.length && u.Xc(ta); | |
Fg.call(this); | |
this.name = "Linking"; | |
this.hx = {}; | |
this.gx = null; | |
this.la = Yg; | |
this.zy = this.jC = null | |
} | |
u.Ha(ta, Fg); | |
u.fa("LinkingTool", ta); | |
var Yg; | |
ta.Either = Yg = u.s(ta, "Either", 0); | |
var Zg; | |
ta.ForwardsOnly = Zg = u.s(ta, "ForwardsOnly", 0); | |
var $g; | |
ta.BackwardsOnly = $g = u.s(ta, "BackwardsOnly", 0); | |
u.defineProperty(ta, { | |
PF: "archetypeLinkData" | |
}, function() { | |
return this.hx | |
}, function(a) { | |
null !== a && u.C(a, Object, ta, "archetypeLinkData"); | |
a instanceof T && u.C(a, W, ta, "archetypeLinkData"); | |
this.hx = a | |
}); | |
u.defineProperty(ta, { | |
PC: "archetypeLabelNodeData" | |
}, function() { | |
return this.gx | |
}, function(a) { | |
null !== a && u.C(a, Object, ta, "archetypeLabelNodeData"); | |
a instanceof T && u.C(a, U, ta, "archetypeLabelNodeData"); | |
this.gx = a | |
}); | |
u.defineProperty(ta, { | |
direction: "direction" | |
}, function() { | |
return this.la | |
}, function(a) { | |
u.rb(a, ta, ta, "direction"); | |
this.la = a | |
}); | |
u.defineProperty(ta, { | |
ME: "startObject" | |
}, function() { | |
return this.jC | |
}, function(a) { | |
null !== a && u.C(a, T, ta, "startObject"); | |
this.jC = a | |
}); | |
u.u(ta, { | |
Mw: "startPort" | |
}, function() { | |
return this.zy | |
}); | |
ta.prototype.canStart = function() { | |
if (!this.isEnabled) { | |
return !1 | |
} | |
var a = this.g; | |
if (null === a || a.nb || a.vf || !a.js) { | |
return !1 | |
} | |
var b = a.ha; | |
return (b instanceof Q || b instanceof qe) && a.N.left && (a.Va === this || this.isBeyondDragSize()) ? null !== this.findLinkablePort() : !1 | |
}; | |
ta.prototype.findLinkablePort = function() { | |
var a = this.g; | |
if (null === a) { | |
return null | |
} | |
var b = this.ME; | |
null === b && (b = a.le(a.uc.da, null, null)); | |
if (null === b || !(b.W instanceof U)) { | |
return null | |
} | |
a = this.direction; | |
if (a === Yg || a === Zg) { | |
var c = this.findValidLinkablePort(b, !1); | |
if (null !== c) { | |
return this.ae = !0, c | |
} | |
} | |
if (a === Yg || a === $g) { | |
if (c = this.findValidLinkablePort(b, !0), null !== c) { | |
return this.ae = !1, c | |
} | |
} | |
return null | |
}; | |
ta.prototype.doActivate = function() { | |
var a = this.g; | |
if (null !== a && (null === this.Mw && (this.zy = this.findLinkablePort()), null !== this.Mw)) { | |
this.Xb(this.name); | |
a.He = !0; | |
a.bc = "pointer"; | |
if (this.ae) { | |
this.fh = this.Mw; | |
var b = this.fh.W; | |
b instanceof U && (this.eh = b); | |
this.copyPortProperties(this.eh, this.fh, this.re, this.Sm, !1) | |
} else { | |
this.hh = this.Mw, b = this.hh.W, b instanceof U && (this.gh = b), this.copyPortProperties(this.gh, this.hh, this.se, this.Tm, !0) | |
} | |
a.add(this.re); | |
a.add(this.se); | |
null !== this.Fg && (null !== this.re && (this.Fg.V = this.re), null !== this.se && (this.Fg.ba = this.se), this.Fg.Wb(), a.add(this.Fg)); | |
this.oa = !0 | |
} | |
}; | |
ta.prototype.doDeactivate = function() { | |
this.oa = !1; | |
var a = this.g; | |
null !== a && (a.remove(this.Fg), a.remove(this.re), a.remove(this.se), a.He = !1, a.bc = "", this.Uj()) | |
}; | |
ta.prototype.doStop = function() { | |
Fg.prototype.doStop.call(this); | |
this.ME = this.zy = null | |
}; | |
ta.prototype.doMouseUp = function() { | |
if (this.oa) { | |
var a = this.g; | |
if (null === a) { | |
return | |
} | |
var b = this.Af = null, | |
c = null, | |
d = null, | |
e = null, | |
f = this.Sf = this.findTargetPort(this.ae); | |
if (null !== f) { | |
var h = f.W; | |
h instanceof U && (this.ae ? (null !== this.eh && (b = this.eh, c = this.fh), d = h, e = f) : (b = h, c = f, null !== this.gh && (d = this.gh, e = this.hh))) | |
} else { | |
this.ae ? null !== this.eh && this.Ko && (b = this.eh, c = this.fh) : null !== this.gh && this.Ko && (d = this.gh, e = this.hh) | |
} | |
if (null !== b || null !== d) { | |
b = this.insertLink(b, c, d, e), null !== b ? (null === f && (this.ae ? b.pn = a.N.da.copy() : b.ln = a.N.da.copy()), a.qf && a.select(b), this.Af = this.name, a.Ba("LinkDrawn", b)) : a.ha.XC() | |
} | |
} | |
this.stopTool() | |
}; | |
ta.prototype.insertLink = function(a, b, c, d) { | |
var e = this.g; | |
if (null === e) { | |
return null | |
} | |
var f = e.ha; | |
if (f instanceof qe) { | |
var h = a; | |
b = c; | |
e.rd || (h = c, b = a); | |
if (null !== h && null !== b) { | |
return f.kh(b.data, f.wb(h.data)), b.Bs() | |
} | |
} else { | |
if (f instanceof Q) { | |
if (h = "", null !== a && (null === b && (b = a), h = b.Kd, null === h && (h = "")), b = "", null !== c && (null === d && (d = c), b = d.Kd, null === b && (b = "")), d = this.PF, d instanceof W) { | |
if (nf(d), f = d.copy(), null !== f) { | |
return f.V = a, f.rg = h, f.ba = c, f.mh = b, e.add(f), a = this.PC, a instanceof U && (nf(a), a = a.copy(), null !== a && (a.de = f, e.add(a))), f | |
} | |
} else { | |
if (null !== d && (d = f.fD(d), u.Ta(d))) { | |
return null !== a && f.Gw(d, f.wb(a.data)), f.bA(d, h), null !== c && f.Iw(d, f.wb(c.data)), f.fA(d, b), f.yv(d), a = this.PC, null === a || a instanceof U || (a = f.copyNodeData(a), u.Ta(a) && (f.om(a), a = f.wb(a), void 0 !== a && f.Ny(d, a))), f = e.pg(d) | |
} | |
} | |
} | |
} | |
return null | |
}; | |
function Gf() { | |
0 < arguments.length && u.Xc(Gf); | |
Fg.call(this); | |
this.name = "Relinking"; | |
var a = new X; | |
a.Fb = "Diamond"; | |
a.za = K.Sw; | |
a.fill = "lightblue"; | |
a.stroke = "dodgerblue"; | |
a.cursor = "pointer"; | |
a.Qf = 0; | |
this.gB = a; | |
a = new X; | |
a.Fb = "Diamond"; | |
a.za = K.Sw; | |
a.fill = "lightblue"; | |
a.stroke = "dodgerblue"; | |
a.cursor = "pointer"; | |
a.Qf = -1; | |
this.wC = a; | |
this.Ub = null; | |
this.QB = new z | |
} | |
u.Ha(Gf, Fg); | |
u.fa("RelinkingTool", Gf); | |
Gf.prototype.updateAdornments = function(a) { | |
if (null !== a && a instanceof W) { | |
var b = "RelinkFrom", | |
c = null; | |
if (a.$a && !this.g.nb) { | |
var d = a.ot; | |
null !== d && a.canRelinkFrom() && a.ca.I() && a.Ia() && d.ca.I() && d.ll() && (c = a.Ao(b), null === c && (c = this.makeAdornment(d, !1), null !== c && (c.Jc = b), a.Kk(b, c))) | |
} | |
null === c && a.pl(b); | |
b = "RelinkTo"; | |
c = null; | |
a.$a && !this.g.nb && (d = a.ot, null !== d && a.canRelinkTo() && a.ca.I() && a.Ia() && d.ca.I() && d.ll() && (c = a.Ao(b), null === c && (c = this.makeAdornment(d, !0), null !== c && (c.Jc = b), a.Kk(b, c)))); | |
null === c && a.pl(b) | |
} | |
}; | |
Gf.prototype.makeAdornment = function(a, b) { | |
var c = new lf; | |
c.type = ah; | |
var d = b ? this.yI : this.BG; | |
null !== d && c.add(d.copy()); | |
c.xc = a; | |
return c | |
}; | |
u.defineProperty(Gf, { | |
BG: "fromHandleArchetype" | |
}, function() { | |
return this.gB | |
}, function(a) { | |
null !== a && u.C(a, T, Gf, "fromHandleArchetype"); | |
this.gB = a | |
}); | |
u.defineProperty(Gf, { | |
yI: "toHandleArchetype" | |
}, function() { | |
return this.wC | |
}, function(a) { | |
null !== a && u.C(a, T, Gf, "toHandleArchetype"); | |
this.wC = a | |
}); | |
u.u(Gf, { | |
handle: "handle" | |
}, function() { | |
return this.Ub | |
}); | |
Gf.prototype.canStart = function() { | |
if (!this.isEnabled) { | |
return !1 | |
} | |
var a = this.g; | |
if (null === a || a.nb || a.vf || !a.qm) { | |
return !1 | |
} | |
var b = a.ha; | |
if (!(b instanceof Q || b instanceof qe) || !a.N.left) { | |
return !1 | |
} | |
b = this.findToolHandleAt(a.uc.da, "RelinkFrom"); | |
null === b && (b = this.findToolHandleAt(a.uc.da, "RelinkTo")); | |
return null !== b | |
}; | |
Gf.prototype.doActivate = function() { | |
var a = this.g; | |
if (null !== a) { | |
if (null === this.qc) { | |
var b = this.findToolHandleAt(a.uc.da, "RelinkFrom"); | |
null === b && (b = this.findToolHandleAt(a.uc.da, "RelinkTo")); | |
if (null === b) { | |
return | |
} | |
var c = b.W; | |
if (!(c instanceof lf && c.Mh instanceof W)) { | |
return | |
} | |
this.Ub = b; | |
this.ae = null === c || "RelinkTo" === c.Jc; | |
this.qc = c.Mh | |
} | |
this.Xb(this.name); | |
a.He = !0; | |
a.bc = "pointer"; | |
this.fh = this.qc.qd; | |
this.eh = this.qc.V; | |
this.hh = this.qc.ge; | |
this.gh = this.qc.ba; | |
this.QB.set(this.qc.ca); | |
null !== this.qc && 0 < this.qc.ka && (null === this.qc.V && (null !== this.Sm && (this.Sm.za = K.qp), null !== this.re && (this.re.location = this.qc.l(0))), null === this.qc.ba && (null !== this.Tm && (this.Tm.za = K.qp), null !== this.se && (this.se.location = this.qc.l(this.qc.ka - 1)))); | |
this.copyPortProperties(this.eh, this.fh, this.re, this.Sm, !1); | |
this.copyPortProperties(this.gh, this.hh, this.se, this.Tm, !0); | |
a.add(this.re); | |
a.add(this.se); | |
null !== this.Fg && (null !== this.re && (this.Fg.V = this.re), null !== this.se && (this.Fg.ba = this.se), this.copyLinkProperties(this.qc, this.Fg), this.Fg.Wb(), a.add(this.Fg)); | |
this.oa = !0 | |
} | |
}; | |
Gf.prototype.copyLinkProperties = function(a, b) { | |
if (null !== a && null !== b) { | |
b.gs = a.gs; | |
b.Zy = a.Zy; | |
var c = a.We; | |
if (c === bh || c === ch) { | |
c = dh | |
} | |
b.We = c; | |
b.Ov = a.Ov; | |
b.Bw = a.Bw; | |
b.ip = a.ip; | |
b.vb = a.vb; | |
b.Yk = a.Yk; | |
b.Fs = a.Fs; | |
b.Gs = a.Gs; | |
b.xb = a.xb; | |
b.wl = a.wl; | |
b.xt = a.xt; | |
b.zt = a.zt | |
} | |
}; | |
Gf.prototype.doDeactivate = function() { | |
this.oa = !1; | |
var a = this.g; | |
null !== a && (a.remove(this.Fg), a.remove(this.re), a.remove(this.se), a.He = !1, a.bc = "", this.Uj()) | |
}; | |
Gf.prototype.doStop = function() { | |
Fg.prototype.doStop.call(this); | |
this.Ub = null | |
}; | |
Gf.prototype.doMouseUp = function() { | |
if (this.oa) { | |
var a = this.g; | |
if (null === a) { | |
return | |
} | |
this.Af = null; | |
var b = this.eh, | |
c = this.fh, | |
d = this.gh, | |
e = this.hh, | |
f = this.qc; | |
this.Sf = this.findTargetPort(this.ae); | |
if (null !== this.Sf) { | |
var h = this.Sf.W; | |
h instanceof U && (this.ae ? (d = h, e = this.Sf) : (b = h, c = this.Sf)) | |
} else { | |
this.Ko ? this.ae ? e = d = null : c = b = null : f = null | |
} | |
null !== f && (this.reconnectLink(f, this.ae ? d : b, this.ae ? e : c, this.ae), null === this.Sf && (this.ae ? f.pn = a.N.da.copy() : f.ln = a.N.da.copy(), f.Wb()), a.qf && (f.$a = !0), this.Af = this.name, a.Ba("LinkRelinked", f, this.ae ? this.hh : this.fh)); | |
eh(this.qc, this.QB) | |
} | |
this.stopTool() | |
}; | |
Gf.prototype.reconnectLink = function(a, b, c, d) { | |
if (null === this.g) { | |
return !1 | |
} | |
c = null !== c && null !== c.Kd ? c.Kd : ""; | |
d ? (a.ba = b, a.mh = c) : (a.V = b, a.rg = c); | |
return !0 | |
}; | |
function Ag(a, b, c, d, e) { | |
null !== b ? (a.copyPortProperties(b, c, a.re, a.Sm, !1), a.g.add(a.re)) : a.g.remove(a.re); | |
null !== d ? (a.copyPortProperties(d, e, a.se, a.Tm, !0), a.g.add(a.se)) : a.g.remove(a.se) | |
} | |
function fh() { | |
0 < arguments.length && u.Xc(fh); | |
xe.call(this); | |
this.name = "LinkReshaping"; | |
var a = new X; | |
a.Fb = "Rectangle"; | |
a.za = K.op; | |
a.fill = "lightblue"; | |
a.stroke = "dodgerblue"; | |
this.pk = a; | |
a = new X; | |
a.Fb = "Diamond"; | |
a.za = K.op; | |
a.fill = "lightblue"; | |
a.stroke = "dodgerblue"; | |
this.DB = a; | |
this.ZB = 3; | |
this.bx = this.Ub = null; | |
this.RB = new w; | |
this.ny = null | |
} | |
u.Ha(fh, xe); | |
u.fa("LinkReshapingTool", fh); | |
var gh; | |
fh.None = gh = u.s(fh, "None", 0); | |
var hh; | |
fh.Horizontal = hh = u.s(fh, "Horizontal", 1); | |
var ih; | |
fh.Vertical = ih = u.s(fh, "Vertical", 2); | |
var jh; | |
fh.All = jh = u.s(fh, "All", 3); | |
fh.prototype.getReshapingBehavior = fh.prototype.BD = function(a) { | |
return a && a.$B ? a.$B : gh | |
}; | |
fh.prototype.setReshapingBehavior = fh.prototype.rt = function(a, b) { | |
u.C(a, T, fh, "setReshapingBehavior:obj"); | |
u.rb(b, fh, fh, "setReshapingBehavior:behavior"); | |
a.$B = b | |
}; | |
fh.prototype.updateAdornments = function(a) { | |
if (null !== a && a instanceof W) { | |
if (a.$a && !this.g.nb) { | |
var b = a.path; | |
if (null !== b && a.canReshape() && a.ca.I() && a.Ia() && b.ca.I() && b.ll()) { | |
var c = a.Ao(this.name); | |
if (null === c || c.yF !== a.ka || c.HF !== a.jt) { | |
c = this.makeAdornment(b), null !== c && (c.yF = a.ka, c.HF = a.jt, a.Kk(this.name, c)) | |
} | |
if (null !== c) { | |
c.location = a.position; | |
return | |
} | |
} | |
} | |
a.pl(this.name) | |
} | |
}; | |
fh.prototype.makeAdornment = function(a) { | |
var b = a.W, | |
c = b.ka, | |
d = b.ec, | |
e = null; | |
if (null !== b.points && 1 < c) { | |
e = new lf; | |
e.type = ah; | |
var c = b.Cs, | |
f = b.mw, | |
h = d ? 1 : 0; | |
if (b.jt && b.We !== kh) { | |
for (var k = c + h; k < f - h; k++) { | |
var l = this.makeResegmentHandle(a, k); | |
null !== l && (l.Qf = k, l.Dw = 0.5, e.add(l)) | |
} | |
} | |
for (k = c + 1; k < f; k++) { | |
if (l = this.makeHandle(a, k), null !== l) { | |
l.Qf = k; | |
if (k !== c) { | |
if (k === c + 1 && d) { | |
var h = b.l(c), | |
m = b.l(c + 1); | |
K.D(h.x, m.x) && K.D(h.y, m.y) && (m = b.l(c - 1)); | |
K.D(h.x, m.x) ? (this.rt(l, ih), l.cursor = "n-resize") : K.D(h.y, m.y) && (this.rt(l, hh), l.cursor = "w-resize") | |
} else { | |
k === f - 1 && d ? (h = b.l(f - 1), m = b.l(f), K.D(h.x, m.x) && K.D(h.y, m.y) && (h = b.l(f + 1)), K.D(h.x, m.x) ? (this.rt(l, ih), l.cursor = "n-resize") : K.D(h.y, m.y) && (this.rt(l, hh), l.cursor = "w-resize")) : k !== f && (this.rt(l, jh), l.cursor = "move") | |
} | |
} | |
e.add(l) | |
} | |
} | |
e.Jc = this.name; | |
e.xc = a | |
} | |
return e | |
}; | |
fh.prototype.makeHandle = function() { | |
var a = this.Is; | |
return null === a ? null : a.copy() | |
}; | |
u.defineProperty(fh, { | |
Is: "handleArchetype" | |
}, function() { | |
return this.pk | |
}, function(a) { | |
null !== a && u.C(a, T, fh, "handleArchetype"); | |
this.pk = a | |
}); | |
fh.prototype.makeResegmentHandle = function() { | |
var a = this.BH; | |
return null === a ? null : a.copy() | |
}; | |
u.defineProperty(fh, { | |
BH: "midHandleArchetype" | |
}, function() { | |
return this.DB | |
}, function(a) { | |
null !== a && u.C(a, T, fh, "midHandleArchetype"); | |
this.DB = a | |
}); | |
u.u(fh, { | |
handle: "handle" | |
}, function() { | |
return this.Ub | |
}); | |
u.u(fh, { | |
hs: "adornedLink" | |
}, function() { | |
return this.bx | |
}); | |
fh.prototype.canStart = function() { | |
if (!this.isEnabled) { | |
return !1 | |
} | |
var a = this.g; | |
return null !== a && !a.nb && a.Dv && a.N.left ? null !== this.findToolHandleAt(a.uc.da, this.name) : !1 | |
}; | |
fh.prototype.doActivate = function() { | |
var a = this.g; | |
if (null !== a && (this.Ub = this.findToolHandleAt(a.uc.da, this.name), null !== this.Ub)) { | |
var b = this.Ub.W.Mh; | |
if (b instanceof W) { | |
this.bx = b; | |
a.He = !0; | |
this.Xb(this.name); | |
if (b.jt && 0.5 === this.Ub.Dw) { | |
var c = b.points.copy(), | |
d = this.Ub.eb(Ib); | |
c.Zd(this.Ub.Qf + 1, d); | |
b.ec && c.Zd(this.Ub.Qf + 1, d); | |
b.points = c; | |
b.$d(); | |
this.Ub = this.findToolHandleAt(a.uc.da, this.name); | |
if (null === this.Ub) { | |
this.doDeactivate(); | |
return | |
} | |
} | |
this.RB = b.l(this.Ub.Qf); | |
this.ny = b.points.copy(); | |
this.oa = !0 | |
} | |
} | |
}; | |
fh.prototype.doDeactivate = function() { | |
this.Uj(); | |
this.bx = this.Ub = null; | |
var a = this.g; | |
null !== a && (a.He = !1); | |
this.oa = !1 | |
}; | |
fh.prototype.doCancel = function() { | |
var a = this.hs; | |
null !== a && (a.points = this.ny); | |
this.stopTool() | |
}; | |
fh.prototype.doMouseMove = function() { | |
var a = this.g; | |
this.oa && null !== a && (a = this.computeReshape(a.N.da), this.reshape(a)) | |
}; | |
fh.prototype.doMouseUp = function() { | |
var a = this.g; | |
if (this.oa && null !== a) { | |
var b = this.computeReshape(a.N.da); | |
this.reshape(b); | |
b = this.hs; | |
if (null !== b && b.jt) { | |
var c = this.handle.Qf, | |
d = b.l(c - 1), | |
e = b.l(c), | |
f = b.l(c + 1); | |
if (b.ec) { | |
if (c > b.Cs + 1 && c < b.mw - 1) { | |
var h = b.l(c - 2); | |
if (Math.abs(d.x - e.x) < this.ih && Math.abs(d.y - e.y) < this.ih && (lh(this, h, d, e, f, !0) || lh(this, h, d, e, f, !1))) { | |
var k = b.points.copy(); | |
lh(this, h, d, e, f, !0) ? (k.Dg(c - 2, new w(h.x, (f.y + h.y) / 2)), k.Dg(c + 1, new w(f.x, (f.y + h.y) / 2))) : (k.Dg(c - 2, new w((f.x + h.x) / 2, h.y)), k.Dg(c + 1, new w((f.x + h.x) / 2, f.y))); | |
k.kd(c); | |
k.kd(c - 1); | |
b.points = k; | |
b.$d() | |
} else { | |
h = b.l(c + 2), Math.abs(e.x - f.x) < this.ih && Math.abs(e.y - f.y) < this.ih && (lh(this, d, e, f, h, !0) || lh(this, d, e, f, h, !1)) && (k = b.points.copy(), lh(this, d, e, f, h, !0) ? (k.Dg(c - 1, new w(d.x, (d.y + h.y) / 2)), k.Dg(c + 2, new w(h.x, (d.y + h.y) / 2))) : (k.Dg(c - 1, new w((d.x + h.x) / 2, d.y)), k.Dg(c + 2, new w((d.x + h.x) / 2, h.y))), k.kd(c + 1), k.kd(c), b.points = k, b.$d()) | |
} | |
} | |
} else { | |
h = u.K(), K.Lm(d.x, d.y, f.x, f.y, e.x, e.y, h) && h.Lj(e) < this.ih * this.ih && (k = b.points.copy(), k.kd(c), b.points = k, b.$d()), u.v(h) | |
} | |
} | |
a.pc(); | |
this.Af = this.name; | |
a.Ba("LinkReshaped", this.hs) | |
} | |
this.stopTool() | |
}; | |
function lh(a, b, c, d, e, f) { | |
return f ? Math.abs(b.y - c.y) < a.ih && Math.abs(c.y - d.y) < a.ih && Math.abs(d.y - e.y) < a.ih : Math.abs(b.x - c.x) < a.ih && Math.abs(c.x - d.x) < a.ih && Math.abs(d.x - e.x) < a.ih | |
} | |
u.defineProperty(fh, { | |
ih: "resegmentingDistance" | |
}, function() { | |
return this.ZB | |
}, function(a) { | |
u.j(a, "number", fh, "resegmentingDistance"); | |
this.ZB = a | |
}); | |
fh.prototype.reshape = function(a) { | |
var b = this.hs; | |
b.sl(); | |
var c = this.handle.Qf, | |
d = this.BD(this.handle); | |
if (b.ec) { | |
if (c === b.Cs + 1) { | |
c = b.Cs + 1, d === ih ? (b.U(c, b.l(c - 1).x, a.y), b.U(c + 1, b.l(c + 2).x, a.y)) : d === hh && (b.U(c, a.x, b.l(c - 1).y), b.U(c + 1, a.x, b.l(c + 2).y)) | |
} else { | |
if (c === b.mw - 1) { | |
c = b.mw - 1, d === ih ? (b.U(c - 1, b.l(c - 2).x, a.y), b.U(c, b.l(c + 1).x, a.y)) : d === hh && (b.U(c - 1, a.x, b.l(c - 2).y), b.U(c, a.x, b.l(c + 1).y)) | |
} else { | |
var d = c, | |
e = b.l(d), | |
f = b.l(d - 1), | |
h = b.l(d + 1); | |
K.D(f.x, e.x) && K.D(e.y, h.y) ? (K.D(f.x, b.l(d - 2).x) && !K.D(f.y, b.l(d - 2).y) ? (b.w(d, a.x, f.y), c++, d++) : b.U(d - 1, a.x, f.y), K.D(h.y, b.l(d + 2).y) && !K.D(h.x, b.l(d + 2).x) ? b.w(d + 1, h.x, a.y) : b.U(d + 1, h.x, a.y)) : K.D(f.y, e.y) && K.D(e.x, h.x) ? (K.D(f.y, b.l(d - 2).y) && !K.D(f.x, b.l(d - 2).x) ? (b.w(d, f.x, a.y), c++, d++) : b.U(d - 1, f.x, a.y), K.D(h.x, b.l(d + 2).x) && !K.D(h.y, b.l(d + 2).y) ? b.w(d + 1, a.x, h.y) : b.U(d + 1, a.x, h.y)) : K.D(f.x, e.x) && K.D(e.x, h.x) ? (K.D(f.x, b.l(d - 2).x) && !K.D(f.y, b.l(d - 2).y) ? (b.w(d, a.x, f.y), c++, d++) : b.U(d - 1, a.x, f.y), K.D(h.x, b.l(d + 2).x) && !K.D(h.y, b.l(d + 2).y) ? b.w(d + 1, a.x, h.y) : b.U(d + 1, a.x, h.y)) : K.D(f.y, e.y) && K.D(e.y, h.y) && (K.D(f.y, b.l(d - 2).y) && !K.D(f.x, b.l(d - 2).x) ? (b.w(d, f.x, a.y), c++, d++) : b.U(d - 1, f.x, a.y), K.D(h.y, b.l(d + 2).y) && !K.D(h.x, b.l(d + 2).x) ? b.w(d + 1, h.x, a.y) : b.U(d + 1, h.x, a.y)); | |
b.U(c, a.x, a.y) | |
} | |
} | |
} else { | |
b.U(c, a.x, a.y), 1 === c && b.computeSpot(!0).oe() && (e = b.V, f = b.qd, null === e || e.Ia() || (e = e.findVisibleNode(), e !== b.V && (f = e.Xk(""))), d = f.eb(Ib, u.K()), e = b.getLinkPointFromPoint(e, f, d, a, !0, u.K()), b.U(0, e.x, e.y), u.v(d), u.v(e)), c === b.ka - 2 && b.computeSpot(!1).oe() && (c = b.ba, e = b.ge, null === c || c.Ia() || (c = c.findVisibleNode(), c !== b.ba && (e = c.Xk(""))), d = e.eb(Ib, u.K()), e = b.getLinkPointFromPoint(c, e, d, a, !1, u.K()), b.U(b.ka - 1, e.x, e.y), u.v(d), u.v(e)) | |
} | |
b.Ci() | |
}; | |
fh.prototype.computeReshape = function(a) { | |
var b = this.hs, | |
c = this.handle.Qf; | |
switch (this.BD(this.handle)) { | |
case jh: | |
return a; | |
case ih: | |
return b = b.l(c), new w(b.x, a.y); | |
case hh: | |
return b = b.l(c), new w(a.x, b.y); | |
default: | |
case gh: | |
return b.l(c) | |
} | |
}; | |
u.u(fh, { | |
kK: "originalPoint" | |
}, function() { | |
return this.RB | |
}); | |
u.u(fh, { | |
lK: "originalPoints" | |
}, function() { | |
return this.ny | |
}); | |
function mh() { | |
0 < arguments.length && u.Xc(mh); | |
xe.call(this); | |
this.name = "Resizing"; | |
this.nj = (new ia(1, 1)).freeze(); | |
this.lj = (new ia(9999, 9999)).freeze(); | |
this.Ti = (new ia(NaN, NaN)).freeze(); | |
this.kq = !1; | |
this.Gb = null; | |
var a = new X; | |
a.Hj = Ib; | |
a.Fb = "Rectangle"; | |
a.za = K.op; | |
a.fill = "lightblue"; | |
a.stroke = "dodgerblue"; | |
a.jb = 1; | |
a.cursor = "pointer"; | |
this.pk = a; | |
this.Ub = null; | |
this.Vu = new ia; | |
this.my = new w; | |
this.Lx = new ia(0, 0); | |
this.Kx = new ia(Infinity, Infinity); | |
this.Jx = new ia(1, 1); | |
this.KB = !0 | |
} | |
u.Ha(mh, xe); | |
u.fa("ResizingTool", mh); | |
mh.prototype.updateAdornments = function(a) { | |
if (!(null === a || a instanceof W)) { | |
if (a.$a && !this.g.nb) { | |
var b = a.tE; | |
if (null !== b && a.canResize() && a.ca.I() && a.Ia() && b.ca.I() && b.ll()) { | |
var c = a.Ao(this.name); | |
null === c && (c = this.makeAdornment(b)); | |
if (null !== c) { | |
var d = b.Zk(); | |
c.angle = d; | |
var e = b.eb(c.af, u.K()), | |
f = b.Ii(); | |
c.location = e; | |
u.v(e); | |
e = c.placeholder; | |
if (null !== e) { | |
var b = b.Ja, | |
h = u.vl(); | |
h.m(b.width * f, b.height * f); | |
e.za = h; | |
u.Oj(h) | |
} | |
nh(this, c, d); | |
a.Kk(this.name, c); | |
return | |
} | |
} | |
} | |
a.pl(this.name) | |
} | |
}; | |
mh.prototype.makeAdornment = function(a) { | |
var b = null, | |
b = a.W.sE; | |
if (null === b) { | |
b = new lf; | |
b.type = oh; | |
b.af = Ib; | |
var c = new ph; | |
c.vg = !0; | |
b.add(c); | |
b.add(this.makeHandle(a, xb)); | |
b.add(this.makeHandle(a, Gb)); | |
b.add(this.makeHandle(a, Vb)); | |
b.add(this.makeHandle(a, Qb)); | |
b.add(this.makeHandle(a, vc)); | |
b.add(this.makeHandle(a, xc)); | |
b.add(this.makeHandle(a, Cc)); | |
b.add(this.makeHandle(a, wc)) | |
} else { | |
if (nf(b), b = b.copy(), null === b) { | |
return null | |
} | |
} | |
b.Jc = this.name; | |
b.xc = a; | |
return b | |
}; | |
mh.prototype.makeHandle = function(a, b) { | |
var c = this.Is; | |
if (null === c) { | |
return null | |
} | |
c = c.copy(); | |
c.alignment = b; | |
return c | |
}; | |
function nh(a, b, c) { | |
if (null !== b) { | |
if (!b.alignment.Kc() && "" !== b.cursor) { | |
a: { | |
a = b.alignment;a.oe() && (a = Ib); | |
if (0 >= a.x) { | |
c = 0 >= a.y ? c + 225 : 1 <= a.y ? c + 135 : c + 180 | |
} else { | |
if (1 <= a.x) { | |
0 >= a.y ? c += 315 : 1 <= a.y && (c += 45) | |
} else { | |
if (0 >= a.y) { | |
c += 270 | |
} else { | |
if (1 <= a.y) { | |
c += 90 | |
} else { | |
break a | |
} | |
} | |
} | |
} | |
0 > c ? c += 360 : 360 <= c && (c -= 360);b.cursor = 22.5 > c ? "e-resize" : 67.5 > c ? "se-resize" : 112.5 > c ? "s-resize" : 157.5 > c ? "sw-resize" : 202.5 > c ? "w-resize" : 247.5 > c ? "nw-resize" : 292.5 > c ? "n-resize" : 337.5 > c ? "ne-resize" : "e-resize" | |
} | |
} | |
else { | |
if (b instanceof B) { | |
for (b = b.elements; b.next();) { | |
nh(a, b.value, c) | |
} | |
} | |
} | |
} | |
} | |
u.defineProperty(mh, { | |
Is: "handleArchetype" | |
}, function() { | |
return this.pk | |
}, function(a) { | |
null !== a && u.C(a, T, mh, "handleArchetype"); | |
this.pk = a | |
}); | |
u.u(mh, { | |
handle: "handle" | |
}, function() { | |
return this.Ub | |
}); | |
u.defineProperty(mh, { | |
xc: "adornedObject" | |
}, function() { | |
return this.Gb | |
}, function(a) { | |
null !== a && u.C(a, T, mh, "adornedObject"); | |
this.Gb = a | |
}); | |
mh.prototype.canStart = function() { | |
if (!this.isEnabled) { | |
return !1 | |
} | |
var a = this.g; | |
return null !== a && !a.nb && a.ks && a.N.left ? null !== this.findToolHandleAt(a.uc.da, this.name) ? !0 : !1 : !1 | |
}; | |
mh.prototype.doActivate = function() { | |
var a = this.g; | |
null !== a && (this.Ub = this.findToolHandleAt(a.uc.da, this.name), null !== this.Ub && (this.Gb = this.Ub.W.xc, this.my.set(this.Gb.W.location), this.Vu.set(this.Gb.za), this.Jx = this.computeCellSize(), this.Lx = this.computeMinSize(), this.Kx = this.computeMaxSize(), a.He = !0, this.KB = a.Mb.isEnabled, a.Mb.isEnabled = !1, this.Xb(this.name), this.oa = !0)) | |
}; | |
mh.prototype.doDeactivate = function() { | |
var a = this.g; | |
null !== a && (this.Uj(), this.Gb = this.Ub = null, this.oa = a.He = !1, a.Mb.isEnabled = this.KB) | |
}; | |
mh.prototype.doCancel = function() { | |
this.Gb.za = this.Vu; | |
this.Gb.W.location = this.my; | |
this.stopTool() | |
}; | |
mh.prototype.doMouseMove = function() { | |
var a = this.g; | |
if (this.oa && null !== a) { | |
var b = this.Lx, | |
c = this.Kx, | |
d = this.Jx, | |
e = this.Gb.AD(a.N.da, u.K()), | |
f = qh; | |
this.Gb instanceof X && (f = rh(this.Gb)); | |
b = this.computeResize(e, this.Ub.alignment, b, c, d, !(f === sh || f === th || a.N.shift)); | |
this.resize(b); | |
a.df(); | |
u.v(e) | |
} | |
}; | |
mh.prototype.doMouseUp = function() { | |
var a = this.g; | |
if (this.oa && null !== a) { | |
var b = this.Lx, | |
c = this.Kx, | |
d = this.Jx, | |
e = this.Gb.AD(a.N.da, u.K()), | |
f = qh; | |
this.Gb instanceof X && (f = rh(this.Gb)); | |
b = this.computeResize(e, this.Ub.alignment, b, c, d, !(f === sh || f === th || a.N.shift)); | |
this.resize(b); | |
u.v(e); | |
a.pc(); | |
this.Af = this.name; | |
a.Ba("PartResized", this.Gb, this.Vu) | |
} | |
this.stopTool() | |
}; | |
mh.prototype.resize = function(a) { | |
if (null !== this.g) { | |
var b = this.xc, | |
c = b.W, | |
d = b.Zk(), | |
e = b.Ii(), | |
f = Math.PI * d / 180, | |
h = Math.cos(f), | |
f = Math.sin(f), | |
k = 0 < d && 180 > d ? 1 : 0, | |
l = 90 < d && 270 > d ? 1 : 0, | |
d = 180 < d && 360 > d ? 1 : 0, | |
m = b.Ja.width, | |
n = b.Ja.height; | |
b.za = a.size; | |
var p = c.position.copy(); | |
c.rf(); | |
m = b.Ja.width - m; | |
n = b.Ja.height - n; | |
if (0 !== m || 0 !== n) { | |
0 !== m && (p.x += e * ((a.x + m * l) * h - (a.y + n * k) * f)), 0 !== n && (p.y += e * ((a.x + m * d) * f + (a.y + n * l) * h)), c.move(p), c instanceof U && c.$e() | |
} | |
} | |
}; | |
mh.prototype.computeResize = function(a, b, c, d, e, f) { | |
b.oe() && (b = Ib); | |
var h = this.xc.Ja, | |
k = h.x, | |
l = h.y, | |
m = h.x + h.width, | |
n = h.y + h.height, | |
p = 1; | |
if (!f) { | |
var p = h.width, | |
q = h.height; | |
0 >= p && (p = 1); | |
0 >= q && (q = 1); | |
p = q / p | |
} | |
q = u.K(); | |
K.ys(a.x, a.y, k, l, e.width, e.height, q); | |
a = h.copy(); | |
0 >= b.x ? 0 >= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = Math.max(n - a.y, c.height), f || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) : (a.width = a.height / p, a.x = m - a.width))) : 1 <= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), f || (b = a.height / a.width, p < b ? a.height = p * a.width : (a.width = a.height / p, a.x = m - a.width))) : (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = m - a.x, f || (a.height = p * a.width, a.y = l + 0.5 * (n - l - a.height))) : 1 <= b.x ? 0 >= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = Math.max(n - a.y, c.height), f || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) : a.width = a.height / p)) : 1 <= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), f || (b = a.height / a.width, p < b ? a.height = p * a.width : a.width = a.height / p)) : (a.width = Math.max(Math.min(q.x - k, d.width), c.width), f || (a.height = p * a.width, a.y = l + 0.5 * (n - l - a.height))) : 0 >= b.y ? (a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = n - a.y, f || (a.width = a.height / p, a.x = k + 0.5 * (m - k - a.width))) : 1 <= b.y && (a.height = Math.max(Math.min(q.y - l, d.height), c.height), f || (a.width = a.height / p, a.x = k + 0.5 * (m - k - a.width))); | |
u.v(q); | |
return a | |
}; | |
mh.prototype.computeMinSize = function() { | |
var a = this.xc.xg.copy(), | |
b = this.xg; | |
!isNaN(b.width) && b.width > a.width && (a.width = b.width); | |
!isNaN(b.height) && b.height > a.height && (a.height = b.height); | |
return a | |
}; | |
mh.prototype.computeMaxSize = function() { | |
var a = this.xc.cf.copy(), | |
b = this.cf; | |
!isNaN(b.width) && b.width < a.width && (a.width = b.width); | |
!isNaN(b.height) && b.height < a.height && (a.height = b.height); | |
return a | |
}; | |
mh.prototype.computeCellSize = function() { | |
var a = new ia(NaN, NaN), | |
b = this.xc.W; | |
if (null !== b) { | |
var c = b.XH; | |
!isNaN(c.width) && 0 < c.width && (a.width = c.width); | |
!isNaN(c.height) && 0 < c.height && (a.height = c.height) | |
} | |
c = this.so; | |
isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width); | |
isNaN(a.height) && !isNaN(c.height) && 0 < c.height && (a.height = c.height); | |
b = this.g; | |
(isNaN(a.width) || isNaN(a.height)) && b && (c = b.tb.Gd, null !== c && c.hw && (c = c.DD, 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.Hs, null !== b && b.visible && this.hw && (c = b.aw, 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 | |
}; | |
u.defineProperty(mh, { | |
xg: "minSize" | |
}, function() { | |
return this.nj | |
}, function(a) { | |
u.C(a, ia, mh, "minSize"); | |
if (!this.nj.L(a)) { | |
var b = a.width; | |
isNaN(b) && (b = 0); | |
a = a.height; | |
isNaN(a) && (a = 0); | |
this.nj.m(b, a) | |
} | |
}); | |
u.defineProperty(mh, { | |
cf: "maxSize" | |
}, function() { | |
return this.lj | |
}, function(a) { | |
u.C(a, ia, mh, "maxSize"); | |
if (!this.lj.L(a)) { | |
var b = a.width; | |
isNaN(b) && (b = Infinity); | |
a = a.height; | |
isNaN(a) && (a = Infinity); | |
this.lj.m(b, a) | |
} | |
}); | |
u.defineProperty(mh, { | |
so: "cellSize" | |
}, function() { | |
return this.Ti | |
}, function(a) { | |
u.C(a, ia, mh, "cellSize"); | |
this.Ti.L(a) || this.Ti.assign(a) | |
}); | |
u.defineProperty(mh, { | |
hw: "isGridSnapEnabled" | |
}, function() { | |
return this.kq | |
}, function(a) { | |
u.j(a, "boolean", mh, "isGridSnapEnabled"); | |
this.kq = a | |
}); | |
u.u(mh, { | |
iK: "originalDesiredSize" | |
}, function() { | |
return this.Vu | |
}); | |
u.u(mh, { | |
jK: "originalLocation" | |
}, function() { | |
return this.my | |
}); | |
function uh() { | |
0 < arguments.length && u.Xc(uh); | |
xe.call(this); | |
this.name = "Rotating"; | |
this.gC = 45; | |
this.fC = 2; | |
this.Gb = null; | |
var a = new X; | |
a.Fb = "Ellipse"; | |
a.za = K.Sw; | |
a.fill = "lightblue"; | |
a.stroke = "dodgerblue"; | |
a.jb = 1; | |
a.cursor = "pointer"; | |
this.pk = a; | |
this.Ub = null; | |
this.Uu = 0; | |
this.aC = new w | |
} | |
u.Ha(uh, xe); | |
u.fa("RotatingTool", uh); | |
uh.prototype.updateAdornments = function(a) { | |
if (!(null === a || a instanceof W)) { | |
if (a.$a && !this.g.nb) { | |
var b = a.wE; | |
if (null !== b && a.canRotate() && a.ca.I() && a.Ia() && b.ca.I() && b.ll()) { | |
var c = a.Ao(this.name); | |
null === c && (c = this.makeAdornment(b)); | |
if (null !== c) { | |
c.angle = b.Zk(); | |
var d = null, | |
e = null; | |
b === a || b === a.fc ? (d = a.fc, e = a.af) : (d = b, e = Ib); | |
for (var f = d.Ja, e = u.Yb(f.width * e.x + e.offsetX, f.height * e.y + e.offsetY); null !== d && d !== b;) { | |
d.transform.bb(e), d = d.P | |
} | |
var d = e.y, | |
f = Math.max(e.x - b.Ja.width, 0), | |
h = u.K(); | |
c.location = b.eb(new L(1, 0, 50 + f, d), h); | |
u.v(h); | |
u.v(e); | |
a.Kk(this.name, c); | |
return | |
} | |
} | |
} | |
a.pl(this.name) | |
} | |
}; | |
uh.prototype.makeAdornment = function(a) { | |
var b = null, | |
b = a.W.$H; | |
if (null === b) { | |
b = new lf; | |
b.type = vh; | |
b.af = Ib; | |
var c = this.Is; | |
null !== c && b.add(c.copy()) | |
} else { | |
if (nf(b), b = b.copy(), null === b) { | |
return null | |
} | |
} | |
b.Jc = this.name; | |
b.xc = a; | |
return b | |
}; | |
u.defineProperty(uh, { | |
Is: "handleArchetype" | |
}, function() { | |
return this.pk | |
}, function(a) { | |
null !== a && u.C(a, T, uh, "handleArchetype"); | |
this.pk = a | |
}); | |
u.u(uh, { | |
handle: "handle" | |
}, function() { | |
return this.Ub | |
}); | |
u.defineProperty(uh, { | |
xc: "adornedObject" | |
}, function() { | |
return this.Gb | |
}, function(a) { | |
null !== a && u.C(a, T, uh, "adornedObject"); | |
this.Gb = a | |
}); | |
uh.prototype.canStart = function() { | |
if (!this.isEnabled) { | |
return !1 | |
} | |
var a = this.g; | |
return null !== a && !a.nb && a.Ev && a.N.left ? null !== this.findToolHandleAt(a.uc.da, this.name) ? !0 : !1 : !1 | |
}; | |
uh.prototype.doActivate = function() { | |
var a = this.g; | |
if (null !== a && (this.Ub = this.findToolHandleAt(a.uc.da, this.name), null !== this.Ub)) { | |
this.Gb = this.Ub.W.xc; | |
var b = this.Gb.W, | |
c = b.fc; | |
this.aC = this.Gb === b || this.Gb === c ? c.eb(b.af) : this.Gb.eb(Ib); | |
this.Uu = this.Gb.angle; | |
a.He = !0; | |
a.bz = !0; | |
this.Xb(this.name); | |
this.oa = !0 | |
} | |
}; | |
uh.prototype.doDeactivate = function() { | |
var a = this.g; | |
null !== a && (this.Uj(), this.Gb = this.Ub = null, this.oa = a.He = !1) | |
}; | |
uh.prototype.doCancel = function() { | |
var a = this.g; | |
null !== a && (a.bz = !1); | |
this.rotate(this.Uu); | |
this.stopTool() | |
}; | |
uh.prototype.doMouseMove = function() { | |
var a = this.g; | |
this.oa && null !== a && (a = this.computeRotate(a.N.da), this.rotate(a)) | |
}; | |
uh.prototype.doMouseUp = function() { | |
var a = this.g; | |
if (this.oa && null !== a) { | |
a.bz = !1; | |
var b = this.computeRotate(a.N.da); | |
this.rotate(b); | |
a.pc(); | |
this.Af = this.name; | |
a.Ba("PartRotated", this.Gb, this.Uu) | |
} | |
this.stopTool() | |
}; | |
uh.prototype.rotate = function(a) { | |
null !== this.Gb && (this.Gb.angle = a) | |
}; | |
uh.prototype.computeRotate = function(a) { | |
a = this.aC.Gi(a); | |
var b = this.Gb.P; | |
null !== b && (a -= b.Zk(), 360 <= a ? a -= 360 : 0 > a && (a += 360)); | |
var b = Math.min(Math.abs(this.oI), 180), | |
c = Math.min(Math.abs(this.nI), b / 2); | |
!this.g.N.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 | |
}; | |
u.defineProperty(uh, { | |
oI: "snapAngleMultiple" | |
}, function() { | |
return this.gC | |
}, function(a) { | |
u.j(a, "number", uh, "snapAngleMultiple"); | |
this.gC = a | |
}); | |
u.defineProperty(uh, { | |
nI: "snapAngleEpsilon" | |
}, function() { | |
return this.fC | |
}, function(a) { | |
u.j(a, "number", uh, "snapAngleEpsilon"); | |
this.fC = a | |
}); | |
u.u(uh, { | |
hK: "originalAngle" | |
}, function() { | |
return this.Uu | |
}); | |
function wh() { | |
0 < arguments.length && u.Xc(wh); | |
xe.call(this); | |
this.name = "ClickSelecting" | |
} | |
u.Ha(wh, xe); | |
u.fa("ClickSelectingTool", wh); | |
wh.prototype.canStart = function() { | |
return !this.isEnabled || null === this.g || this.isBeyondDragSize() ? !1 : !0 | |
}; | |
wh.prototype.doMouseUp = function() { | |
this.oa && (this.standardMouseSelect(), this.standardMouseClick()); | |
this.stopTool() | |
}; | |
function xh() { | |
0 < arguments.length && u.Xc(xh); | |
xe.call(this); | |
this.name = "Action"; | |
this.Xm = null | |
} | |
u.Ha(xh, xe); | |
u.fa("ActionTool", xh); | |
xh.prototype.canStart = function() { | |
if (!this.isEnabled) { | |
return !1 | |
} | |
var a = this.g; | |
if (null === a) { | |
return !1 | |
} | |
var b = a.N, | |
c = a.le(b.da, function(a) { | |
for (; null !== a.P && !a.qz;) { | |
a = a.P | |
} | |
return a | |
}); | |
if (null !== c) { | |
if (!c.qz) { | |
return !1 | |
} | |
this.Xm = c; | |
a.gn = a.le(b.da, null, null); | |
return !0 | |
} | |
return !1 | |
}; | |
xh.prototype.doMouseDown = function() { | |
if (this.oa) { | |
var a = this.g.N, | |
b = this.Xm; | |
null !== b && (a.qe = b, null !== b.HC && b.HC(a, b)) | |
} else { | |
this.canStart() && this.doActivate() | |
} | |
}; | |
xh.prototype.doMouseMove = function() { | |
if (this.oa) { | |
var a = this.g.N, | |
b = this.Xm; | |
null !== b && (a.qe = b, null !== b.IC && b.IC(a, b)) | |
} | |
}; | |
xh.prototype.doMouseUp = function() { | |
if (this.oa) { | |
var a = this.g, | |
b = a.N, | |
c = this.Xm; | |
if (null === c) { | |
return | |
} | |
b.qe = c; | |
null !== c.JC && c.JC(b, c); | |
this.isBeyondDragSize() || zf(c, b, a) | |
} | |
this.stopTool() | |
}; | |
xh.prototype.doCancel = function() { | |
var a = this.g; | |
if (null !== a) { | |
var a = a.N, | |
b = this.Xm; | |
if (null === b) { | |
return | |
} | |
a.qe = b; | |
null !== b.GC && b.GC(a, b) | |
} | |
this.stopTool() | |
}; | |
xh.prototype.doStop = function() { | |
this.Xm = null | |
}; | |
function va() { | |
0 < arguments.length && u.Xc(va); | |
xe.call(this); | |
this.name = "ClickCreating"; | |
this.ik = null; | |
this.qB = !0; | |
this.fB = new w(0, 0) | |
} | |
u.Ha(va, xe); | |
u.fa("ClickCreatingTool", va); | |
va.prototype.canStart = function() { | |
if (!this.isEnabled || null === this.Qy) { | |
return !1 | |
} | |
var a = this.g; | |
if (null === a || a.nb || a.vf || !a.no || !a.N.left || this.isBeyondDragSize()) { | |
return !1 | |
} | |
if (this.$G) { | |
if (1 === a.N.Ue && (this.fB = a.N.hf.copy()), 2 !== a.N.Ue || this.isBeyondDragSize(this.fB)) { | |
return !1 | |
} | |
} else { | |
if (1 !== a.N.Ue) { | |
return !1 | |
} | |
} | |
return a.Va !== this && null !== a.As(a.N.da, !0) ? !1 : !0 | |
}; | |
va.prototype.doMouseUp = function() { | |
var a = this.g; | |
this.oa && null !== a && this.insertPart(a.N.da); | |
this.stopTool() | |
}; | |
va.prototype.insertPart = function(a) { | |
var b = this.g; | |
if (null === b) { | |
return null | |
} | |
var c = this.Qy; | |
if (null === c) { | |
return null | |
} | |
this.Xb(this.name); | |
var d = null; | |
c instanceof G ? c.Hd() && (nf(c), d = c.copy(), null !== d && b.add(d)) : null !== c && (c = b.ha.copyNodeData(c), u.Ta(c) && (b.ha.om(c), d = b.Ph(c))); | |
null !== d && (d.location = a, b.qf && b.select(d)); | |
b.pc(); | |
this.Af = this.name; | |
b.Ba("PartCreated", d); | |
this.Uj(); | |
return d | |
}; | |
u.defineProperty(va, { | |
Qy: "archetypeNodeData" | |
}, function() { | |
return this.ik | |
}, function(a) { | |
null !== a && u.C(a, Object, va, "archetypeNodeData"); | |
this.ik = a | |
}); | |
u.defineProperty(va, { | |
$G: "isDoubleClick" | |
}, function() { | |
return this.qB | |
}, function(a) { | |
u.j(a, "boolean", va, "isDoubleClick"); | |
this.qB = a | |
}); | |
function yh(a, b, c) { | |
this.text = a; | |
this.ZC = b; | |
this.visible = c | |
} | |
function Ih() { | |
0 < arguments.length && u.Xc(Ih); | |
xe.call(this); | |
this.name = "ContextMenu"; | |
this.hn = this.OA = null; | |
this.HB = new w; | |
this.zx = this.qn = null; | |
Jh(this) | |
} | |
u.Ha(Ih, xe); | |
u.fa("ContextMenuTool", Ih); | |
u.iD = !1; | |
u.os = null; | |
u.ps = null; | |
function Jh(a) { | |
a.qn = new lf; | |
a.xC = function() { | |
a.stopTool() | |
}; | |
if (!1 === u.iD) { | |
var b = u.createElement("div"), | |
c = u.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 = u.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)); | |
u.ps = b; | |
u.os = c; | |
u.iD = !0 | |
} | |
} | |
Ih.prototype.canStart = function() { | |
if (!this.isEnabled) { | |
return !1 | |
} | |
var a = this.g; | |
return null === a || this.isBeyondDragSize() || !a.N.right ? !1 : null !== this.qn && a.N.kl || null !== this.findObjectWithContextMenu() ? !0 : !1 | |
}; | |
Ih.prototype.doStart = function() { | |
var a = this.g; | |
null !== a && this.HB.set(a.uc.da) | |
}; | |
Ih.prototype.doStop = function() { | |
this.hideDefaultContextMenu(); | |
this.hideContextMenu(); | |
this.hn = null | |
}; | |
Ih.prototype.findObjectWithContextMenu = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b) { | |
return null | |
} | |
var c = b.N, | |
d = null; | |
a instanceof D || (d = a instanceof T ? a : b.le(c.da, null, function(a) { | |
return !a.layer.zc | |
})); | |
if (null !== d) { | |
for (a = d; null !== a;) { | |
c = a.contextMenu; | |
if (null !== c) { | |
return a | |
} | |
a = a.P | |
} | |
if (null !== this.qn && b.N.kl) { | |
return d.W | |
} | |
} else { | |
if (c = b.contextMenu, null !== c) { | |
return b | |
} | |
} | |
return null | |
}; | |
Ih.prototype.doActivate = function() {}; | |
Ih.prototype.doMouseUp = function() { | |
var a = this.g; | |
null !== a && (this.oa ? null !== this.If && (a = a.le(a.N.da, null, null), null !== a && a.gl(this.If) && this.standardMouseClick(null, null), this.stopTool()) : this.canStart() && xf(this, !0)) | |
}; | |
function xf(a, b, c) { | |
void 0 === c && (c = null); | |
a.oa = !0; | |
b && a.standardMouseSelect(); | |
a.standardMouseClick(); | |
a.hn = null; | |
null === c && (c = a.findObjectWithContextMenu()); | |
null !== c ? (b = c.contextMenu, null !== b ? (a.hn = c instanceof T ? c : null, a.showContextMenu(b, a.hn)) : a.showDefaultContextMenu()) : a.showDefaultContextMenu() | |
} | |
Ih.prototype.doMouseMove = function() { | |
this.oa && this.standardMouseOver() | |
}; | |
Ih.prototype.showContextMenu = function(a, b) { | |
u.C(a, lf, Ih, "showContextMenu:contextmenu"); | |
null !== b && u.C(b, T, Ih, "showContextMenu:obj"); | |
var c = this.g; | |
if (null !== c) { | |
a !== this.If && this.hideContextMenu(); | |
a.xf = "Tool"; | |
a.ql = !1; | |
a.scale = 1 / c.scale; | |
a.Jc = this.name; | |
c.add(a); | |
if (null !== b) { | |
var c = null, | |
d = b.Co(); | |
null !== d && (c = d.data); | |
a.xc = b; | |
a.data = c | |
} else { | |
a.data = c.ha | |
} | |
a.rf(); | |
this.positionContextMenu(a, b); | |
this.If = a | |
} | |
}; | |
Ih.prototype.positionContextMenu = function(a) { | |
if (null === a.placeholder) { | |
var b = this.g; | |
if (null !== b) { | |
var c = b.N.da.copy(), | |
d = a.Ca, | |
e = b.ob; | |
b.N.kl && (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 | |
} | |
} | |
}; | |
Ih.prototype.hideContextMenu = function() { | |
var a = this.g; | |
null !== a && null !== this.If && (this.If.data = null, this.If.xc = null, a.remove(this.If), this.If = null, this.standardMouseOver()) | |
}; | |
Ih.prototype.initializeDefaultButtons = function() { | |
if (null === this.g) { | |
return null | |
} | |
var a = new E(yh); | |
a.add(new yh("Copy", function(a) { | |
a.Eb.copySelection() | |
}, function(a) { | |
return a.Eb.canCopySelection() | |
})); | |
a.add(new yh("Cut", function(a) { | |
a.Eb.cutSelection() | |
}, function(a) { | |
return a.Eb.canCutSelection() | |
})); | |
a.add(new yh("Delete", function(a) { | |
a.Eb.deleteSelection() | |
}, function(a) { | |
return a.Eb.canDeleteSelection() | |
})); | |
a.add(new yh("Paste", function(a) { | |
a.Eb.pasteSelection(a.N.da) | |
}, function(a) { | |
return a.Eb.canPasteSelection() | |
})); | |
a.add(new yh("Select All", function(a) { | |
a.Eb.selectAll() | |
}, function(a) { | |
return a.Eb.canSelectAll() | |
})); | |
a.add(new yh("Undo", function(a) { | |
a.Eb.undo() | |
}, function(a) { | |
return a.Eb.canUndo() | |
})); | |
a.add(new yh("Redo", function(a) { | |
a.Eb.redo() | |
}, function(a) { | |
return a.Eb.canRedo() | |
})); | |
a.add(new yh("Zoom To Fit", function(a) { | |
a.Eb.zoomToFit() | |
}, function(a) { | |
return a.Eb.canZoomToFit() | |
})); | |
a.add(new yh("Reset Zoom", function(a) { | |
a.Eb.resetZoom() | |
}, function(a) { | |
return a.Eb.canResetZoom() | |
})); | |
a.add(new yh("Group Selection", function(a) { | |
a.Eb.groupSelection() | |
}, function(a) { | |
return a.Eb.canGroupSelection() | |
})); | |
a.add(new yh("Ungroup Selection", function(a) { | |
a.Eb.ungroupSelection() | |
}, function(a) { | |
return a.Eb.canUngroupSelection() | |
})); | |
a.add(new yh("Edit Text", function(a) { | |
a.Eb.editTextBlock() | |
}, function(a) { | |
return a.Eb.canEditTextBlock() | |
})); | |
return a | |
}; | |
Ih.prototype.showDefaultContextMenu = function() { | |
var a = this.g; | |
if (null !== a) { | |
null === this.zx && (this.zx = this.initializeDefaultButtons()); | |
this.qn !== this.If && this.hideContextMenu(); | |
u.ps.innerHTML = ""; | |
u.os.addEventListener("click", this.xC, !1); | |
var b = this, | |
c = u.createElement("ul"); | |
c.className = "defaultCXul"; | |
u.ps.appendChild(c); | |
c.innerHTML = ""; | |
for (var d = this.zx.i; d.next();) { | |
var e = d.value, | |
f = e.text, | |
h = e.visible; | |
if ("function" === typeof e.ZC && ("function" !== typeof h || h(a))) { | |
h = u.createElement("li"); | |
h.className = "defaultCXli"; | |
var k = u.createElement("a"); | |
k.className = "defaultCXa"; | |
k.href = "#"; | |
k.nF = e.ZC; | |
k.addEventListener("click", function(c) { | |
this.nF(a); | |
b.stopTool(); | |
c.preventDefault(); | |
return !1 | |
}, !1); | |
k.textContent = f; | |
h.appendChild(k); | |
c.appendChild(h) | |
} | |
} | |
u.ps.style.display = "block"; | |
u.os.style.display = "block"; | |
this.If = this.qn | |
} | |
}; | |
Ih.prototype.hideDefaultContextMenu = function() { | |
null !== this.If && this.If === this.qn && (u.ps.style.display = "none", u.os.style.display = "none", u.os.removeEventListener("click", this.xC, !1), this.If = null) | |
}; | |
u.defineProperty(Ih, { | |
If: "currentContextMenu" | |
}, function() { | |
return this.OA | |
}, function(a) { | |
null !== a && u.C(a, lf, Ih, "currentContextMenu"); | |
this.OA = a | |
}); | |
u.defineProperty(Ih, { | |
lJ: "currentObject" | |
}, function() { | |
return this.hn | |
}, function(a) { | |
null !== a && u.C(a, T, Ih, "currentObject"); | |
this.hn = a | |
}); | |
u.u(Ih, { | |
cK: "mouseDownPoint" | |
}, function() { | |
return this.HB | |
}); | |
function Kh() { | |
0 < arguments.length && u.Xc(Kh); | |
xe.call(this); | |
this.name = "DragSelecting"; | |
this.rn = 175; | |
this.vB = !1; | |
var a = new G; | |
a.xf = "Tool"; | |
a.ql = !1; | |
var b = new X; | |
b.name = "SHAPE"; | |
b.Fb = "Rectangle"; | |
b.fill = null; | |
b.stroke = "magenta"; | |
a.add(b); | |
this.Dl = a | |
} | |
u.Ha(Kh, xe); | |
u.fa("DragSelectingTool", Kh); | |
Kh.prototype.canStart = function() { | |
if (!this.isEnabled) { | |
return !1 | |
} | |
var a = this.g; | |
if (null === a || !a.qf) { | |
return !1 | |
} | |
var b = a.N; | |
return !b.left || a.Va !== this && (!this.isBeyondDragSize() || b.timestamp - a.uc.timestamp < this.jD || null !== a.As(b.da, !0)) ? !1 : !0 | |
}; | |
Kh.prototype.doActivate = function() { | |
var a = this.g; | |
null !== a && (this.oa = !0, a.He = !0, a.gb = !0, a.add(this.Vg), this.doMouseMove()) | |
}; | |
Kh.prototype.doDeactivate = function() { | |
var a = this.g; | |
null !== a && (a.remove(this.Vg), a.gb = !1, this.oa = a.He = !1) | |
}; | |
Kh.prototype.doMouseMove = function() { | |
if (null !== this.g && this.oa && null !== this.Vg) { | |
var a = this.computeBoxBounds(), | |
b = this.Vg.ke("SHAPE"); | |
null === b && (b = this.Vg.Jf()); | |
b.za = a.size; | |
this.Vg.position = a.position | |
} | |
}; | |
Kh.prototype.doMouseUp = function() { | |
if (this.oa) { | |
var a = this.g; | |
a.remove(this.Vg); | |
try { | |
a.bc = "wait", this.selectInRect(this.computeBoxBounds()) | |
} finally { | |
a.bc = "" | |
} | |
} | |
this.stopTool() | |
}; | |
Kh.prototype.computeBoxBounds = function() { | |
var a = this.g; | |
return null === a ? new z(0, 0, 0, 0) : new z(a.uc.da, a.N.da) | |
}; | |
Kh.prototype.selectInRect = function(a) { | |
var b = this.g; | |
if (null !== b) { | |
var c = b.N; | |
b.Ba("ChangingSelection"); | |
a = b.Nj(a, null, function(a) { | |
return a instanceof G ? a.canSelect() : !1 | |
}, this.hH); | |
if (u.Im ? c.Zs : c.control) { | |
if (c.shift) { | |
for (a = a.i; a.next();) { | |
c = a.value, c.$a && (c.$a = !1) | |
} | |
} else { | |
for (a = a.i; a.next();) { | |
c = a.value, c.$a = !c.$a | |
} | |
} | |
} else { | |
if (!c.shift) { | |
for (var c = new E(G), d = b.selection.i; d.next();) { | |
var e = d.value; | |
a.contains(e) || c.add(e) | |
} | |
for (c = c.i; c.next();) { | |
c.value.$a = !1 | |
} | |
} | |
for (a = a.i; a.next();) { | |
c = a.value, c.$a || (c.$a = !0) | |
} | |
} | |
b.Ba("ChangedSelection") | |
} | |
}; | |
u.defineProperty(Kh, { | |
jD: "delay" | |
}, function() { | |
return this.rn | |
}, function(a) { | |
u.j(a, "number", Kh, "delay"); | |
this.rn = a | |
}); | |
u.defineProperty(Kh, { | |
hH: "isPartialInclusion" | |
}, function() { | |
return this.vB | |
}, function(a) { | |
u.j(a, "boolean", Kh, "isPartialInclusion"); | |
this.vB = a | |
}); | |
u.defineProperty(Kh, { | |
Vg: "box" | |
}, function() { | |
return this.Dl | |
}, function(a) { | |
null !== a && u.C(a, G, Kh, "box"); | |
this.Dl = a | |
}); | |
function Lh() { | |
0 < arguments.length && u.Xc(Lh); | |
xe.call(this); | |
this.name = "Panning"; | |
this.oy = new w; | |
this.Si = !1; | |
var a = this; | |
this.lC = function() { | |
window.document.removeEventListener("scroll", a.lC, !1); | |
a.stopTool() | |
} | |
} | |
u.Ha(Lh, xe); | |
u.fa("PanningTool", Lh); | |
Lh.prototype.canStart = function() { | |
if (!this.isEnabled) { | |
return !1 | |
} | |
var a = this.g; | |
return null === a || !a.Se && !a.Te || !a.N.left || a.Va !== this && !this.isBeyondDragSize() ? !1 : !0 | |
}; | |
Lh.prototype.doActivate = function() { | |
var a = this.g; | |
null !== a && (this.Si ? (a.N.bubbles = !0, window.document.addEventListener("scroll", this.lC, !1)) : (a.bc = "move", a.He = !0, this.oy = a.position.copy()), this.oa = !0) | |
}; | |
Lh.prototype.doDeactivate = function() { | |
var a = this.g; | |
null !== a && (a.bc = "", this.oa = a.He = !1) | |
}; | |
Lh.prototype.doCancel = function() { | |
var a = this.g; | |
null !== a && (a.position = this.oy, a.He = !1); | |
this.stopTool() | |
}; | |
Lh.prototype.doMouseMove = function() { | |
this.move() | |
}; | |
Lh.prototype.doMouseUp = function() { | |
this.move(); | |
this.stopTool() | |
}; | |
Lh.prototype.move = function() { | |
var a = this.g; | |
if (this.oa && a) { | |
if (this.Si) { | |
a.N.bubbles = !0 | |
} else { | |
var b = a.position, | |
c = a.uc.da, | |
d = a.N.da, | |
e = b.x + c.x - d.x, | |
c = b.y + c.y - d.y; | |
a.Se || (e = b.x); | |
a.Te || (c = b.y); | |
a.position = new w(e, c) | |
} | |
} | |
}; | |
u.defineProperty(Lh, { | |
bubbles: "bubbles" | |
}, function() { | |
return this.Si | |
}, function(a) { | |
u.j(a, "boolean", Lh, "bubbles"); | |
this.Si = a | |
}); | |
u.u(Lh, { | |
mK: "originalPosition" | |
}, function() { | |
return this.oy | |
}); | |
function Mh() { | |
0 < arguments.length && u.Xc(Mh); | |
xe.call(this); | |
this.name = "TextEditing"; | |
this.RA = this.Fy = this.pC = null; | |
this.kC = Nh; | |
this.Hk = null; | |
this.Ya = Oh; | |
this.Dk = null; | |
this.EB = 1; | |
this.dC = !0; | |
var a = u.createElement("textarea"); | |
a.AA = !0; | |
this.WA = a; | |
a.addEventListener("input", function() { | |
var a = this.textEditingTool; | |
if (null !== a && void 0 !== a && null !== a.te) { | |
var c = a.pC; | |
c.text = this.value; | |
var d = this.xI; | |
Ph(c, a.te.Cu, Infinity); | |
this.style.width = 20 + c.Ca.width * d + "px"; | |
this.style.height = 10 + c.Ca.height * d + "px"; | |
this.rows = c.pH | |
} | |
}, !1); | |
a.addEventListener("keydown", function(a) { | |
var c = a.which, | |
d = this.textEditingTool; | |
if (null !== d && void 0 !== d && null !== d.te) { | |
if (13 === c) { | |
!1 === d.te.jw && a.preventDefault(), d.acceptText(Qh) | |
} else { | |
if (9 === c) { | |
return d.acceptText(Rh), a.preventDefault(), !1 | |
} | |
27 === c && (d.doCancel(), null !== d.g && d.g.focus()) | |
} | |
} | |
}, !1); | |
a.addEventListener("focus", function() { | |
var a = this.textEditingTool; | |
null !== a && void 0 !== a && (a.Ya === Sh ? a.Ya = Th : a.Ya === Uh ? a.Ya = Vh : a.Ya === Vh && (a.Ya = Th), "function" === typeof this.select && a.aA && (this.select(), this.setSelectionRange(0, 9999))) | |
}, !1); | |
a.addEventListener("blur", function() { | |
"function" === typeof this.focus && this.focus(); | |
var a = this.textEditingTool; | |
null !== a && void 0 !== a && "function" === typeof this.select && a.aA && (this.select(), this.setSelectionRange(0, 9999)) | |
}, !1) | |
} | |
u.fa("TextEditingTool", Mh); | |
u.Ha(Mh, xe); | |
var Wh; | |
Mh.LostFocus = Wh = u.s(Mh, "LostFocus", 0); | |
var Xh; | |
Mh.MouseDown = Xh = u.s(Mh, "MouseDown", 1); | |
var Rh; | |
Mh.Tab = Rh = u.s(Mh, "Tab", 2); | |
var Qh; | |
Mh.Enter = Qh = u.s(Mh, "Enter", 3); | |
Mh.SingleClick = u.s(Mh, "SingleClick", 0); | |
var Nh; | |
Mh.SingleClickSelected = Nh = u.s(Mh, "SingleClickSelected", 1); | |
var Oh = u.s(Mh, "StateNone", 0), | |
Sh = u.s(Mh, "StateActive", 1), | |
Th = u.s(Mh, "StateEditing", 2), | |
Vh = u.s(Mh, "StateEditing2", 3), | |
Yh = u.s(Mh, "StateValidating", 4), | |
Uh = u.s(Mh, "StateValidated", 5); | |
u.defineProperty(Mh, { | |
te: "textBlock" | |
}, function() { | |
return this.Fy | |
}, function(a) { | |
null !== a && u.C(a, qa, Mh, "textBlock"); | |
this.Fy = a | |
}); | |
u.defineProperty(Mh, { | |
og: "currentTextEditor" | |
}, function() { | |
return this.RA | |
}, function(a) { | |
this.RA = a | |
}); | |
u.defineProperty(Mh, { | |
oG: "defaultTextEditor" | |
}, function() { | |
return this.WA | |
}, function(a) { | |
u.C(a, Element, Mh, "defaultTextEditor"); | |
this.WA = a | |
}); | |
u.defineProperty(Mh, { | |
rI: "starting" | |
}, function() { | |
return this.kC | |
}, function(a) { | |
u.rb(a, Mh, Mh, "starting"); | |
this.kC = a | |
}); | |
Mh.prototype.canStart = function() { | |
if (!this.isEnabled) { | |
return !1 | |
} | |
var a = this.g; | |
if (null === a || a.nb || !a.N.left || this.isBeyondDragSize()) { | |
return !1 | |
} | |
a = a.le(a.N.da, null, function(a) { | |
return a instanceof qa | |
}); | |
if (null === a || !a.cz || !a.W.canEdit()) { | |
return !1 | |
} | |
a = a.W; | |
return null === a || this.rI === Nh && !a.$a ? !1 : !0 | |
}; | |
Mh.prototype.doStart = function() { | |
this.oa || null === this.te || this.doActivate() | |
}; | |
Mh.prototype.doActivate = function() { | |
if (!this.oa) { | |
var a = this.g; | |
if (null !== a) { | |
var b = this.te; | |
null === b && (b = a.le(a.N.da, function(a) { | |
return a instanceof qa ? a : null | |
})); | |
if (null !== b && (this.te = b, null !== b.W)) { | |
this.oa = !0; | |
this.Ya = Sh; | |
var c = this.oG, | |
d = !1; | |
null !== b.NE && (c = b.NE); | |
null === c || c.AA || (d = !0); | |
this.pC = this.te.copy(); | |
var e = new z(this.te.eb(xb), this.te.eb(Vb)); | |
a.eI(e); | |
if (c.AA) { | |
var f = b.eb(Ib), | |
h = a.position, | |
k = a.scale, | |
l = b.Ii() * k; | |
l < this.ZD && (l = this.ZD); | |
var e = b.Ja.width * l, | |
m = b.Ja.height * l, | |
n = (f.x - h.x) * k, | |
f = (f.y - h.y) * k; | |
c.value = b.text; | |
a.Vk.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 = (f - 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.Vk.appendChild(c); | |
c.style.position = "absolute"; | |
c.style.zIndex = 100; | |
c.className = "start"; | |
c.textEditingTool = this; | |
c.xI = l; | |
if (d && "function" === typeof c.onActivate) { | |
c.onActivate() | |
} | |
this.og = c; | |
"function" === typeof c.focus && c.focus(); | |
"function" === typeof c.select && this.aA && (c.select(), c.setSelectionRange(0, 9999)) | |
} | |
} | |
} | |
}; | |
Mh.prototype.doCancel = function() { | |
null !== this.Dk && (this.og.style.border = this.Dk, this.Dk = null); | |
this.stopTool() | |
}; | |
Mh.prototype.doMouseUp = function() { | |
!this.oa && this.canStart() && this.doActivate() | |
}; | |
Mh.prototype.doMouseDown = function() { | |
this.oa && this.acceptText(Xh) | |
}; | |
Mh.prototype.acceptText = function(a) { | |
switch (a) { | |
case Xh: | |
if (this.Ya === Uh || this.Ya === Vh) { | |
"function" === typeof this.og.focus && this.og.focus() | |
} else { | |
if (this.Ya === Sh || this.Ya === Th) { | |
this.Ya = Yh, Zh(this) | |
} | |
} | |
break; | |
case Wh: | |
case Qh: | |
case Rh: | |
if (Qh === a && !0 === this.Fy.jw) { | |
break | |
} | |
if (this.Ya === Sh || this.Ya === Th) { | |
this.Ya = Yh, Zh(this) | |
} | |
} | |
}; | |
function Zh(a) { | |
if (null !== a.te && null !== a.og) { | |
var b = a.te, | |
c = a.te.text, | |
d = a.og.value, | |
e = "", | |
e = "function" === typeof d ? d() : d; | |
if (!a.isValidText(a.te, c, e)) { | |
a.Ya = Th; | |
null !== b.dz && b.dz(a, c, e); | |
null === a.Dk && (a.Dk = a.og.style.border, a.og.style.border = "3px solid red"); | |
"function" === typeof a.og.focus && a.og.focus(); | |
return | |
} | |
a.Xb(a.name); | |
a.Ya = Uh; | |
c !== e && (a.te.text = e); | |
a.Af = a.name; | |
b = a.g; | |
null !== b && b.Ba("TextEdited", a.te, c); | |
a.Uj(); | |
a.stopTool(); | |
null !== b && b.focus() | |
} | |
null !== a.Dk && (a.og.style.border = a.Dk, a.Dk = null) | |
} | |
Mh.prototype.doDeactivate = function() { | |
var a = this.g; | |
if (null !== a) { | |
this.Ya = Oh; | |
this.te = null; | |
if (null !== this.og) { | |
var b = this.og; | |
if ("function" === typeof b.onDeactivate) { | |
b.onDeactivate() | |
} | |
null !== b && a.Vk.removeChild(b) | |
} | |
this.oa = !1 | |
} | |
}; | |
Mh.prototype.isValidText = function(a, b, c) { | |
u.C(a, qa, Mh, "isValidText:textblock"); | |
var d = this.kA; | |
if (null !== d && !d(a, b, c)) { | |
return !1 | |
} | |
d = a.kA; | |
return null === d || d(a, b, c) ? !0 : !1 | |
}; | |
u.defineProperty(Mh, { | |
kA: "textValidation" | |
}, function() { | |
return this.Hk | |
}, function(a) { | |
null !== a && u.j(a, "function", Mh, "textValidation"); | |
this.Hk = a | |
}); | |
u.defineProperty(Mh, { | |
ZD: "minimumEditorScale" | |
}, function() { | |
return this.EB | |
}, function(a) { | |
null !== a && u.j(a, "number", Mh, "minimumEditorScale"); | |
this.EB = a | |
}); | |
u.defineProperty(Mh, { | |
aA: "selectsTextOnActivate" | |
}, function() { | |
return this.dC | |
}, function(a) { | |
null !== a && u.j(a, "boolean", Mh, "selectsTextOnActivate"); | |
this.dC = a | |
}); | |
function jf() { | |
xe.call(this); | |
this.name = "ToolManager"; | |
this.vF = new E(xe); | |
this.wF = new E(xe); | |
this.xF = new E(xe); | |
this.jB = this.kB = 1000; | |
this.ZA = (new ia(2, 2)).La(); | |
this.bu = this.xx = null; | |
this.IB = Bf; | |
this.hB = $h | |
} | |
u.Ha(jf, xe); | |
u.fa("ToolManager", jf); | |
var Bf; | |
jf.WheelScroll = Bf = u.s(jf, "WheelScroll", 0); | |
var Af; | |
jf.WheelZoom = Af = u.s(jf, "WheelZoom", 1); | |
jf.WheelNone = u.s(jf, "WheelNone", 2); | |
var $h; | |
jf.GestureZoom = $h = u.s(jf, "GestureZoom", 3); | |
var ai; | |
jf.GestureCancel = ai = u.s(jf, "GestureCancel", 4); | |
var bi; | |
jf.GestureNone = bi = u.s(jf, "GestureNone", 5); | |
u.defineProperty(jf, { | |
at: "mouseWheelBehavior" | |
}, function() { | |
return this.IB | |
}, function(a) { | |
u.rb(a, jf, jf, "mouseWheelBehavior"); | |
this.IB = a | |
}); | |
u.defineProperty(jf, { | |
Eo: "gestureBehavior" | |
}, function() { | |
return this.hB | |
}, function(a) { | |
u.rb(a, jf, jf, "gestureBehavior"); | |
this.hB = a | |
}); | |
jf.prototype.initializeStandardTools = function() { | |
this.IF = new xh; | |
this.jE = new Gf; | |
this.sH = new fh; | |
this.vE = new mh; | |
this.bI = new uh; | |
this.UD = new ta; | |
this.Gd = new uf; | |
this.vG = new Kh; | |
this.LH = new Lh; | |
this.Wy = new Ih; | |
this.jA = new Mh; | |
this.WF = new va; | |
this.XF = new wh | |
}; | |
jf.prototype.doMouseDown = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.N; | |
b.kl && this.Eo === ai && (b.bubbles = !1); | |
if (b.Qs) { | |
if (this.Eo === bi) { | |
b.bubbles = !0; | |
return | |
} | |
if (this.Eo === ai) { | |
return | |
} | |
if (a.Va.canStartMultiTouch()) { | |
a.Va.standardPinchZoomStart(); | |
return | |
} | |
} | |
b = a.ga; | |
b.Ty && 0 !== b.Me && u.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero"); | |
for (var b = this.ef.length, c = 0; c < b; c++) { | |
var d = this.ef.ja(c); | |
null === d.g && d.Dc(this.g); | |
if (d.canStart()) { | |
a.Va = d; | |
a.Va === d && (d.oa || d.doActivate(), d.doMouseDown()); | |
return | |
} | |
} | |
1 === a.N.button && (this.at === Bf ? this.at = Af : this.at === Af && (this.at = Bf)); | |
this.doActivate(); | |
this.standardWaitAfter(this.FD) | |
} | |
}; | |
jf.prototype.doMouseMove = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.N; | |
if (b.Qs) { | |
if (this.Eo === bi) { | |
b.bubbles = !0; | |
return | |
} | |
if (this.Eo === ai) { | |
return | |
} | |
if (a.Va.canStartMultiTouch()) { | |
a.Va.standardPinchZoomMove(); | |
return | |
} | |
} | |
if (this.oa) { | |
for (var b = this.Nf.length, c = 0; c < b; c++) { | |
var d = this.Nf.ja(c); | |
null === d.g && d.Dc(this.g); | |
if (d.canStart()) { | |
a.Va = d; | |
a.Va === d && (d.oa || d.doActivate(), d.doMouseMove()); | |
return | |
} | |
} | |
} | |
this.standardMouseOver(); | |
this.isBeyondDragSize() && this.standardWaitAfter(this.oa ? this.FD : this.RG) | |
} | |
}; | |
jf.prototype.doCurrentObjectChanged = function(a, b) { | |
var c = this.Rk; | |
null === c || null !== b && (b === c || b.gl(c)) || this.hideToolTip() | |
}; | |
jf.prototype.doWaitAfter = function() { | |
var a = this.g; | |
null !== a && a.kb && (this.doMouseHover(), this.oa || this.doToolTip()) | |
}; | |
jf.prototype.doMouseHover = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.N; | |
null === b.qe && (b.qe = a.le(b.da, null, null)); | |
var c = b.qe; | |
if (null !== c) { | |
for (b.Tc = !1; null !== c;) { | |
a = this.oa ? c.Ez : c.Fz; | |
if (null !== a && (a(b, c), b.Tc)) { | |
break | |
} | |
c = c.P | |
} | |
} else { | |
a = this.oa ? a.Ez : a.Fz, null !== a && a(b) | |
} | |
} | |
}; | |
jf.prototype.doToolTip = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.N; | |
null === b.qe && (b.qe = a.le(b.da, null, null)); | |
b = b.qe; | |
if (null !== b) { | |
if (b !== this.Rk && !b.gl(this.Rk)) { | |
for (; null !== b;) { | |
a = b.mA; | |
if (null !== a) { | |
this.showToolTip(a, b); | |
return | |
} | |
b = b.P | |
} | |
this.hideToolTip() | |
} | |
} else { | |
a = a.mA, null !== a ? this.showToolTip(a, null) : this.hideToolTip() | |
} | |
} | |
}; | |
jf.prototype.showToolTip = function(a, b) { | |
u.C(a, lf, jf, "showToolTip:tooltip"); | |
null !== b && u.C(b, T, jf, "showToolTip:obj"); | |
var c = this.g; | |
if (null !== c) { | |
a !== this.Rk && this.hideToolTip(); | |
a.xf = "Tool"; | |
a.ql = !1; | |
a.scale = 1 / c.scale; | |
c.add(a); | |
if (null !== b && b !== this.bu) { | |
var c = null, | |
d = b.Co(); | |
null !== d && (c = d.data); | |
a.xc = b; | |
a.data = c | |
} else { | |
null === b && (a.data = c.ha) | |
} | |
if (null === b || b !== this.bu) { | |
a.rf(), this.positionToolTip(a, b) | |
} | |
this.xx = a; | |
this.bu = b | |
} | |
}; | |
jf.prototype.positionToolTip = function(a) { | |
if (null === a.placeholder) { | |
var b = this.g; | |
if (null !== b) { | |
var c = b.N.da.copy(), | |
d = a.Ca, | |
e = b.ob; | |
b.N.kl && (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 | |
} | |
} | |
}; | |
jf.prototype.hideToolTip = function() { | |
if (null !== this.Rk) { | |
var a = this.g; | |
null !== a && (this.Rk.data = null, this.Rk.xc = null, a.remove(this.Rk), this.bu = this.xx = null) | |
} | |
}; | |
u.u(jf, { | |
Rk: "currentToolTip" | |
}, function() { | |
return this.xx | |
}); | |
jf.prototype.doMouseUp = function() { | |
this.cancelWaitAfter(); | |
if (this.oa) { | |
var a = this.g; | |
if (null === a) { | |
return | |
} | |
for (var b = this.Of.length, c = 0; c < b; c++) { | |
var d = this.Of.ja(c); | |
null === d.g && d.Dc(this.g); | |
if (d.canStart()) { | |
a.Va = d; | |
a.Va === d && (d.oa || d.doActivate(), d.doMouseUp()); | |
return | |
} | |
} | |
} | |
this.doDeactivate() | |
}; | |
jf.prototype.doMouseWheel = function() { | |
this.standardMouseWheel() | |
}; | |
jf.prototype.doKeyDown = function() { | |
var a = this.g; | |
null !== a && a.Eb.doKeyDown() | |
}; | |
jf.prototype.doKeyUp = function() { | |
var a = this.g; | |
null !== a && a.Eb.doKeyUp() | |
}; | |
jf.prototype.doCancel = function() { | |
null !== Ef && Ef.doCancel(); | |
xe.prototype.doCancel.call(this) | |
}; | |
jf.prototype.findTool = function(a) { | |
u.j(a, "string", jf, "findTool:name"); | |
for (var b = this.ef.length, c = 0; c < b; c++) { | |
var d = this.ef.ja(c); | |
if (d.name === a) { | |
return d | |
} | |
} | |
b = this.Nf.length; | |
for (c = 0; c < b; c++) { | |
if (d = this.Nf.ja(c), d.name === a) { | |
return d | |
} | |
} | |
b = this.Of.length; | |
for (c = 0; c < b; c++) { | |
if (d = this.Of.ja(c), d.name === a) { | |
return d | |
} | |
} | |
return null | |
}; | |
jf.prototype.replaceTool = function(a, b) { | |
u.j(a, "string", jf, "replaceTool:name"); | |
null !== b && (u.C(b, xe, jf, "replaceTool:newtool"), b.g && b.g !== this.g && u.k("Cannot share tools between Diagrams: " + b.toString()), b.Dc(this.g)); | |
for (var c = this.ef.length, d = 0; d < c; d++) { | |
var e = this.ef.ja(d); | |
if (e.name === a) { | |
return null !== b ? this.ef.Dg(d, b) : this.ef.kd(d), e | |
} | |
} | |
c = this.Nf.length; | |
for (d = 0; d < c; d++) { | |
if (e = this.Nf.ja(d), e.name === a) { | |
return null !== b ? this.Nf.Dg(d, b) : this.Nf.kd(d), e | |
} | |
} | |
c = this.Of.length; | |
for (d = 0; d < c; d++) { | |
if (e = this.Of.ja(d), e.name === a) { | |
return null !== b ? this.Of.Dg(d, b) : this.Of.kd(d), e | |
} | |
} | |
return null | |
}; | |
function ci(a, b, c, d) { | |
u.j(b, "string", jf, "replaceStandardTool:name"); | |
u.C(d, E, jf, "replaceStandardTool:list"); | |
null !== c && (u.C(c, xe, jf, "replaceStandardTool:newtool"), c.g && c.g !== a.g && u.k("Cannot share tools between Diagrams: " + c.toString()), c.name = b, c.Dc(a.g)); | |
a.findTool(b) ? a.replaceTool(b, c) : null !== c && d.add(c) | |
} | |
u.u(jf, { | |
ef: "mouseDownTools" | |
}, function() { | |
return this.vF | |
}); | |
u.u(jf, { | |
Nf: "mouseMoveTools" | |
}, function() { | |
return this.wF | |
}); | |
u.u(jf, { | |
Of: "mouseUpTools" | |
}, function() { | |
return this.xF | |
}); | |
u.defineProperty(jf, { | |
RG: "hoverDelay" | |
}, function() { | |
return this.kB | |
}, function(a) { | |
u.j(a, "number", jf, "hoverDelay"); | |
this.kB = a | |
}); | |
u.defineProperty(jf, { | |
FD: "holdDelay" | |
}, function() { | |
return this.jB | |
}, function(a) { | |
u.j(a, "number", jf, "holdDelay"); | |
this.jB = a | |
}); | |
u.defineProperty(jf, { | |
wG: "dragSize" | |
}, function() { | |
return this.ZA | |
}, function(a) { | |
u.C(a, ia, jf, "dragSize"); | |
this.ZA = a.Z() | |
}); | |
u.defineProperty(jf, { | |
IF: "actionTool" | |
}, function() { | |
return this.findTool("Action") | |
}, function(a) { | |
ci(this, "Action", a, this.ef) | |
}); | |
u.defineProperty(jf, { | |
jE: "relinkingTool" | |
}, function() { | |
return this.findTool("Relinking") | |
}, function(a) { | |
ci(this, "Relinking", a, this.ef) | |
}); | |
u.defineProperty(jf, { | |
sH: "linkReshapingTool" | |
}, function() { | |
return this.findTool("LinkReshaping") | |
}, function(a) { | |
ci(this, "LinkReshaping", a, this.ef) | |
}); | |
u.defineProperty(jf, { | |
vE: "resizingTool" | |
}, function() { | |
return this.findTool("Resizing") | |
}, function(a) { | |
ci(this, "Resizing", a, this.ef) | |
}); | |
u.defineProperty(jf, { | |
bI: "rotatingTool" | |
}, function() { | |
return this.findTool("Rotating") | |
}, function(a) { | |
ci(this, "Rotating", a, this.ef) | |
}); | |
u.defineProperty(jf, { | |
UD: "linkingTool" | |
}, function() { | |
return this.findTool("Linking") | |
}, function(a) { | |
ci(this, "Linking", a, this.Nf) | |
}); | |
u.defineProperty(jf, { | |
Gd: "draggingTool" | |
}, function() { | |
return this.findTool("Dragging") | |
}, function(a) { | |
ci(this, "Dragging", a, this.Nf) | |
}); | |
u.defineProperty(jf, { | |
vG: "dragSelectingTool" | |
}, function() { | |
return this.findTool("DragSelecting") | |
}, function(a) { | |
ci(this, "DragSelecting", a, this.Nf) | |
}); | |
u.defineProperty(jf, { | |
LH: "panningTool" | |
}, function() { | |
return this.findTool("Panning") | |
}, function(a) { | |
ci(this, "Panning", a, this.Nf) | |
}); | |
u.defineProperty(jf, { | |
Wy: "contextMenuTool" | |
}, function() { | |
return this.findTool("ContextMenu") | |
}, function(a) { | |
ci(this, "ContextMenu", a, this.Of) | |
}); | |
u.defineProperty(jf, { | |
jA: "textEditingTool" | |
}, function() { | |
return this.findTool("TextEditing") | |
}, function(a) { | |
ci(this, "TextEditing", a, this.Of) | |
}); | |
u.defineProperty(jf, { | |
WF: "clickCreatingTool" | |
}, function() { | |
return this.findTool("ClickCreating") | |
}, function(a) { | |
ci(this, "ClickCreating", a, this.Of) | |
}); | |
u.defineProperty(jf, { | |
XF: "clickSelectingTool" | |
}, function() { | |
return this.findTool("ClickSelecting") | |
}, function(a) { | |
ci(this, "ClickSelecting", a, this.Of) | |
}); | |
function Te() { | |
this.pF = di; | |
this.Jl = this.Kl = this.Y = null; | |
this.CA = this.cd = this.Hn = this.dj = !1; | |
this.Oe = !0; | |
this.au = this.$t = this.PA = null; | |
this.vx = 0; | |
this.Gx = 600; | |
this.zF = new w(0, 0); | |
this.EA = this.DA = this.BC = !1; | |
this.Un = new la(T, ei) | |
} | |
u.fa("AnimationManager", Te); | |
Te.prototype.Dc = function(a) { | |
this.Y = a | |
}; | |
function di(a, b, c, d) { | |
a /= d / 2; | |
return 1 > a ? c / 2 * a * a + b : -c / 2 * (--a * (a - 2) - 1) + b | |
} | |
Te.prototype.prepareAnimation = Te.prototype.nl = function() { | |
this.Oe && (this.dj && this.Ni(), this.cd = !0, this.CA = !1) | |
}; | |
function fi(a) { | |
a.Oe && requestAnimationFrame(function() { | |
!1 === a.cd || a.dj || (a.Y.mm = 1, gi(a.Y), a.cd = !1, a.Y.Ba("AnimationStarting"), hi(a)) | |
}) | |
} | |
function ii(a, b, c, d, e) { | |
if (a.cd && (!(b instanceof G) || b.JD)) { | |
var f = a.Un; | |
if (f.contains(b)) { | |
b = f.ua(b); | |
a = b.start; | |
var h = b.end; | |
void 0 === a[c] && (a[c] = ji(d)); | |
h[c] = ji(e) | |
} else { | |
a = new pa, h = new pa, a[c] = ji(d), h[c] = ji(e), f.add(b, new ei(a, h)) | |
} | |
} | |
} | |
function ji(a) { | |
return a instanceof w ? a.copy() : a instanceof ia ? a.copy() : a | |
} | |
function hi(a) { | |
var b; | |
void 0 === b && (b = new pa); | |
var c = a.Y; | |
if (null !== c) { | |
if (0 === a.Un.count) { | |
a.dj = !1, ki(c, !1), c.df() | |
} else { | |
a.dj = !0; | |
var d = b.AJ || a.pF, | |
e = b.fK || null, | |
f = b.gK || null, | |
h = b.duration || a.Gx; | |
b = a.zF; | |
for (var k = a.Un.i; k.next();) { | |
var l = k.value.start.position; | |
l instanceof w && (l.I() || l.assign(b)) | |
} | |
a.PA = d; | |
a.$t = e; | |
a.au = f; | |
a.vx = h; | |
var m = a.oF = a.Un; | |
li(a); | |
mi(a, c, m, d, 0, h, null !== a.Kl && null !== a.Jl); | |
Dg(a.Y); | |
ni(a); | |
requestAnimationFrame(function(b) { | |
var e = b || +new Date, | |
f = e + h; | |
(function s(b) { | |
if (!1 !== a.dj) { | |
b = b || +new Date; | |
var k = b > f ? h : b - e; | |
li(a); | |
mi(a, c, m, d, k, h, null !== a.Kl && null !== a.Jl); | |
a.$t && a.$t(); | |
Dg(c); | |
ni(a); | |
b > f ? oi(a) : requestAnimationFrame(s) | |
} | |
})(e) | |
}) | |
} | |
} | |
} | |
var pi = { | |
opacity: function(a, b, c, d, e, f) { | |
a.opacity = d(e, b, c - b, f) | |
}, | |
position: function(a, b, c, d, e, f) { | |
e !== f ? a.HE(d(e, b.x, c.x - b.x, f), d(e, b.y, c.y - b.y, f)) : a.position = new w(d(e, b.x, c.x - b.x, f), d(e, b.y, c.y - b.y, f)) | |
}, | |
scale: function(a, b, c, d, e, f) { | |
a.scale = d(e, b, c - b, f) | |
}, | |
visible: function(a, b, c, d, e, f) { | |
a.visible = e !== f ? b : c | |
} | |
}; | |
function li(a) { | |
if (!a.Hn) { | |
var b = a.Y; | |
a.BC = b.gb; | |
a.DA = b.Kw; | |
a.EA = b.ut; | |
b.gb = !0; | |
b.Kw = !0; | |
b.ut = !0; | |
a.Hn = !0 | |
} | |
} | |
function ni(a) { | |
var b = a.Y; | |
b.gb = a.BC; | |
b.Kw = a.DA; | |
b.ut = a.EA; | |
a.Hn = !1 | |
} | |
function mi(a, b, c, d, e, f, h) { | |
for (c = c.i; c.next();) { | |
var k = c.key, | |
l = c.value, | |
m = l.start, | |
l = l.end, | |
n; | |
for (n in l) { | |
if (void 0 !== pi[n]) { | |
pi[n](k, m[n], l[n], d, e, f) | |
} | |
} | |
} | |
h && (h = a.Kl, a = a.Jl, n = a.y - h.y, a = d(e, h.x, a.x - h.x, f), d = d(e, h.y, n, f), e = b.rz, b.rz = !0, b.position = new w(a, d), b.rz = e) | |
} | |
Te.prototype.stopAnimation = Te.prototype.Ni = function() { | |
!0 === this.cd && (this.cd = !1, this.CA && this.Y.ee()); | |
this.dj && this.Oe && (li(this), mi(this, this.Y, this.oF, this.PA, this.vx, this.vx, null !== this.Kl && null !== this.Jl), ni(this), oi(this)) | |
}; | |
function oi(a) { | |
a.dj = !1; | |
a.Kl = null; | |
a.Jl = null; | |
a.Un = new la(T, ei); | |
li(a); | |
for (var b = a.Y, c = a.Y.links; c.next();) { | |
var d = c.value; | |
null !== d.Zn && (d.points = d.Zn, d.Zn = null) | |
} | |
b.rw.clear(); | |
ki(b, !1); | |
b.pc(); | |
b.df(); | |
qi(b); | |
ni(a); | |
a.au && a.au(); | |
a.au = null; | |
a.$t = null; | |
b.Ba("AnimationFinished"); | |
b.ee() | |
} | |
function ri(a, b, c) { | |
var d = b.ca, | |
e = c.ca, | |
f = null; | |
c instanceof V && (f = c.placeholder); | |
null !== f ? (c = f.eb(xb), c.x += f.padding.left, c.y += f.padding.top, ii(a, b, "position", c, b.position)) : ii(a, b, "position", new w(e.x + e.width / 2 - d.width / 2, e.y + e.height / 2 - d.height / 2), b.position); | |
ii(a, b, "opacity", 0.01, b.opacity) | |
} | |
function si(a, b, c) { | |
a.cd && (null === a.Kl && b.I() && null === a.Jl && (a.Kl = b.copy()), a.Jl = c.copy()) | |
} | |
u.defineProperty(Te, { | |
isEnabled: "isEnabled" | |
}, function() { | |
return this.Oe | |
}, function(a) { | |
u.j(a, "boolean", Te, "isEnabled"); | |
this.Oe = a | |
}); | |
u.defineProperty(Te, { | |
duration: "duration" | |
}, function() { | |
return this.Gx | |
}, function(a) { | |
u.j(a, "number", Te, "duration"); | |
1 > a && u.xa(a, ">= 1", Te, "duration"); | |
this.Gx = a | |
}); | |
u.u(Te, { | |
Xg: "isAnimating" | |
}, function() { | |
return this.dj | |
}); | |
u.u(Te, { | |
MJ: "isTicking" | |
}, function() { | |
return this.Hn | |
}); | |
function ei(a, b) { | |
this.start = a; | |
this.end = b | |
} | |
function we() { | |
0 < arguments.length && u.Xc(we); | |
u.gc(this); | |
this.Y = null; | |
this.Db = new E(G); | |
this.Vb = ""; | |
this.Hc = 1; | |
this.Xx = !1; | |
this.Fk = this.Ky = this.fk = this.ek = this.dk = this.ck = this.ak = this.bk = this.$j = this.hk = this.Zj = this.gk = this.Yj = this.Xj = !0; | |
this.Sx = !1; | |
this.Wu = [] | |
} | |
u.fa("Layer", we); | |
we.prototype.Dc = function(a) { | |
this.Y = a | |
}; | |
we.prototype.toString = function(a) { | |
void 0 === a && (a = 0); | |
var b = 'Layer "' + this.name + '"'; | |
if (0 >= a) { | |
return b | |
} | |
for (var c = 0, d = 0, e = 0, f = 0, h = 0, k = this.Db.i; k.next();) { | |
var l = k.value; | |
l instanceof V ? e++ : l instanceof U ? d++ : l instanceof W ? f++ : l instanceof lf ? h++ : c++ | |
} | |
k = ""; | |
0 < c && (k += c + " Parts "); | |
0 < d && (k += d + " Nodes "); | |
0 < e && (k += e + " Groups "); | |
0 < f && (k += f + " Links "); | |
0 < h && (k += h + " Adornments "); | |
if (1 < a) { | |
for (a = this.Db.i; a.next();) { | |
c = a.value, k += "\n " + c.toString(), d = c.data, null !== d && u.Uc(d) && (k += " #" + u.Uc(d)), c instanceof U ? k += " " + de(d) : c instanceof W && (k += " " + de(c.V) + " " + de(c.ba)) | |
} | |
} | |
return b + " " + this.Db.count + ": " + k | |
}; | |
we.prototype.findObjectAt = we.prototype.le = function(a, b, c) { | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
if (!1 === this.Fk) { | |
return null | |
} | |
var d = !1; | |
this.g.ob.Da(a) && (d = !0); | |
for (var e = u.K(), f = this.Db.n, h = f.length; h--;) { | |
var k = f[h]; | |
if ((!0 !== d || !1 !== ti(k)) && k.Ia() && (e.assign(a), Wa(e, k.Gf), k = k.le(e, b, c), null !== k && (null !== b && (k = b(k)), null !== k && (null === c || c(k))))) { | |
return u.v(e), k | |
} | |
} | |
u.v(e); | |
return null | |
}; | |
we.prototype.findObjectsAt = we.prototype.zs = function(a, b, c, d) { | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
d instanceof E || d instanceof F || (d = new F(T)); | |
if (!1 === this.Fk) { | |
return d | |
} | |
var e = !1; | |
this.g.ob.Da(a) && (e = !0); | |
for (var f = u.K(), h = this.Db.n, k = h.length; k--;) { | |
var l = h[k]; | |
!0 === e && !1 === ti(l) || !l.Ia() || (f.assign(a), Wa(f, l.Gf), l.zs(f, b, c, d) && (null !== b && (l = b(l)), null === l || null !== c && !c(l) || d.add(l))) | |
} | |
u.v(f); | |
return d | |
}; | |
we.prototype.findObjectsIn = we.prototype.Nj = function(a, b, c, d, e) { | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
void 0 === d && (d = !1); | |
e instanceof E || e instanceof F || (e = new F(T)); | |
if (!1 === this.Fk) { | |
return e | |
} | |
var f = !1; | |
this.g.ob.Kj(a) && (f = !0); | |
for (var h = this.Db.n, k = h.length; k--;) { | |
var l = h[k]; | |
(!0 !== f || !1 !== ti(l)) && l.Ia() && l.Nj(a, b, c, d, e) && (null !== b && (l = b(l)), null === l || null !== c && !c(l) || e.add(l)) | |
} | |
return e | |
}; | |
we.prototype.ez = function(a, b, c, d, e, f, h) { | |
if (!1 === this.Fk) { | |
return e | |
} | |
for (var k = this.Db.n, l = k.length; l--;) { | |
var m = k[l]; | |
(!0 !== h || !1 !== ti(m)) && f(m) && m.Ia() && m.Nj(a, b, c, d, e) && (null !== b && (m = b(m)), null === m || null !== c && !c(m) || e.add(m)) | |
} | |
return e | |
}; | |
we.prototype.findObjectsNear = we.prototype.Cm = function(a, b, c, d, e, f) { | |
void 0 === c && (c = null); | |
void 0 === d && (d = null); | |
void 0 === e && (e = !0); | |
if (!1 !== e && !0 !== e) { | |
if (e instanceof E || e instanceof F) { | |
f = e | |
} | |
e = !0 | |
} | |
f instanceof E || f instanceof F || (f = new F(T)); | |
if (!1 === this.Fk) { | |
return f | |
} | |
var h = !1; | |
this.g.ob.Da(a) && (h = !0); | |
for (var k = u.K(), l = u.K(), m = this.Db.n, n = m.length; n--;) { | |
var p = m[n]; | |
!0 === h && !1 === ti(p) || !p.Ia() || (k.assign(a), Wa(k, p.Gf), l.m(a.x + b, a.y), Wa(l, p.Gf), p.Cm(k, l, c, d, e, f) && (null !== c && (p = c(p)), null === p || null !== d && !d(p) || f.add(p))) | |
} | |
u.v(k); | |
u.v(l); | |
return f | |
}; | |
g = we.prototype; | |
g.yf = function(a, b) { | |
if (this.visible) { | |
var c; | |
c = void 0 === b ? a.ob : b; | |
for (var d = this.Db.n, e = d.length, f = 0; f < e; f++) { | |
var h = d[f]; | |
h.BB = f; | |
if (!(h instanceof W && !1 === h.jg)) { | |
if (h instanceof lf) { | |
var k = h; | |
if (null !== k.Mh) { | |
continue | |
} | |
} | |
if (jb(h.ca, c)) { | |
for (h.yf(!0), ui(h), h = h.Av; h.next();) { | |
k = h.value, Ph(k, Infinity, Infinity), k.yc(), k.yf(!0) | |
} | |
} else { | |
h.yf(!1), null !== h.Av && 0 < h.Av.count && ui(h) | |
} | |
} | |
} | |
} | |
}; | |
g.Xe = function(a, b, c, d) { | |
if (this.visible && 0 !== this.Hc && (void 0 === d && (d = !0), d || !this.zc)) { | |
1 !== this.Hc && (a.globalAlpha = this.Hc); | |
c = this.Wu; | |
c.length = 0; | |
d = b.scale; | |
for (var e = this.Db.n, f = e.length, h = 0; h < f; h++) { | |
var k = e[h]; | |
if (ti(k) || vi(k)) { | |
if (k instanceof W) { | |
var l = k; | |
l.ec && c.push(l); | |
if (!1 === l.jg) { | |
continue | |
} | |
} | |
l = k.ca; | |
1 < l.width * d || 1 < l.height * d ? k.Xe(a, b) : wi(k, a) | |
} | |
} | |
a.globalAlpha = 1 | |
} | |
}; | |
function xi(a, b, c, d) { | |
if (a.visible && 0 !== a.Hc) { | |
1 !== a.Hc && (b.globalAlpha = a.Hc); | |
var e = a.Wu; | |
e.length = 0; | |
var f = c.scale; | |
a = a.Db.n; | |
for (var h = a.length, k = d.length, l = 0; l < h; l++) { | |
var m = a[l]; | |
if (ti(m) || vi(m)) { | |
if (m instanceof W) { | |
var n = m; | |
n.ec && e.push(n); | |
if (!1 === n.jg) { | |
continue | |
} | |
} | |
var n = Ki(m, m.ca), | |
p; | |
a: { | |
p = n; | |
for (var q = d, r = k, s = 2 / f, t = 4 / f, v = 0; v < r; v++) { | |
var x = q[v]; | |
if (0 !== x.width && 0 !== x.height && p.HD(x.x - s, x.y - s, x.width + t, x.height + t)) { | |
p = !0; | |
break a | |
} | |
} | |
p = !1 | |
} | |
p && (1 < n.width * f || 1 < n.height * f ? m.Xe(b, c) : wi(m, b)) | |
} | |
} | |
b.globalAlpha = 1 | |
} | |
} | |
g.h = function(a, b, c, d, e) { | |
var f = this.g; | |
null !== f && f.Cc($d, a, this, b, c, d, e) | |
}; | |
g.Ho = function(a, b, c) { | |
var d = this.Db; | |
b.Du = this; | |
if (a >= d.count) { | |
a = d.count | |
} else { | |
if (d.ja(a) === b) { | |
return -1 | |
} | |
} | |
d.Zd(a, b); | |
b.Ks(c); | |
d = this.g; | |
null !== d && (c ? d.na() : d.Ho(b)); | |
b instanceof V && this.Lw(b); | |
return a | |
}; | |
g.Ge = function(a, b, c) { | |
if (!c && b.layer !== this && null !== b.layer) { | |
return b.layer.Ge(a, b, c) | |
} | |
var d = this.Db; | |
if (0 > a || a >= d.length) { | |
if (a = d.indexOf(b), 0 > a) { | |
return -1 | |
} | |
} else { | |
if (d.ja(a) !== b && (a = d.indexOf(b), 0 > a)) { | |
return -1 | |
} | |
} | |
b.Ls(c); | |
d.kd(a); | |
d = this.g; | |
null !== d && (c ? d.na() : d.Ge(b)); | |
b.Du = null; | |
return a | |
}; | |
g.Lw = function(a) { | |
for (; null !== a;) { | |
if (a.layer === this) { | |
var b = a; | |
if (0 !== b.Lc.count) { | |
for (var c = -1, d = -1, e = this.Db.n, f = e.length, h = 0; h < f; h++) { | |
var k = e[h]; | |
if (k === b && (c = h, 0 <= d)) { | |
break | |
} | |
if (0 > d && k.Sa === b && (d = h, 0 <= c)) { | |
break | |
} | |
}!(0 > d) && d < c && (e = this.Db, e.kd(c), e.Zd(d, b)) | |
} | |
} | |
a = a.Sa | |
} | |
}; | |
g.clear = function() { | |
for (var a = this.Db.Le(), b = a.length, c = 0; c < b; c++) { | |
a[c].yf(!1), this.Ge(-1, a[c], !1) | |
} | |
}; | |
u.u(we, { | |
Sj: "parts" | |
}, function() { | |
return this.Db.i | |
}); | |
u.u(we, { | |
pK: "partsBackwards" | |
}, function() { | |
return this.Db.Jm | |
}); | |
u.u(we, { | |
g: "diagram" | |
}, function() { | |
return this.Y | |
}); | |
u.defineProperty(we, { | |
name: "name" | |
}, function() { | |
return this.Vb | |
}, function(a) { | |
u.j(a, "string", we, "name"); | |
var b = this.Vb; | |
if (b !== a) { | |
var c = this.g; | |
if (null !== c) { | |
for ("" === b && u.k("Cannot rename default Layer to: " + a), c = c.nw; c.next();) { | |
c.value.name === a && u.k("Layer.name is already present in this diagram: " + a) | |
} | |
} | |
this.Vb = a; | |
this.h("name", b, a); | |
for (a = this.Db.i; a.next();) { | |
a.value.xf = this.Vb | |
} | |
} | |
}); | |
u.defineProperty(we, { | |
opacity: "opacity" | |
}, function() { | |
return this.Hc | |
}, function(a) { | |
var b = this.Hc; | |
b !== a && (u.j(a, "number", we, "opacity"), (0 > a || 1 < a) && u.xa(a, "0 <= value <= 1", we, "opacity"), this.Hc = a, this.h("opacity", b, a), a = this.g, null !== a && a.na()) | |
}); | |
u.defineProperty(we, { | |
zc: "isTemporary" | |
}, function() { | |
return this.Xx | |
}, function(a) { | |
var b = this.Xx; | |
b !== a && (u.j(a, "boolean", we, "isTemporary"), this.Xx = a, this.h("isTemporary", b, a)) | |
}); | |
u.defineProperty(we, { | |
visible: "visible" | |
}, function() { | |
return this.Ky | |
}, function(a) { | |
var b = this.Ky; | |
if (b !== a) { | |
u.j(a, "boolean", we, "visible"); | |
this.Ky = a; | |
this.h("visible", b, a); | |
for (b = this.Db.i; b.next();) { | |
b.value.Ie(a) | |
} | |
a = this.g; | |
null !== a && a.na() | |
} | |
}); | |
u.defineProperty(we, { | |
Cg: "pickable" | |
}, function() { | |
return this.Fk | |
}, function(a) { | |
var b = this.Fk; | |
b !== a && (u.j(a, "boolean", we, "pickable"), this.Fk = a, this.h("pickable", b, a)) | |
}); | |
u.defineProperty(we, { | |
KD: "isBoundsIncluded" | |
}, function() { | |
return this.Sx | |
}, function(a) { | |
this.Sx !== a && (this.Sx = a, null !== this.g && this.g.pc()) | |
}); | |
u.defineProperty(we, { | |
Ij: "allowCopy" | |
}, function() { | |
return this.Xj | |
}, function(a) { | |
var b = this.Xj; | |
b !== a && (u.j(a, "boolean", we, "allowCopy"), this.Xj = a, this.h("allowCopy", b, a)) | |
}); | |
u.defineProperty(we, { | |
pm: "allowDelete" | |
}, function() { | |
return this.Yj | |
}, function(a) { | |
var b = this.Yj; | |
b !== a && (u.j(a, "boolean", we, "allowDelete"), this.Yj = a, this.h("allowDelete", b, a)) | |
}); | |
u.defineProperty(we, { | |
Fv: "allowTextEdit" | |
}, function() { | |
return this.gk | |
}, function(a) { | |
var b = this.gk; | |
b !== a && (u.j(a, "boolean", we, "allowTextEdit"), this.gk = a, this.h("allowTextEdit", b, a)) | |
}); | |
u.defineProperty(we, { | |
Cv: "allowGroup" | |
}, function() { | |
return this.Zj | |
}, function(a) { | |
var b = this.Zj; | |
b !== a && (u.j(a, "boolean", we, "allowGroup"), this.Zj = a, this.h("allowGroup", b, a)) | |
}); | |
u.defineProperty(we, { | |
Gv: "allowUngroup" | |
}, function() { | |
return this.hk | |
}, function(a) { | |
var b = this.hk; | |
b !== a && (u.j(a, "boolean", we, "allowUngroup"), this.hk = a, this.h("allowUngroup", b, a)) | |
}); | |
u.defineProperty(we, { | |
js: "allowLink" | |
}, function() { | |
return this.$j | |
}, function(a) { | |
var b = this.$j; | |
b !== a && (u.j(a, "boolean", we, "allowLink"), this.$j = a, this.h("allowLink", b, a)) | |
}); | |
u.defineProperty(we, { | |
qm: "allowRelink" | |
}, function() { | |
return this.bk | |
}, function(a) { | |
var b = this.bk; | |
b !== a && (u.j(a, "boolean", we, "allowRelink"), this.bk = a, this.h("allowRelink", b, a)) | |
}); | |
u.defineProperty(we, { | |
Nk: "allowMove" | |
}, function() { | |
return this.ak | |
}, function(a) { | |
var b = this.ak; | |
b !== a && (u.j(a, "boolean", we, "allowMove"), this.ak = a, this.h("allowMove", b, a)) | |
}); | |
u.defineProperty(we, { | |
Dv: "allowReshape" | |
}, function() { | |
return this.ck | |
}, function(a) { | |
var b = this.ck; | |
b !== a && (u.j(a, "boolean", we, "allowReshape"), this.ck = a, this.h("allowReshape", b, a)) | |
}); | |
u.defineProperty(we, { | |
ks: "allowResize" | |
}, function() { | |
return this.dk | |
}, function(a) { | |
var b = this.dk; | |
b !== a && (u.j(a, "boolean", we, "allowResize"), this.dk = a, this.h("allowResize", b, a)) | |
}); | |
u.defineProperty(we, { | |
Ev: "allowRotate" | |
}, function() { | |
return this.ek | |
}, function(a) { | |
var b = this.ek; | |
b !== a && (u.j(a, "boolean", we, "allowRotate"), this.ek = a, this.h("allowRotate", b, a)) | |
}); | |
u.defineProperty(we, { | |
qf: "allowSelect" | |
}, function() { | |
return this.fk | |
}, function(a) { | |
var b = this.fk; | |
b !== a && (u.j(a, "boolean", we, "allowSelect"), this.fk = a, this.h("allowSelect", b, a)) | |
}); | |
function D(a) { | |
function b() { | |
window.document.removeEventListener("DOMContentLoaded", b, !1); | |
Li(c) | |
} | |
1 < arguments.length && u.k("Diagram constructor can only take one optional argument, the DIV HTML element or its id."); | |
u.gc(this); | |
Mi = []; | |
this.Oc = !0; | |
this.oh = new Te; | |
this.oh.Dc(this); | |
this.Bd = 17; | |
var c = this; | |
null !== window.document.body ? Li(this) : window.document.addEventListener("DOMContentLoaded", b, !1); | |
this.wB = !1; | |
this.$b = new E(we); | |
this.zb = this.Ab = 0; | |
this.Sg = this.Kb = this.Ig = this.kb = null; | |
this.rE(); | |
this.fq = null; | |
this.qE(); | |
this.Na = (new w(NaN, NaN)).freeze(); | |
this.ac = 1; | |
this.uu = (new w(NaN, NaN)).freeze(); | |
this.vu = NaN; | |
this.Mu = 0.0001; | |
this.Ju = 100; | |
this.Td = new ja; | |
this.xv = (new w(NaN, NaN)).freeze(); | |
this.lu = (new z(NaN, NaN, NaN, NaN)).freeze(); | |
this.wy = (new rb(0, 0, 0, 0)).freeze(); | |
this.xy = Ni; | |
this.sy = this.py = null; | |
this.Bl = vf; | |
this.fn = uc; | |
this.tk = vf; | |
this.Cn = uc; | |
this.wu = this.tu = xb; | |
this.Zf = new F(T); | |
this.Nd = !0; | |
this.hq = !1; | |
this.Il = new la(W, z); | |
this.sn = !0; | |
this.lF = 250; | |
this.an = -1; | |
this.Rt = (new rb(16, 16, 16, 16)).freeze(); | |
this.eu = this.Ff = !1; | |
this.wn = !0; | |
this.nk = new Md; | |
this.Ic = new Md; | |
this.Pb = new Md; | |
this.Ui = null; | |
this.nv = -1; | |
this.mv = !1; | |
this.Cx = this.Dx = null; | |
Oi(this); | |
this.Tn = new F(U); | |
this.Ik = new F(V); | |
this.Pn = new F(W); | |
this.Db = new F(G); | |
this.zu = !0; | |
this.mB = !1; | |
this.tv = Hg; | |
this.gj = 10; | |
this.wx = this.Ax = this.Hy = null; | |
this.ux = ""; | |
this.Rp = "auto"; | |
this.$h = this.ui = this.ki = this.Pu = this.li = this.mi = this.ni = this.Zh = this.di = this.Xh = null; | |
this.An = !0; | |
this.jy = !1; | |
this.WB = {}; | |
this.jr = 0; | |
this.Ef = [null, null]; | |
this.kx = null; | |
this.Au = this.Ym = this.Bx = this.yy = this.eC = this.ri = !1; | |
this.yB = !0; | |
this.Ux = this.xd = !1; | |
this.Pd = null; | |
var d = this; | |
this.FB = function(a) { | |
if (a.ha === d.ha && d.Oa) { | |
d.Oa = !1; | |
try { | |
var b = a.Cd; | |
"" === a.Mf && b === $d && Pi(d, a.object, a.propertyName) | |
} finally { | |
d.Oa = !0 | |
} | |
} | |
}; | |
this.GB = function(a) { | |
Qi(d, a) | |
}; | |
this.DC = !0; | |
this.Kg = -2; | |
this.ai = new la(Object, G); | |
this.lk = new la(Object, W); | |
this.Ql = new la(Object, Array); | |
this.Vn = new la("string", Array); | |
this.VB = new E(Ri); | |
this.vk = !1; | |
this.Yj = this.Xj = this.Ht = this.Oe = !0; | |
this.Jt = this.It = !1; | |
this.Ot = this.Mt = this.fk = this.ek = this.dk = this.ck = this.ak = this.bk = this.$j = this.Lt = this.hk = this.Zj = this.gk = !0; | |
this.Nl = this.uB = !1; | |
this.Nt = this.Kt = this.ru = this.qu = !0; | |
this.cv = this.bv = 16; | |
this.ty = this.av = !1; | |
this.vy = this.uy = this.vj = this.uj = null; | |
this.Qe = (new rb(5)).freeze(); | |
this.fv = (new F(G)).freeze(); | |
this.Ku = 999999999; | |
this.su = (new F(G)).freeze(); | |
this.uk = this.Ll = this.fi = !0; | |
this.rk = this.qk = !1; | |
this.Od = null; | |
this.Pt = !0; | |
this.nf = !1; | |
this.uF = new F(W); | |
this.nd = null; | |
this.MB = 1; | |
this.Nx = !1; | |
this.iC = 0; | |
this.CC = (new z(NaN, NaN, NaN, NaN)).freeze(); | |
this.fu = (new z(NaN, NaN, NaN, NaN)).freeze(); | |
this.Yl = new F(Si); | |
Ti(this); | |
this.Fu = this.nu = this.Ru = this.TA = this.SA = this.UA = this.hj = this.ok = this.oi = null; | |
Ui(this); | |
this.bd = null; | |
this.mu = !1; | |
this.gn = null; | |
this.tb = new jf; | |
this.tb.initializeStandardTools(); | |
this.Va = this.az = this.tb; | |
this.Eb = new sa; | |
this.ha = new Q; | |
this.ri = !0; | |
this.Qb = new Je; | |
this.ri = !1; | |
this.dB = this.Fx = null; | |
this.pf = 1; | |
this.mm = null; | |
this.sk = new Vi; | |
void 0 !== a && Wi(this, a); | |
this.Sl = 1; | |
this.Tl = 0; | |
this.AB = new w; | |
this.zC = 500; | |
this.Qt = new w; | |
this.Kr = null; | |
this.Oc = this.Yx = !1 | |
} | |
u.fa("Diagram", D); | |
function Ui(a) { | |
a.oi = new la("string", G); | |
var b = new U, | |
c = new qa; | |
c.bind(new bf("text", "", de)); | |
b.add(c); | |
a.UA = b; | |
a.oi.add("", b); | |
b = new U; | |
c = new qa; | |
c.stroke = "brown"; | |
c.bind(new bf("text", "", de)); | |
b.add(c); | |
a.oi.add("Comment", b); | |
b = new U; | |
b.ql = !1; | |
b.TC = !1; | |
c = new X; | |
c.Fb = "Ellipse"; | |
c.fill = "black"; | |
c.stroke = null; | |
c.za = (new ia(3, 3)).La(); | |
b.add(c); | |
a.oi.add("LinkLabel", b); | |
a.ok = new la("string", V); | |
b = new V; | |
b.$z = "GROUPPANEL"; | |
b.type = Xi; | |
c = new qa; | |
c.font = "bold 12pt sans-serif"; | |
c.bind(new bf("text", "", de)); | |
b.add(c); | |
c = new B(Yi); | |
c.name = "GROUPPANEL"; | |
var d = new X; | |
d.Fb = "Rectangle"; | |
d.fill = "rgba(128,128,128,0.2)"; | |
d.stroke = "black"; | |
c.add(d); | |
d = new ph; | |
d.padding = (new rb(5, 5, 5, 5)).La(); | |
c.add(d); | |
b.add(c); | |
a.SA = b; | |
a.ok.add("", b); | |
a.hj = new la("string", W); | |
b = new W; | |
c = new X; | |
c.vg = !0; | |
b.add(c); | |
c = new X; | |
c.lp = "Standard"; | |
c.fill = "black"; | |
c.stroke = null; | |
c.jb = 0; | |
b.add(c); | |
a.TA = b; | |
a.hj.add("", b); | |
b = new W; | |
c = new X; | |
c.vg = !0; | |
c.stroke = "brown"; | |
b.add(c); | |
a.hj.add("Comment", b); | |
b = new lf; | |
b.type = Yi; | |
c = new X; | |
c.fill = null; | |
c.stroke = "dodgerblue"; | |
c.jb = 3; | |
b.add(c); | |
c = new ph; | |
c.margin = (new rb(1.5, 1.5, 1.5, 1.5)).La(); | |
b.add(c); | |
a.Ru = b; | |
a.nu = b; | |
b = new lf; | |
b.type = ah; | |
c = new X; | |
c.vg = !0; | |
c.fill = null; | |
c.stroke = "dodgerblue"; | |
c.jb = 3; | |
b.add(c); | |
a.Fu = b | |
} | |
function Li(a) { | |
var b = u.createElement("p"); | |
b.style.width = "100%"; | |
b.style.height = "200px"; | |
b.style.boxSizing = "content-box"; | |
var c = u.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 || u.ND || (c = 11); | |
a.Bd = c | |
} | |
D.prototype.toString = function(a) { | |
void 0 === a && (a = 0); | |
var b = ""; | |
this.id && (b = this.id); | |
this.Vk && this.Vk.id && (b = this.Vk.id); | |
b = 'Diagram "' + b + '"'; | |
if (0 >= a) { | |
return b | |
} | |
for (var c = this.$b.i; c.next();) { | |
b += "\n " + c.value.toString(a - 1) | |
} | |
return b | |
}; | |
D.prototype.checkProperties = function() { | |
return u.check(this) | |
}; | |
D.fromDiv = function(a) { | |
var b = a; | |
"string" === typeof a && (b = window.document.getElementById(a)); | |
return b instanceof HTMLDivElement && b.Y instanceof D ? b.Y : null | |
}; | |
u.defineProperty(D, { | |
Vk: "div" | |
}, function() { | |
return this.Kb | |
}, function(a) { | |
null !== a && u.C(a, HTMLDivElement, D, "div"); | |
if (this.Kb !== a) { | |
Mi = []; | |
var b = this.Kb; | |
null !== b ? (b.Y = void 0, b.innerHTML = "", null !== this.kb && (this.kb.removeEventListener("touchstart", this.SE, !1), this.kb.removeEventListener("touchmove", this.RE, !1), this.kb.removeEventListener("touchend", this.QE, !1), this.kb.Fd.Y = null), b = this.tb, null !== b && (b.ef.each(function(a) { | |
a.cancelWaitAfter() | |
}), b.Nf.each(function(a) { | |
a.cancelWaitAfter() | |
}), b.Of.each(function(a) { | |
a.cancelWaitAfter() | |
})), b.cancelWaitAfter(), this.Va.doCancel(), this.Ig = this.kb = null, window.removeEventListener("resize", this.aF, !1), window.removeEventListener("mousemove", this.So, !0), window.removeEventListener("mousedown", this.Ro, !0), window.removeEventListener("mouseup", this.Uo, !0), window.removeEventListener("mousewheel", this.ah, !0), window.removeEventListener("DOMMouseScroll", this.ah, !0), window.removeEventListener("mouseout", this.To, !0)) : this.nf = !1; | |
this.Kb = null; | |
if (null !== a) { | |
if (b = a.Y) { | |
b.Vk = null | |
} | |
Wi(this, a); | |
this.Tz() | |
} | |
} | |
}); | |
function Zi(a) { | |
var b = a.kb; | |
b.addEventListener("touchstart", a.SE, !1); | |
b.addEventListener("touchmove", a.RE, !1); | |
b.addEventListener("touchend", a.QE, !1); | |
b.addEventListener("mousemove", a.So, !1); | |
b.addEventListener("mousedown", a.Ro, !1); | |
b.addEventListener("mouseup", a.Uo, !1); | |
b.addEventListener("mousewheel", a.ah, !1); | |
b.addEventListener("DOMMouseScroll", a.ah, !1); | |
b.addEventListener("mouseout", a.To, !1); | |
b.addEventListener("keydown", a.lH, !1); | |
b.addEventListener("keyup", a.mH, !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.tb.Eo === ai && b.preventDefault() | |
}, !1); | |
b.addEventListener("pointerdown", a.MH, !1); | |
b.addEventListener("pointermove", a.OH, !1); | |
b.addEventListener("pointerleave", a.NH, !1); | |
window.addEventListener("resize", a.aF, !1) | |
} | |
function ki(a, b) { | |
a.mm = null; | |
b && a.iE() | |
} | |
D.prototype.computePixelRatio = function() { | |
if (null !== this.mm) { | |
return this.mm | |
} | |
var a = this.Ig; | |
return (window.devicePixelRatio || 1) / (a.webkitBackingStorePixelRatio || a.mozBackingStorePixelRatio || a.msBackingStorePixelRatio || a.oBackingStorePixelRatio || a.backingStorePixelRatio || 1) | |
}; | |
D.prototype.doMouseMove = function() { | |
this.Va.doMouseMove() | |
}; | |
D.prototype.doMouseDown = function() { | |
this.Va.doMouseDown() | |
}; | |
D.prototype.doMouseUp = function() { | |
this.Va.doMouseUp() | |
}; | |
D.prototype.doMouseWheel = function() { | |
this.Va.doMouseWheel() | |
}; | |
D.prototype.doKeyDown = function() { | |
this.Va.doKeyDown() | |
}; | |
D.prototype.doKeyUp = function() { | |
this.Va.doKeyUp() | |
}; | |
function gi(a) { | |
if (null !== a.kb) { | |
var b = a.Kb; | |
if (0 !== b.clientWidth && 0 !== b.clientHeight) { | |
var c = a.rk ? a.Bd : 0, | |
d = a.qk ? a.Bd : 0, | |
e = a.pf; | |
a.pf = a.computePixelRatio(); | |
a.pf !== e && (a.hq = !0, a.ee()); | |
if (b.clientWidth !== a.Ab + c || b.clientHeight !== a.zb + d) { | |
a.Ll = !0, a.Nd = !0, b = a.Qb, null !== b && b.kw && b.H(), a.xd || a.ee() | |
} | |
} | |
} | |
} | |
D.prototype.focus = D.prototype.focus = function() { | |
this.kb && this.kb.focus() | |
}; | |
function $i(a, b, c) { | |
void 0 === b && (b = a.Ig); | |
void 0 === c && (c = !0); | |
c && (b.Ft = ""); | |
b.Wm = ""; | |
b.Vm = "" | |
} | |
function Ti(a) { | |
var b = new we; | |
b.name = "Background"; | |
a.es(b); | |
b = new we; | |
b.name = ""; | |
a.es(b); | |
b = new we; | |
b.name = "Foreground"; | |
a.es(b); | |
b = new we; | |
b.name = "Adornment"; | |
b.zc = !0; | |
a.es(b); | |
b = new we; | |
b.name = "Tool"; | |
b.zc = !0; | |
b.KD = !0; | |
a.es(b); | |
b = new we; | |
b.name = "Grid"; | |
b.qf = !1; | |
b.Cg = !1; | |
b.zc = !0; | |
a.MF(b, a.xs("Background")) | |
} | |
function aj(a) { | |
a.bd = new B(bj); | |
a.bd.name = "GRID"; | |
var b = new X; | |
b.Fb = "LineH"; | |
b.stroke = "lightgray"; | |
b.jb = 0.5; | |
b.interval = 1; | |
a.bd.add(b); | |
b = new X; | |
b.Fb = "LineH"; | |
b.stroke = "gray"; | |
b.jb = 0.5; | |
b.interval = 5; | |
a.bd.add(b); | |
b = new X; | |
b.Fb = "LineH"; | |
b.stroke = "gray"; | |
b.jb = 1; | |
b.interval = 10; | |
a.bd.add(b); | |
b = new X; | |
b.Fb = "LineV"; | |
b.stroke = "lightgray"; | |
b.jb = 0.5; | |
b.interval = 1; | |
a.bd.add(b); | |
b = new X; | |
b.Fb = "LineV"; | |
b.stroke = "gray"; | |
b.jb = 0.5; | |
b.interval = 5; | |
a.bd.add(b); | |
b = new X; | |
b.Fb = "LineV"; | |
b.stroke = "gray"; | |
b.jb = 1; | |
b.interval = 10; | |
a.bd.add(b); | |
b = new G; | |
b.add(a.bd); | |
b.xf = "Grid"; | |
b.vz = !1; | |
b.JD = !1; | |
b.Cg = !1; | |
b.Az = "GRID"; | |
a.add(b); | |
a.Db.remove(b); | |
a.bd.visible = !1 | |
} | |
D.prototype.LB = function() { | |
if (this.Y.isEnabled) { | |
var a = this.Y; | |
if (a.ty && null !== a.kb) { | |
a.av = !0; | |
var b = a.Ed, | |
c = a.ob, | |
d = b.width, | |
e = c.width, | |
f = b.height, | |
h = c.height, | |
k = b.right, | |
l = c.right, | |
m = b.bottom, | |
n = c.bottom, | |
p = b.x, | |
q = c.x, | |
b = b.y, | |
c = c.y, | |
r = a.scale; | |
if (e < d || h < f) { | |
var s = u.K(); | |
this.bC && a.Se ? (s.m(this.scrollLeft / r + p, a.position.y), a.position = s) : this.cC && a.Te && (s.m(a.position.x, this.scrollTop / r + b), a.position = s); | |
u.v(s); | |
a.av = !1; | |
a.Ll = !1 | |
} else { | |
s = u.K(), this.bC && a.Se && (p < q && (a.position = new w(this.scrollLeft + p, a.position.y)), k > l && (a.position = new w(-(a.uj.scrollWidth - a.Ab) + this.scrollLeft - a.Ab / r + a.Ed.right, a.position.y))), this.cC && a.Te && (b < c && (a.position = new w(a.position.x, this.scrollTop + b)), m > n && (a.position = new w(a.position.x, -(a.vj.scrollHeight - a.zb) + this.scrollTop - a.zb / r + a.Ed.bottom))), u.v(s), cj(a), a.av = !1, a.Ll = !1, b = a.Ed, c = a.ob, k = b.right, l = c.right, m = b.bottom, n = c.bottom, p = b.x, q = c.x, b = b.y, c = c.y, e >= d && p >= q && k <= l && (a.uy.style.width = "1px"), h >= f && b >= c && m <= n && (a.vy.style.height = "1px") | |
} | |
} | |
} else { | |
dj(this.Y) | |
} | |
}; | |
D.prototype.Tu = function() { | |
this.Y.isEnabled ? this.Y.ty = !0 : dj(this.Y) | |
}; | |
D.prototype.computeBounds = D.prototype.mg = function() { | |
0 < this.Zf.count && ej(this); | |
return fj(this) | |
}; | |
function fj(a) { | |
if (a.vD.I()) { | |
var b = a.vD.copy(); | |
b.zv(a.padding); | |
return b | |
} | |
for (var c = !0, d = a.$b.n, e = d.length, f = 0; f < e; f++) { | |
var h = d[f]; | |
if (h.visible && (!h.zc || h.KD)) { | |
for (var h = h.Db.n, k = h.length, l = 0; l < k; l++) { | |
var m = h[l]; | |
m.vz && m.Ia() && (m = m.ca, m.I() && (c ? (c = !1, b = m.copy()) : b.Uh(m))) | |
} | |
} | |
} | |
c && (b = new z(0, 0, 0, 0)); | |
b.zv(a.padding); | |
return b | |
} | |
D.prototype.computePartsBounds = function(a) { | |
var b = null; | |
for (a = a.i; a.next();) { | |
var c = a.value; | |
c instanceof W || (c.rf(), null === b ? b = c.ca.copy() : b.Uh(c.ca)) | |
} | |
return null === b ? new z(NaN, NaN, 0, 0) : b | |
}; | |
function gj(a, b) { | |
if ((b || a.nf) && !a.Oc && null !== a.kb && !a.Mb.Xg && a.Ed.I()) { | |
a.Oc = !0; | |
var c = a.Bl; | |
b && a.tk !== vf && (c = a.tk); | |
var d = c !== vf ? hj(a, c) : a.scale, | |
c = a.ob.copy(), | |
e = a.Ab / d, | |
f = a.zb / d, | |
h = null, | |
k = a.Mb; | |
k.cd && (h = a.Na.copy()); | |
a.position.Ma(); | |
var l = a.fn; | |
b && !l.Vc() && a.Cn.Vc() && (l = a.Cn); | |
ij(a, a.Na, a.Ed, e, f, l, b); | |
a.position.freeze(); | |
null !== h && si(k, h, a.Na); | |
a.scale = d; | |
a.Oc = !1; | |
d = a.ob; | |
d.pd(c) || a.et(c, d) | |
} | |
} | |
function hj(a, b) { | |
var c = a.Eb.Pv; | |
if (null === a.kb) { | |
return c | |
} | |
a.fi && jj(a, a.mg()); | |
var d = a.Ed; | |
if (!d.I()) { | |
return c | |
} | |
var e = d.width, | |
d = d.height, | |
f = a.Ab, | |
h = a.zb, | |
k = f / e, | |
l = h / d; | |
return b === kj ? (e = Math.min(l, k), e > c && (e = c), e < a.$g && (e = a.$g), e > a.Zg && (e = a.Zg), e) : b === lj ? (e = l > k ? (h - a.Bd) / d : (f - a.Bd) / e, e > c && (e = c), e < a.$g && (e = a.$g), e > a.Zg && (e = a.Zg), e) : a.scale | |
} | |
D.prototype.zoomToFit = D.prototype.zoomToFit = function() { | |
this.scale = hj(this, kj) | |
}; | |
D.prototype.zoomToRect = function(a, b) { | |
void 0 === b && (b = kj); | |
var c = a.width, | |
d = a.height; | |
if (!(0 === c || 0 === d || isNaN(c) && isNaN(d))) { | |
var e = 1; | |
if (b === kj || b === lj) { | |
if (isNaN(c)) { | |
e = this.ob.height * this.scale / d | |
} else { | |
if (isNaN(d)) { | |
e = this.ob.width * this.scale / c | |
} else { | |
var e = this.Ab, | |
f = this.zb, | |
e = b === lj ? f / d > e / c ? (f - (this.qk ? this.Bd : 0)) / d : (e - (this.rk ? this.Bd : 0)) / c : Math.min(f / d, e / c) | |
} | |
} | |
} | |
this.scale = e; | |
this.position = new w(a.x, a.y) | |
} | |
}; | |
u.defineProperty(D, { | |
rz: null | |
}, function() { | |
return this.Oc | |
}, function(a) { | |
this.Oc = a | |
}); | |
D.prototype.alignDocument = function(a, b) { | |
this.fi && jj(this, this.mg()); | |
var c = this.Ed, | |
d = this.ob; | |
this.position = new w(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 ij(a, b, c, d, e, f, h) { | |
var k = b.x, | |
l = b.y; | |
if (h || a.zE === Ni) { | |
f.Vc() && (d > c.width && (k = c.x + (f.x * c.width + f.offsetX) - (f.x * d - f.offsetX)), e > c.height && (l = c.y + (f.y * c.height + f.offsetY) - (f.y * e - f.offsetY))), f = a.yE, h = d - c.width, d < c.width + f.left + f.right ? (k = Math.min(k + d / 2, c.right + Math.max(h, f.right) - d / 2), k = Math.max(k, c.left - Math.max(h, f.left) + d / 2), k -= d / 2) : k > c.left ? k = c.left : k < c.right - d && (k = c.right - d), d = e - c.height, e < c.height + f.top + f.bottom ? (l = Math.min(l + e / 2, c.bottom + Math.max(d, f.bottom) - e / 2), l = Math.max(l, c.top - Math.max(d, f.top) + e / 2), l -= e / 2) : l > c.top ? l = c.top : l < c.bottom - e && (l = c.bottom - e) | |
} | |
b.x = isFinite(k) ? k : -a.padding.left; | |
b.y = isFinite(l) ? l : -a.padding.top; | |
null !== a.hE && (a = a.hE(a, b), b.x = a.x, b.y = a.y) | |
} | |
D.prototype.findPartAt = D.prototype.As = function(a, b) { | |
var c = b ? wg(this, a, function(a) { | |
return a.W | |
}, function(a) { | |
return a.canSelect() | |
}) : wg(this, a, function(a) { | |
return a.W | |
}); | |
return c instanceof G ? c : null | |
}; | |
D.prototype.findObjectAt = D.prototype.le = function(a, b, c) { | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
ej(this); | |
for (var d = this.$b.Jm; d.next();) { | |
var e = d.value; | |
if (e.visible && (e = e.le(a, b, c), null !== e)) { | |
return e | |
} | |
} | |
return null | |
}; | |
function wg(a, b, c, d) { | |
void 0 === c && (c = null); | |
void 0 === d && (d = null); | |
ej(a); | |
for (a = a.$b.Jm; a.next();) { | |
var e = a.value; | |
if (e.visible && !e.zc && (e = e.le(b, c, d), null !== e)) { | |
return e | |
} | |
} | |
return null | |
} | |
D.prototype.findObjectsAt = D.prototype.zs = function(a, b, c, d) { | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
d instanceof E || d instanceof F || (d = new F(T)); | |
ej(this); | |
for (var e = this.$b.Jm; e.next();) { | |
var f = e.value; | |
f.visible && f.zs(a, b, c, d) | |
} | |
return d | |
}; | |
D.prototype.findObjectsIn = D.prototype.Nj = function(a, b, c, d, e) { | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
void 0 === d && (d = !1); | |
e instanceof E || e instanceof F || (e = new F(T)); | |
ej(this); | |
for (var f = this.$b.Jm; f.next();) { | |
var h = f.value; | |
h.visible && h.Nj(a, b, c, d, e) | |
} | |
return e | |
}; | |
D.prototype.ez = function(a, b, c, d, e, f) { | |
var h = new F(T); | |
ej(this); | |
for (var k = this.$b.Jm; k.next();) { | |
var l = k.value; | |
l.visible && l.ez(a, b, c, d, h, e, f) | |
} | |
return h | |
}; | |
D.prototype.findObjectsNear = D.prototype.Cm = function(a, b, c, d, e, f) { | |
void 0 === c && (c = null); | |
void 0 === d && (d = null); | |
void 0 === e && (e = !0); | |
if (!1 !== e && !0 !== e) { | |
if (e instanceof E || e instanceof F) { | |
f = e | |
} | |
e = !0 | |
} | |
f instanceof E || f instanceof F || (f = new F(T)); | |
ej(this); | |
for (var h = this.$b.Jm; h.next();) { | |
var k = h.value; | |
k.visible && k.Cm(a, b, c, d, e, f) | |
} | |
return f | |
}; | |
function yf(a) { | |
-1 !== a.nv && (u.clearTimeout(a.nv), a.nv = -1) | |
} | |
function mj(a, b) { | |
var c = b.copy(); | |
a.nv = u.setTimeout(function() { | |
c.button = 2; | |
a.N = c; | |
a.mv = !0; | |
a.doMouseUp() | |
}, 850) | |
} | |
D.prototype.acceptEvent = function(a) { | |
var b = this.Ic; | |
this.Ic = this.Pb; | |
this.Pb = b; | |
nj(this, this, a, b, a instanceof MouseEvent); | |
return b | |
}; | |
function nj(a, b, c, d, e) { | |
d.g = b; | |
e ? oj(a, c, d) : (d.hf = b.Pb.hf, d.da = b.Pb.da); | |
a = 0; | |
c.ctrlKey && (a += 1); | |
c.altKey && (a += 2); | |
c.shiftKey && (a += 4); | |
c.metaKey && (a += 8); | |
d.jd = a; | |
d.button = c.button; | |
u.Im && 0 === c.button && c.ctrlKey && (d.button = 2); | |
d.Wk = !1; | |
d.up = !1; | |
d.Ue = 1; | |
d.Uk = 0; | |
d.Tc = !1; | |
d.bubbles = !1; | |
d.event = c; | |
d.timestamp = Date.now(); | |
d.Qs = !1; | |
d.Eg = c.target.Y ? c.target.Y : null; | |
d.qe = null | |
} | |
function pj(a, b, c, d, e) { | |
d.g = a; | |
oj(a, c, d); | |
d.jd = 0; | |
d.button = 0; | |
d.Wk = !0; | |
d.up = !1; | |
d.Ue = 1; | |
d.Uk = 0; | |
d.Tc = !1; | |
d.bubbles = !0; | |
d.event = b; | |
d.timestamp = Date.now(); | |
d.Qs = e; | |
d.Eg = b.target.Y ? b.target.Y : null; | |
d.qe = null; | |
a.nk = d.copy(); | |
Ef = null | |
} | |
function qj(a, b, c, d, e) { | |
var f = null; | |
d.g = a; | |
if (null !== c) { | |
var f = window.document.elementFromPoint(c.clientX, c.clientY), | |
h; | |
f && f.Y ? h = f.Y : (c = b.changedTouches[0], h = a); | |
oj(a, c, d) | |
} else { | |
null !== a.Ic ? (d.da = a.Ic.da, d.hf = a.Ic.hf, d.Eg = a.Ic.Eg) : null !== a.nk && (d.da = a.nk.da, d.hf = a.nk.hf, d.Eg = a.nk.Eg) | |
} | |
d.jd = 0; | |
d.button = 0; | |
d.Wk = !1; | |
d.up = !1; | |
d.Ue = 1; | |
d.Uk = 0; | |
d.Tc = !1; | |
d.bubbles = !1; | |
d.event = b; | |
d.timestamp = Date.now(); | |
d.Qs = e; | |
d.Eg = h; | |
d.qe = null | |
} | |
function rj(a, b) { | |
if (a.bubbles) { | |
return !0 | |
} | |
void 0 !== b.stopPropagation && b.stopPropagation(); | |
(void 0 === b.touches || 2 > b.touches.length) && b.preventDefault(); | |
b.cancelBubble = !0; | |
return !1 | |
} | |
D.prototype.lH = function(a) { | |
if (!this.Y.isEnabled) { | |
return !1 | |
} | |
var b = this.Y.Pb; | |
nj(this.Y, this.Y, a, b, !1); | |
b.key = String.fromCharCode(a.which); | |
b.Wk = !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.Y.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 ? rj(b, a) : (a.cancelBubble = !0, a.preventDefault(), a.stopPropagation(), !1) | |
}; | |
D.prototype.mH = function(a) { | |
if (!this.Y.isEnabled) { | |
return !1 | |
} | |
var b = this.Y.Pb; | |
nj(this.Y, this.Y, 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.Y.doKeyUp(); | |
return rj(b, a) | |
}; | |
D.prototype.bq = function(a) { | |
var b = this.kb; | |
if (null === b) { | |
return new w(0, 0) | |
} | |
var c = this.Ab, | |
d = this.zb, | |
b = b.getBoundingClientRect(), | |
c = a.clientX - c / b.width * b.left; | |
a = a.clientY - d / b.height * b.top; | |
return null !== this.Td ? (a = new w(c, a), Wa(a, this.Td), a) : new w(c, a) | |
}; | |
function oj(a, b, c) { | |
var d = a.kb, | |
e = a.Ab, | |
f = a.zb, | |
h = 0, | |
k = 0; | |
null !== d && (d = d.getBoundingClientRect(), h = b.clientX - e / d.width * d.left, k = b.clientY - f / d.height * d.top); | |
c.hf.m(h, k); | |
null !== a.Td ? (b = u.Yb(h, k), a.Td.Qh(b), c.da.assign(b), u.v(b)) : c.da.m(h, k) | |
} | |
D.prototype.invalidateDocumentBounds = D.prototype.pc = function() { | |
this.fi || (this.fi = !0, this.ee(!0)) | |
}; | |
function qi(a) { | |
a.xd || ej(a); | |
a.fi && jj(a, a.mg()); | |
for (a = a.Yl.i; a.next();) { | |
qi(a.value) | |
} | |
} | |
D.prototype.redraw = D.prototype.Tz = function() { | |
this.Oc || this.xd || (this.na(), sj(this), cj(this), this.pc(), this.df()) | |
}; | |
D.prototype.isUpdateRequested = function() { | |
return this.Ff | |
}; | |
D.prototype.delayInitialization = D.prototype.pG = function(a) { | |
void 0 === a && (a = null); | |
var b = this.Mb, | |
c = b.isEnabled; | |
b.Ni(); | |
b.isEnabled = !1; | |
Dg(this); | |
this.nf = !1; | |
b.isEnabled = c; | |
null !== a && u.setTimeout(a, 1) | |
}; | |
D.prototype.requestUpdate = D.prototype.ee = function(a) { | |
void 0 === a && (a = !1); | |
if (!0 !== this.Ff && !(this.Oc || !1 === a && this.xd)) { | |
this.Ff = !0; | |
var b = this; | |
requestAnimationFrame(function() { | |
b.Ff && b.df() | |
}) | |
} | |
}; | |
D.prototype.maybeUpdate = D.prototype.df = function() { | |
if (!this.wn || this.Ff) { | |
this.wn && (this.wn = !1), Dg(this) | |
} | |
}; | |
function tj(a, b) { | |
a.Oc || !a.Ll || dj(a) || (b && ej(a), gj(a, !1)) | |
} | |
function Dg(a) { | |
if (!a.xd && (a.Ff = !1, null !== a.Kb)) { | |
a.xd = !0; | |
var b = a.oh, | |
c = a.VB; | |
if (!b.Hn && 0 !== c.length) { | |
for (var d = c.n, e = d.length, f = 0; f < e; f++) { | |
var h = d[f]; | |
uj(h, !1); | |
h.S() | |
} | |
c.clear() | |
} | |
d = c = !1; | |
b.Xg && (d = !0, c = a.gb, a.gb = !0); | |
b.cd || gi(a); | |
tj(a, !1); | |
null !== a.bd && (a.bd.visible && !a.mu && (vj(a), a.mu = !0), !a.bd.visible && a.mu && (a.mu = !1)); | |
ej(a); | |
0 !== a.Il.count && (wj(a), ej(a)); | |
e = !1; | |
if (!a.nf || a.Pt) { | |
a.nf ? xj(a, !a.eu) : (a.Xb("Initial Layout"), !1 === b.isEnabled && b.Ni(), xj(a, !1)), e = !0 | |
} | |
a.eu = !1; | |
ej(a); | |
a.yy || b.Xg || qi(a); | |
e && (a.nf || (b = a.$b.n, a.yf(b, b.length, a), yj(a), vj(a)), a.Ba("LayoutCompleted")); | |
tj(a, !0); | |
ej(a); | |
e && !a.nf && (a.nf = !0, a.Xd("Initial Layout"), a.gb || a.ga.clear(), u.setTimeout(function() { | |
a.Sh = !1 | |
}, 1)); | |
a.Xe(); | |
d && (a.gb = c); | |
a.xd = !1 | |
} | |
} | |
function yj(a) { | |
if (a.tk !== vf) { | |
a.scale = hj(a, a.tk) | |
} else { | |
if (a.Bl !== vf) { | |
a.scale = hj(a, a.Bl) | |
} else { | |
var b = a.VG; | |
isFinite(b) && 0 < b && (a.scale = b) | |
} | |
} | |
a.fi && jj(a, a.mg()); | |
b = a.UG; | |
if (b.I()) { | |
a.position = b | |
} else { | |
b = u.K(); | |
b.qt(a.Ed, a.TG); | |
var c = a.ob, | |
c = u.Vj(0, 0, c.width, c.height), | |
d = u.K(); | |
d.qt(c, a.WG); | |
a.position = new w(b.x - d.x, b.y - d.y); | |
u.ic(c); | |
u.v(d); | |
u.v(b); | |
gj(a, !0) | |
} | |
a.Ba("InitialLayoutCompleted") | |
} | |
function ej(a) { | |
if ((a.xd || !a.Mb.Xg) && 0 !== a.Zf.count) { | |
for (var b = 0; 23 > b; b++) { | |
var c = a.Zf.i; | |
if (null === c || 0 === a.Zf.count) { | |
break | |
} | |
a.Zf = new F(T); | |
var d = a, | |
e = a.Zf; | |
for (c.reset(); c.next();) { | |
var f = c.value; | |
!f.Hd() || f instanceof V || !f.Ia() || (f.hl() ? (Ph(f, Infinity, Infinity), f.yc()) : e.add(f)) | |
} | |
for (c.reset(); c.next();) { | |
f = c.value, f instanceof V && f.Ia() && zj(d, f) | |
} | |
for (c.reset(); c.next();) { | |
f = c.value, f instanceof W && (d = f, d.Ia() && (d.hl() ? (Ph(d, Infinity, Infinity), d.yc(), d.Ys()) : e.add(d))) | |
} | |
for (c.reset(); c.next();) { | |
d = c.value, d instanceof lf && d.Ia() && (d.hl() ? (Ph(d, Infinity, Infinity), d.yc()) : e.add(d)) | |
} | |
} | |
} | |
} | |
function zj(a, b) { | |
for (var c = u.hb(), d = u.hb(), e = b.Lc; e.next();) { | |
var f = e.value; | |
f.Ia() && (f instanceof V ? (Aj(f) || Bj(f) || Cj(f)) && zj(a, f) : f instanceof W ? f.V == b || f.ba == b ? d.push(f) : c.push(f) : (Ph(f, Infinity, Infinity), f.yc())) | |
} | |
for (var e = c.length, h = 0; h < e; h++) { | |
f = c[h], Ph(f, Infinity, Infinity), f.yc() | |
} | |
u.sa(c); | |
Ph(b, Infinity, Infinity); | |
b.yc(); | |
e = d.length; | |
for (h = 0; h < e; h++) { | |
f = d[h], Ph(f, Infinity, Infinity), f.yc() | |
} | |
u.sa(d) | |
} | |
D.prototype.yf = function(a, b, c, d) { | |
var e = this.oh; | |
if (this.uk || e.Xg) { | |
for (e = 0; e < b; e++) { | |
a[e].yf(c, d) | |
} | |
} | |
}; | |
D.prototype.Xe = function(a, b) { | |
void 0 === a && (a = this.Ig); | |
void 0 === b && (b = null); | |
null === this.Kb && u.k("No div specified"); | |
var c = this.kb; | |
null === c && u.k("No canvas specified"); | |
if (this.oh.cd) { | |
0 === this.ga.Me && this.ee(!0) | |
} else { | |
Dj(this); | |
var d = a !== this.Ig, | |
e = this.$b.n, | |
f = e.length, | |
h = this; | |
this.yf(e, f, h); | |
if (d) { | |
$i(this, a), cj(this) | |
} else { | |
if (!this.Nd && null === b) { | |
return | |
} | |
} | |
var f = this.Na, | |
k = this.ac, | |
l = Math.round(f.x * k) / k, | |
m = Math.round(f.y * k) / k, | |
n = this.Td; | |
n.reset(); | |
1 !== k && n.scale(k); | |
0 === f.x && 0 === f.y || n.translate(-l, -m); | |
k = this.pf; | |
u.Hm ? (c.width = c.width, $i(this, a), a.scale(k, k)) : (a.setTransform(1, 0, 0, 1, 0, 0), a.scale(k, k), a.clearRect(0, 0, this.Ab, this.zb)); | |
a.miterLimit = 9; | |
a.setTransform(1, 0, 0, 1, 0, 0); | |
a.scale(k, k); | |
a.transform(n.m11, n.m12, n.m21, n.m22, n.dx, n.dy); | |
c = null !== b ? function(c) { | |
var d = a, | |
e = b; | |
if (c.visible && 0 !== c.Hc) { | |
1 !== c.Hc && (d.globalAlpha = c.Hc); | |
var f = c.Wu; | |
f.length = 0; | |
var k = h.scale; | |
c = c.Db.n; | |
for (var l = c.length, m = 0; m < l; m++) { | |
var n = c[m]; | |
if ((ti(n) || vi(n)) && !e.contains(n)) { | |
if (n instanceof W) { | |
var y = n; | |
y.ec && f.push(y); | |
if (!1 === y.jg) { | |
continue | |
} | |
} | |
y = n.ca; | |
1 < y.width * k || 1 < y.height * k ? n.Xe(d, h) : wi(n, d) | |
} | |
} | |
d.globalAlpha = 1 | |
} | |
} : function(b) { | |
b.Xe(a, h) | |
}; | |
Ej(this, a); | |
f = e.length; | |
for (l = 0; l < f; l++) { | |
a.setTransform(1, 0, 0, 1, 0, 0), a.scale(k, k), a.transform(n.m11, n.m12, n.m21, n.m22, n.dx, n.dy), c(e[l]) | |
} | |
this.sk ? this.sk.xl(this) && this.ax() : this.bq = function() { | |
return new w(0, 0) | |
}; | |
d ? ($i(this), cj(this)) : this.Nd = this.uk = !1 | |
} | |
}; | |
function Fj(a, b, c, d, e) { | |
null === a.Kb && u.k("No div specified"); | |
var f = a.kb; | |
null === f && u.k("No canvas specified"); | |
var h = a.Ig; | |
if (a.Nd) { | |
Dj(a); | |
var k = a.pf; | |
u.Hm ? (f.width = f.width, $i(a, h)) : (h.setTransform(1, 0, 0, 1, 0, 0), h.clearRect(0, 0, a.Ab * k, a.zb * k)); | |
h.GD = !1; | |
h.drawImage(a.Fx.Fd, 0 < d ? 0 : Math.round(-d), 0 < e ? 0 : Math.round(-e)); | |
e = a.Na; | |
var f = a.ac, | |
l = Math.round(e.x * f) / f, | |
m = Math.round(e.y * f) / f; | |
d = a.Td; | |
d.reset(); | |
1 !== f && d.scale(f); | |
0 === e.x && 0 === e.y || d.translate(-l, -m); | |
h.save(); | |
h.beginPath(); | |
e = c.length; | |
for (f = 0; f < e; f++) { | |
l = c[f], 0 !== l.width && 0 !== l.height && h.rect(Math.floor(l.x), Math.floor(l.y), Math.ceil(l.width), Math.ceil(l.height)) | |
} | |
h.clip(); | |
h.setTransform(1, 0, 0, 1, 0, 0); | |
h.scale(k, k); | |
h.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy); | |
c = a.$b.n; | |
e = c.length; | |
a.yf(c, e, a); | |
Ej(a, h); | |
for (f = 0; f < e; f++) { | |
xi(c[f], h, a, b) | |
} | |
h.restore(); | |
$i(a); | |
a.sk ? a.sk.xl(a) && a.ax() : a.bq = function() { | |
return new w(0, 0) | |
}; | |
a.uk = !1; | |
a.Nd = !1; | |
a.iE() | |
} | |
} | |
function Gj(a, b, c, d, e, f, h, k, l, m) { | |
null === a.Kb && u.k("No div specified"); | |
null === a.kb && u.k("No canvas specified"); | |
void 0 === h && (h = null); | |
void 0 === k && (k = null); | |
void 0 === l && (l = !1); | |
void 0 === m && (m = !1); | |
Dj(a); | |
$i(a); | |
cj(a); | |
a.Ux = !0; | |
var n = new z(f.x, f.y, d.width / e, d.height / e), | |
p = n.copy(); | |
p.zv(c); | |
vj(a, p); | |
ej(a); | |
var p = a.$b.n, | |
q = p.length; | |
a.yf(p, q, a, n); | |
var r = a.pf; | |
b.setTransform(1, 0, 0, 1, 0, 0); | |
b.scale(r, r); | |
b.clearRect(0, 0, d.width, d.height); | |
null !== k && "" !== k && (b.fillStyle = k, b.fillRect(0, 0, d.width, d.height)); | |
d = u.lh(); | |
d.reset(); | |
d.translate(c.left, c.top); | |
d.scale(e); | |
0 === f.x && 0 === f.y || d.translate(-f.x, -f.y); | |
b.setTransform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy); | |
u.Ze(d); | |
Ej(a, b); | |
if (null !== h) { | |
var s = new F(T); | |
c = h.i; | |
for (c.reset(); c.next();) { | |
e = c.value, !1 === m && "Grid" === e.layer.name || null === e || s.add(e) | |
} | |
c = function(c) { | |
var d = l; | |
if (c.visible && 0 !== c.Hc && (void 0 === d && (d = !0), d || !c.zc)) { | |
1 !== c.Hc && (b.globalAlpha = c.Hc); | |
d = c.Wu; | |
d.length = 0; | |
var e = a.scale; | |
c = c.Db.n; | |
for (var f = c.length, h = 0; h < f; h++) { | |
var k = c[h]; | |
if ((ti(k) || vi(k)) && s.contains(k)) { | |
if (k instanceof W) { | |
var m = k; | |
m.ec && d.push(m); | |
if (!1 === m.jg) { | |
continue | |
} | |
} | |
m = k.ca; | |
1 < m.width * e || 1 < m.height * e ? k.Xe(b, a) : wi(k, b) | |
} | |
} | |
b.globalAlpha = 1 | |
} | |
} | |
} else { | |
if (!l && m) { | |
var t = a.Hs.W, | |
v = t.layer; | |
c = function(c) { | |
c === v ? t.Xe(b, a) : c.Xe(b, a, n, l, m) | |
} | |
} else { | |
c = function(c) { | |
c.Xe(b, a, n, l, m) | |
} | |
} | |
} | |
for (e = 0; e < q; e++) { | |
c(p[e]) | |
} | |
a.Ux = !1; | |
a.sk ? a.sk.xl(a) && a.ax() : a.bq = function() { | |
return new w(0, 0) | |
}; | |
$i(a); | |
cj(a); | |
a.yf(p, q, a); | |
vj(a) | |
} | |
D.prototype.getRenderingHint = D.prototype.$v = function(a) { | |
return this.Sg[a] | |
}; | |
D.prototype.setRenderingHint = D.prototype.kI = function(a, b) { | |
this.Sg[a] = b; | |
this.Tz() | |
}; | |
D.prototype.resetRenderingHints = D.prototype.rE = function() { | |
this.Sg = new pa; | |
this.Sg.drawShadows = !0; | |
this.Sg.textGreeking = !0; | |
this.Sg.viewportOptimizations = u.ND ? !1 : !0; | |
this.Sg.temporaryPixelRatio = !0; | |
this.Sg.pictureRatioOptimization = !0 | |
}; | |
function Ej(a, b) { | |
var c = a.Sg; | |
if (null !== c) { | |
if (void 0 !== c.imageSmoothingEnabled) { | |
var d = !!c.imageSmoothingEnabled; | |
b.GD = d; | |
b.dK = d | |
} | |
c = c.defaultFont; | |
void 0 !== c && null !== c && (b.font = c, b.Ft = c) | |
} | |
} | |
D.prototype.getInputOption = D.prototype.hz = function(a) { | |
return this.fq[a] | |
}; | |
D.prototype.setInputOption = function(a, b) { | |
this.fq[a] = b | |
}; | |
D.prototype.resetInputOptions = D.prototype.qE = function() { | |
this.fq = new pa; | |
this.fq.extraTouchArea = 10; | |
this.fq.extraTouchThreshold = 10 | |
}; | |
D.prototype.setProperties = function(a) { | |
u.pt(this, a) | |
}; | |
function wj(a) { | |
if (0 === a.ga.Me) { | |
for (var b = a.Il.i; b.next();) { | |
var c = b.key, | |
d = b.value; | |
c.me(); | |
eh(c, d) | |
} | |
a.Il.clear() | |
} | |
} | |
D.prototype.na = function(a) { | |
void 0 === a && (a = null); | |
if (null === a) { | |
this.Nd = !0, this.ee() | |
} else { | |
var b = this.ob; | |
null !== a && a.I() && b.ug(a) && (this.Nd = !0, this.ee()) | |
} | |
for (b = this.Yl.i; b.next();) { | |
b.value.na(a) | |
} | |
}; | |
D.prototype.oz = function(a, b) { | |
if (!0 !== this.Nd) { | |
this.Nd = !0; | |
var c = !0 === this.$v("temporaryPixelRatio"); | |
if (!0 === this.$v("viewportOptimizations") && this.zE !== Hj && this.yE.Tv(0, 0, 0, 0) && b.width === a.width && b.height === a.height) { | |
var d = this.scale, | |
e = u.Tf(), | |
f = Math.max(a.x, b.x), | |
h = Math.max(a.y, b.y), | |
k = Math.min(a.x + a.width, b.x + b.width), | |
l = Math.min(a.y + a.height, b.y + b.height); | |
e.x = f; | |
e.y = h; | |
e.width = Math.max(0, k - f) * d; | |
e.height = Math.max(0, l - h) * d; | |
if (0 < e.width && 0 < e.height) { | |
if (!this.xd && (this.Ff = !1, null !== this.Kb)) { | |
this.xd = !0; | |
ej(this); | |
0 !== this.Il.count && (wj(this), ej(this)); | |
this.Ed.I() || jj(this, this.mg()); | |
var m = this.kb; | |
if (null !== m) { | |
var n = this.pf, | |
h = this.Ab * n, | |
k = this.zb * n, | |
f = this.scale * n, | |
d = Math.round(Math.round(b.x * f) - Math.round(a.x * f)), | |
f = Math.round(Math.round(b.y * f) - Math.round(a.y * f)), | |
l = this.Fx, | |
p = this.dB; | |
l.width !== h && (l.width = h); | |
l.height !== k && (l.height = k); | |
p.clearRect(0, 0, h, k); | |
var l = 190 * this.pf, | |
q = 70 * this.pf, | |
r = Math.max(d, 0), | |
s = Math.max(f, 0), | |
t = Math.floor(h - r), | |
v = Math.floor(k - s); | |
p.GD = !1; | |
p.drawImage(m.Fd, r, s, t, v, 0, 0, t, v); | |
this.sk.xl(this) && p.clearRect(0, 0, l, q); | |
var m = u.hb(), | |
p = u.hb(), | |
v = Math.abs(d), | |
t = Math.abs(f), | |
x = 0 === r ? 0 : h - v, | |
r = u.Yb(x, 0), | |
v = u.Yb(v + x, k); | |
p.push(new z(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 A = this.Td; | |
A.reset(); | |
A.scale(n, n); | |
1 !== this.ac && A.scale(this.ac); | |
n = this.Na; | |
(0 !== n.x || 0 !== n.y) && isFinite(n.x) && isFinite(n.y) && A.translate(-n.x, -n.y); | |
Wa(r, A); | |
Wa(v, A); | |
m.push(new z(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.m(0, x); | |
v.m(h, t + x); | |
p.push(new z(Math.min(r.x, v.x), Math.min(r.y, v.y), Math.abs(r.x - v.x), Math.abs(r.y - v.y))); | |
Wa(r, A); | |
Wa(v, A); | |
m.push(new z(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.sk.xl(this) && (h = 0 < d ? 0 : -d, k = 0 < f ? 0 : -f, r.m(h, k), v.m(l + h, q + k), p.push(new z(Math.min(r.x, v.x), Math.min(r.y, v.y), Math.abs(r.x - v.x), Math.abs(r.y - v.y))), Wa(r, A), Wa(v, A), m.push(new z(Math.min(r.x, v.x), Math.min(r.y, v.y), Math.abs(r.x - v.x), Math.abs(r.y - v.y)))); | |
u.v(r); | |
u.v(v); | |
tj(this, !1); | |
Fj(this, m, p, d, f); | |
u.sa(m); | |
u.sa(p); | |
this.xd = !1 | |
} | |
} | |
} else { | |
this.df() | |
} | |
u.ic(e); | |
c && (this.mm = 1, this.df(), ki(this, !0)) | |
} else { | |
c ? (this.mm = 1, this.df(), ki(this, !0)) : this.df() | |
} | |
for (c = this.Yl.i; c.next();) { | |
c.value.oz() | |
} | |
} | |
}; | |
function sj(a) { | |
!1 === a.Ll && (a.Ll = !0) | |
} | |
function cj(a) { | |
!1 === a.uk && (a.uk = !0) | |
} | |
function Dj(a) { | |
!1 !== a.hq && (a.hq = !1, Ij(a, a.Ab, a.zb)) | |
} | |
function Ij(a, b, c) { | |
var d = a.kb, | |
e = a.pf, | |
f = b * e, | |
e = c * e; | |
if (d.width !== f || d.height !== e) { | |
d.width = f, d.height = e, d.style.width = b + "px", d.style.height = c + "px", a.Nd = !0, $i(a) | |
} | |
} | |
function dj(a) { | |
var b = a.kb; | |
if (null === b) { | |
return !0 | |
} | |
var c = a.Kb, | |
d = a.Ab, | |
e = a.zb, | |
f = a.CC.copy(), | |
h = !1, | |
k = a.rk ? a.Bd : 0, | |
l = a.qk ? a.Bd : 0, | |
m = c.clientWidth || d + k, | |
c = c.clientHeight || e + l; | |
if (m !== d + k || c !== e + l) { | |
a.rk = !1, a.qk = !1, l = k = 0, a.Ab = m, a.zb = c, h = a.hq = !0 | |
} | |
a.Ll = !1; | |
if (a.Mb.Xg) { | |
return h ? (a.Mb.Ni(), a.pG(), !1) : !0 | |
} | |
var n = a.ob, | |
p = a.Ed, | |
m = p.width, | |
c = p.height, | |
q = n.width, | |
r = n.height, | |
s = p.x, | |
t = n.x, | |
v = p.right, | |
k = n.right + k, | |
x = p.y, | |
A = n.y, | |
p = p.bottom, | |
l = n.bottom + l, | |
y = n = "1px", | |
C = a.scale; | |
a.lz && a.Se && (n = 1, s + 1 < t && (n = Math.max((t - s) * C + a.Ab, n)), v > k + 1 && (n = Math.max((v - k) * C + a.Ab, n)), q + 1 < m && (n = Math.max((m - q) * C + a.Ab, n)), n += "px"); | |
a.mz && a.Te && (y = 1, x + 1 < A && (y = Math.max((A - x) * C + a.zb, y)), p > l + 1 && (y = Math.max((p - l) * C + a.zb, y)), r + 1 < c && (y = Math.max((c - r) * C + a.zb, y)), y += "px"); | |
var I = "1px" !== n, | |
H = "1px" !== y; | |
if ((!I || !H) && I || H) { | |
H && (k -= a.Bd), I && (l -= a.Bd), a.lz && a.Se && (n = 1, s + 1 < t && (n = Math.max((t - s) * C + a.Ab, n)), v > k + 1 && (n = Math.max((v - k) * C + a.Ab, n)), q + 1 < m && (n = Math.max((m - q) * C + a.Ab, n)), n += "px"), a.mz && a.Te && (y = 1, x + 1 < A && (y = Math.max((A - x) * C + a.zb, y)), p > l + 1 && (y = Math.max((p - l) * C + a.zb, y)), r + 1 < c && (y = Math.max((c - r) * C + a.zb, y)), y += "px"), I = "1px" !== n, H = "1px" !== y | |
} | |
if (a.av && I === a.qk && H === a.rk) { | |
return d === a.Ab && e === a.zb || a.df(), !1 | |
} | |
I !== a.qk && (a.zb = "1px" === n ? a.zb + a.Bd : Math.max(a.zb - a.Bd, 1), h = !0); | |
a.qk = I; | |
a.uy.style.width = n; | |
H !== a.rk && (a.Ab = "1px" === y ? a.Ab + a.Bd : Math.max(a.Ab - a.Bd, 1), h = !0, a.wB && (H ? (b.style.left = a.Bd + "px", a.position = new w(a.Na.x + a.Bd / a.scale, a.Na.y)) : (b.style.left = "0px", a.position = new w(a.Na.x - a.Bd / a.scale, a.Na.y)))); | |
a.rk = H; | |
a.vy.style.height = y; | |
a.lz && a.Se && (q + 1 < m ? a.uj.scrollLeft = (a.position.x - s) * C : s + 1 < t ? a.uj.scrollLeft = a.uj.scrollWidth - a.uj.clientWidth : v > k + 1 && (a.uj.scrollLeft = a.position.x * C)); | |
a.mz && a.Te && (r + 1 < c ? a.vj.scrollTop = (a.position.y - x) * C : x + 1 < A ? a.vj.scrollTop = a.vj.scrollHeight - a.vj.clientHeight : p > l + 1 && (a.vj.scrollTop = a.position.y * C)); | |
h && (a.hq = !0); | |
m = a.Ab; | |
c = a.zb; | |
a.vj.style.height = c + "px"; | |
a.vj.style.width = m + (a.rk ? a.Bd : 0) + "px"; | |
a.uj.style.width = m + "px"; | |
a.uj.style.height = c + (a.qk ? a.Bd : 0) + "px"; | |
a.ty = !1; | |
return d !== m || e !== c || a.Mb.cd ? (n = a.ob, a.et(f, n, h), !1) : !0 | |
} | |
D.prototype.add = D.prototype.add = function(a) { | |
u.C(a, G, D, "add:part"); | |
var b = a.g; | |
if (b !== this) { | |
null !== b && u.k("Cannot add part " + a.toString() + " to " + this.toString() + ". It is already a part of " + b.toString()); | |
this.Ym && (a.wk = "Tool"); | |
var c = a.xf, | |
b = this.xs(c); | |
null === b && (b = this.xs("")); | |
null === b && u.k('Cannot add a Part when unable find a Layer named "' + c + '" and there is no default Layer'); | |
a.layer !== b && (c = b.Ho(99999999, a, a.g === this), 0 <= c && this.Cc(be, "parts", b, null, a, null, c), b.zc || this.pc(), a.H(Jj), c = a.Ss, null !== c && c(a, null, b)) | |
} | |
}; | |
D.prototype.Ho = function(a) { | |
if (a instanceof U) { | |
if (this.Tn.add(a), a instanceof V) { | |
var b = a.Sa; | |
null === b ? this.Ik.add(a) : b.Rn.add(a); | |
b = a.Qb; | |
null !== b && (b.g = this) | |
} | |
} else { | |
a instanceof W ? this.Pn.add(a) : a instanceof lf || this.Db.add(a) | |
} | |
var c = this; | |
Kj(a, function(a) { | |
Lj(c, a) | |
}); | |
a.Ib && a.S(); | |
b = a.data; | |
null !== b && (a instanceof lf || (a instanceof W ? this.lk.add(b, a) : this.ai.add(b, a)), Kj(a, function(a) { | |
Mj(c, a) | |
})); | |
!0 !== Bj(a) && !0 !== Cj(a) || this.Zf.add(a); | |
Nj(a, !0, this); | |
Oj(a) ? (a.ca.I() && this.na(Ki(a, a.ca)), this.pc()) : a.Ia() && a.ca.I() && this.na(Ki(a, a.ca)); | |
this.ee() | |
}; | |
D.prototype.Ge = function(a) { | |
a.ns(); | |
if (a instanceof U) { | |
if (this.Tn.remove(a), a instanceof V) { | |
var b = a.Sa; | |
null === b ? this.Ik.remove(a) : b.Rn.remove(a); | |
b = a.Qb; | |
null !== b && (b.g = null) | |
} | |
} else { | |
a instanceof W ? this.Pn.remove(a) : a instanceof lf || this.Db.remove(a) | |
} | |
var c = this; | |
Kj(a, function(a) { | |
Pj(c, a) | |
}); | |
b = a.data; | |
null !== b && (a instanceof lf || (a instanceof W ? this.lk.remove(b) : this.ai.remove(b)), Kj(a, function(a) { | |
Qj(c, a) | |
})); | |
this.Zf.remove(a); | |
Oj(a) ? (a.ca.I() && this.na(Ki(a, a.ca)), this.pc()) : a.Ia() && a.ca.I() && this.na(Ki(a, a.ca)); | |
this.ee() | |
}; | |
D.prototype.remove = D.prototype.remove = function(a) { | |
u.C(a, G, D, "remove:part"); | |
a.$a = !1; | |
a.Yg = !1; | |
var b = a.layer; | |
if (null !== b && b.g === this) { | |
a.H(Rj); | |
a.Bm(); | |
var c = b.Ge(-1, a, !1); | |
0 <= c && this.Cc(ce, "parts", b, a, null, c, null); | |
c = a.Ss; | |
null !== c && c(a, b, null) | |
} | |
}; | |
D.prototype.removeParts = D.prototype.Xz = function(a, b) { | |
if (u.isArray(a)) { | |
for (var c = u.qb(a), d = 0; d < c; d++) { | |
var e = u.ib(a, d); | |
b && !e.canDelete() || this.remove(e) | |
} | |
} else { | |
for (e = new F(G), e.Ud(a), c = e.i; c.next();) { | |
e = c.value, b && !e.canDelete() || this.remove(e) | |
} | |
} | |
}; | |
D.prototype.copyParts = D.prototype.vo = function(a, b, c) { | |
return this.Eb.vo(a, b, c) | |
}; | |
D.prototype.moveParts = D.prototype.moveParts = function(a, b, c) { | |
u.C(b, w, D, "moveParts:offset"); | |
var d = this.tb; | |
if (null !== d) { | |
d = d.Gd; | |
null === d && (d = new uf, d.Dc(this)); | |
var e = new la(G, Object); | |
if (null !== a) { | |
a = a.i | |
} else { | |
for (a = this.Sj; a.next();) { | |
Hf(d, e, a.value, c) | |
} | |
for (a = this.Ag; a.next();) { | |
Hf(d, e, a.value, c) | |
} | |
a = this.links | |
} | |
for (; a.next();) { | |
Hf(d, e, a.value, c) | |
} | |
d.moveParts(e, b, c) | |
} | |
}; | |
function Sj(a, b, c) { | |
u.C(b, we, D, "addLayer:layer"); | |
null !== b.g && b.g !== a && u.k("Cannot share a Layer with another Diagram: " + b + " of " + b.g); | |
null === c ? null !== b.g && u.k("Cannot add an existing Layer to this Diagram again: " + b) : (u.C(c, we, D, "addLayer:existingLayer"), c.g !== a && u.k("Existing Layer must be in this Diagram: " + c + " not in " + c.g), b === c && u.k("Cannot move a Layer before or after itself: " + b)); | |
if (b.g !== a) { | |
b = b.name; | |
a = a.$b; | |
c = a.count; | |
for (var d = 0; d < c; d++) { | |
a.ja(d).name === b && u.k("Cannot add Layer with the name '" + b + "'; a Layer with the same name is already present in this Diagram.") | |
} | |
} | |
} | |
D.prototype.addLayer = D.prototype.es = function(a) { | |
Sj(this, a, null); | |
a.Dc(this); | |
var b = this.$b, | |
c = b.count - 1; | |
if (!a.zc) { | |
for (; 0 <= c && b.ja(c).zc;) { | |
c-- | |
} | |
} | |
b.Zd(c + 1, a); | |
null !== this.Pd && this.Cc(be, "layers", this, null, a, null, c + 1); | |
this.na(); | |
this.pc() | |
}; | |
D.prototype.addLayerBefore = D.prototype.MF = function(a, b) { | |
Sj(this, a, b); | |
a.Dc(this); | |
var c = this.$b, | |
d = c.indexOf(a); | |
0 <= d && (c.remove(a), null !== this.Pd && this.Cc(ce, "layers", this, a, null, d, null)); | |
for (var e = c.count, f = 0; f < e; f++) { | |
if (c.ja(f) === b) { | |
c.Zd(f, a); | |
break | |
} | |
} | |
null !== this.Pd && this.Cc(be, "layers", this, null, a, null, f); | |
this.na(); | |
0 > d && this.pc() | |
}; | |
D.prototype.addLayerAfter = function(a, b) { | |
Sj(this, a, b); | |
a.Dc(this); | |
var c = this.$b, | |
d = c.indexOf(a); | |
0 <= d && (c.remove(a), null !== this.Pd && this.Cc(ce, "layers", this, a, null, d, null)); | |
for (var e = c.count, f = 0; f < e; f++) { | |
if (c.ja(f) === b) { | |
c.Zd(f + 1, a); | |
break | |
} | |
} | |
null !== this.Pd && this.Cc(be, "layers", this, null, a, null, f + 1); | |
this.na(); | |
0 > d && this.pc() | |
}; | |
D.prototype.removeLayer = function(a) { | |
u.C(a, we, D, "removeLayer:layer"); | |
a.g !== this && u.k("Cannot remove a Layer from another Diagram: " + a + " of " + a.g); | |
if ("" !== a.name) { | |
var b = this.$b, | |
c = b.indexOf(a); | |
if (b.remove(a)) { | |
for (b = a.Db.copy().i; b.next();) { | |
var d = b.value, | |
e = d.xf; | |
d.xf = e !== a.name ? e : "" | |
} | |
null !== this.Pd && this.Cc(ce, "layers", this, a, null, c, null); | |
this.na(); | |
this.pc() | |
} | |
} | |
}; | |
D.prototype.findLayer = D.prototype.xs = function(a) { | |
for (var b = this.nw; b.next();) { | |
var c = b.value; | |
if (c.name === a) { | |
return c | |
} | |
} | |
return null | |
}; | |
D.prototype.addChangedListener = D.prototype.Ly = function(a) { | |
u.j(a, "function", D, "addChangedListener:listener"); | |
null === this.Ui && (this.Ui = new E("function")); | |
this.Ui.add(a) | |
}; | |
D.prototype.removeChangedListener = D.prototype.Uz = function(a) { | |
u.j(a, "function", D, "removeChangedListener:listener"); | |
null !== this.Ui && (this.Ui.remove(a), 0 === this.Ui.count && (this.Ui = null)) | |
}; | |
D.prototype.Kv = function(a) { | |
this.gb || this.ga.ED(a); | |
a.Cd !== ae && (this.Sh = !0); | |
if (null !== this.Ui) { | |
var b = this.Ui, | |
c = b.length; | |
if (1 === c) { | |
b = b.ja(0), b(a) | |
} else { | |
if (0 !== c) { | |
for (var d = b.Le(), e = 0; e < c; e++) { | |
b = d[e], b(a) | |
} | |
} | |
} | |
} | |
}; | |
D.prototype.raiseChangedEvent = D.prototype.Cc = function(a, b, c, d, e, f, h) { | |
void 0 === f && (f = null); | |
void 0 === h && (h = null); | |
var k = new Od; | |
k.g = this; | |
k.Cd = a; | |
k.propertyName = b; | |
k.object = c; | |
k.oldValue = d; | |
k.Bg = f; | |
k.newValue = e; | |
k.zg = h; | |
this.Kv(k) | |
}; | |
D.prototype.raiseChanged = D.prototype.h = function(a, b, c, d, e) { | |
this.Cc($d, a, this, b, c, d, e) | |
}; | |
u.u(D, { | |
Mb: "animationManager" | |
}, function() { | |
return this.oh | |
}); | |
u.u(D, { | |
ga: "undoManager" | |
}, function() { | |
return this.Pd.ga | |
}); | |
u.defineProperty(D, { | |
gb: "skipsUndoManager" | |
}, function() { | |
return this.ri | |
}, function(a) { | |
u.j(a, "boolean", D, "skipsUndoManager"); | |
this.ri = a; | |
this.Pd.ri = a | |
}); | |
u.defineProperty(D, { | |
bz: "delaysLayout" | |
}, function() { | |
return this.Bx | |
}, function(a) { | |
this.Bx = a | |
}); | |
D.prototype.tm = function(a, b) { | |
if (null !== a && a.g === this) { | |
var c = a.Cd; | |
if (c === $d) { | |
var d = a.object, | |
c = a.propertyName, | |
e = a.ua(b); | |
u.Pa(d, c, e); | |
d instanceof T && (d = d.W, null !== d && d.$d()); | |
this.Sh = !0 | |
} else { | |
if (c === be) { | |
e = a.object; | |
c = a.zg; | |
d = a.newValue; | |
if (e instanceof B) { | |
if ("number" === typeof c && d instanceof T) { | |
var f = e; | |
b ? f.Ge(c) : f.Zd(c, d); | |
d = e.W; | |
null !== d && d.$d() | |
} else { | |
"number" === typeof c && d instanceof Se && (f = e, b ? d.be ? f.pE(c) : f.lE(c) : (c = d.be ? f.hd(d.index) : f.gd(d.index), c.ss(d))) | |
} | |
} else { | |
e instanceof we ? (f = !0 === a.Bg, "number" === typeof c && d instanceof G && (b ? (d.$d(), e.Ge(f ? c : -1, d, f)) : e.Ho(c, d, f))) : e instanceof D ? "number" === typeof c && d instanceof we && (e = d, b ? this.$b.kd(c) : (e.Dc(this), this.$b.Zd(c, e))) : u.k("unknown ChangedEvent.Insert object: " + a.toString()) | |
} | |
this.Sh = !0 | |
} else { | |
c === ce ? (e = a.object, c = a.Bg, d = a.oldValue, e instanceof B ? "number" === typeof c && d instanceof T ? (f = e, b ? f.Zd(c, d) : f.Ge(c)) : "number" === typeof c && d instanceof Se && (f = e, b ? (c = d.be ? f.hd(d.index) : f.gd(d.index), c.ss(d)) : d.be ? f.pE(c) : f.lE(c)) : e instanceof we ? (f = !0 === a.zg, "number" === typeof c && d instanceof G && (b ? e.Ho(c, d, f) : (d.$d(), e.Ge(f ? c : -1, d, f)))) : e instanceof D ? "number" === typeof c && d instanceof we && (e = d, b ? (e.Dc(this), this.$b.Zd(c, e)) : this.$b.kd(c)) : u.k("unknown ChangedEvent.Remove object: " + a.toString()), this.Sh = !0) : c !== ae && u.k("unknown ChangedEvent: " + a.toString()) | |
} | |
} | |
} | |
}; | |
D.prototype.startTransaction = D.prototype.Xb = function(a) { | |
return this.ga.Xb(a) | |
}; | |
D.prototype.commitTransaction = D.prototype.Xd = function(a) { | |
return this.ga.Xd(a) | |
}; | |
D.prototype.rollbackTransaction = D.prototype.cp = function() { | |
return this.ga.cp() | |
}; | |
D.prototype.updateAllTargetBindings = D.prototype.FI = function(a) { | |
void 0 === a && (a = ""); | |
for (var b = this.Sj; b.next();) { | |
b.value.Ob(a) | |
} | |
for (b = this.Ag; b.next();) { | |
b.value.Ob(a) | |
} | |
for (b = this.links; b.next();) { | |
b.value.Ob(a) | |
} | |
}; | |
D.prototype.updateAllRelationshipsFromData = function() { | |
for (var a = this.Sj; a.next();) { | |
a.value.updateRelationshipsFromData() | |
} | |
for (a = this.Ag; a.next();) { | |
a.value.updateRelationshipsFromData() | |
} | |
for (a = this.links; a.next();) { | |
a.value.updateRelationshipsFromData() | |
} | |
}; | |
function Yj(a, b, c) { | |
if (a.Oc || a.xd) { | |
a.ac = c | |
} else { | |
if (a.Oc = !0, null === a.kb) { | |
a.ac = c | |
} else { | |
var d = a.ob.copy(), | |
e = a.Ab, | |
f = a.zb; | |
d.width = a.Ab / b; | |
d.height = a.zb / b; | |
var h = a.yl.x, | |
k = a.yl.y, | |
l = a.cD; | |
isNaN(h) && (l.jl() ? l.cw(Xb) ? h = 0 : l.cw(Yb) && (h = e - 1) : h = l.Vc() ? l.x * (e - 1) : e / 2); | |
isNaN(k) && (l.jl() ? l.cw(Wb) ? k = 0 : l.cw(Zb) && (k = f - 1) : k = l.Vc() ? l.y * (f - 1) : f / 2); | |
null !== a.xE && (c = a.xE(a, c)); | |
c < a.$g && (c = a.$g); | |
c > a.Zg && (c = a.Zg); | |
b = u.Yb(a.Na.x + h / b - h / c, a.Na.y + k / b - k / c); | |
a.position = b; | |
u.v(b); | |
a.ac = c; | |
a.et(d, a.ob); | |
a.Oc = !1; | |
gj(a, !1); | |
a.na(); | |
sj(a) | |
} | |
} | |
} | |
D.prototype.et = function(a, b, c) { | |
void 0 === c && (c = !1); | |
c || sj(this); | |
cj(this); | |
var d = this.Qb; | |
null === d || !d.kw || c || a.width === b.width && a.height === b.height || d.H(); | |
d = this.Va; | |
!0 === this.Nl && d instanceof jf && (this.N.da = this.XE(this.N.hf), d.doMouseMove()); | |
this.oz(a, b); | |
vj(this); | |
this.Ba("ViewportBoundsChanged", c ? u.nh : null, a) | |
}; | |
function vj(a, b) { | |
void 0 === b && (b = null); | |
var c = a.bd; | |
if (null !== c && c.visible) { | |
for (var d = u.vl(), e = 1, f = 1, h = c.Aa.n, k = h.length, l = 0; l < k; l++) { | |
var m = h[l], | |
n = m.interval; | |
2 > n || (hk(m.Fb) ? f = f * n / K.yD(f, n) : e = e * n / K.yD(e, n)) | |
} | |
h = c.aw; | |
d.m(f * h.width, e * h.height); | |
h = f = l = k = 0; | |
if (null !== b) { | |
k = b.width, l = b.height, f = b.x, h = b.y | |
} else { | |
e = u.Tf(); | |
f = a.ob; | |
e.m(f.x, f.y, f.width, f.height); | |
for (h = a.Yl.i; h.next();) { | |
f = h.value.ob, f.I() && kb(e, f.x, f.y, f.width, f.height) | |
} | |
k = e.width; | |
l = e.height; | |
f = e.x; | |
h = e.y; | |
if (!e.I()) { | |
return | |
} | |
} | |
c.width = k + 2 * d.width; | |
c.height = l + 2 * d.height; | |
e = u.K(); | |
K.ys(f, h, 0, 0, d.width, d.height, e); | |
e.offset(-d.width, -d.height); | |
u.Oj(d); | |
c.W.location = e; | |
u.v(e) | |
} | |
} | |
D.prototype.clearSelection = D.prototype.Mv = function() { | |
var a = 0 < this.selection.count; | |
a && this.Ba("ChangingSelection"); of (this); | |
a && this.Ba("ChangedSelection") | |
}; | |
function of (a) { | |
a = a.selection; | |
if (0 < a.count) { | |
for (var b = a.Le(), c = b.length, d = 0; d < c; d++) { | |
b[d].$a = !1 | |
} | |
a.Ma(); | |
a.clear(); | |
a.freeze() | |
} | |
} | |
D.prototype.select = D.prototype.select = function(a) { | |
null !== a && (u.C(a, G, D, "select:part"), a.layer.g === this && (!a.$a || 1 < this.selection.count) && (this.Ba("ChangingSelection"), of (this), a.$a = !0, this.Ba("ChangedSelection"))) | |
}; | |
D.prototype.selectCollection = D.prototype.DE = function(a) { | |
this.Ba("ChangingSelection"); of (this); | |
if (u.isArray(a)) { | |
for (var b = u.qb(a), c = 0; c < b; c++) { | |
var d = u.ib(a, c); | |
d instanceof G || u.k("Diagram.selectCollection given something that is not a Part: " + d); | |
d.$a = !0 | |
} | |
} else { | |
for (a = a.i; a.next();) { | |
d = a.value, d instanceof G || u.k("Diagram.selectCollection given something that is not a Part: " + d), d.$a = !0 | |
} | |
} | |
this.Ba("ChangedSelection") | |
}; | |
D.prototype.clearHighlighteds = D.prototype.WC = function() { | |
var a = this.bw; | |
if (0 < a.count) { | |
for (var b = a.Le(), c = b.length, d = 0; d < c; d++) { | |
b[d].Yg = !1 | |
} | |
a.Ma(); | |
a.clear(); | |
a.freeze() | |
} | |
}; | |
D.prototype.highlight = function(a) { | |
null !== a && a.layer.g === this && (u.C(a, G, D, "highlight:part"), !a.Yg || 1 < this.bw.count) && (this.WC(), a.Yg = !0) | |
}; | |
D.prototype.highlightCollection = function(a) { | |
this.WC(); | |
if (u.isArray(a)) { | |
for (var b = u.qb(a), c = 0; c < b; c++) { | |
var d = u.ib(a, c); | |
d instanceof G || u.k("Diagram.highlightCollection given something that is not a Part: " + d); | |
d.Yg = !0 | |
} | |
} else { | |
for (a = a.i; a.next();) { | |
d = a.value, d instanceof G || u.k("Diagram.highlightCollection given something that is not a Part: " + d), d.Yg = !0 | |
} | |
} | |
}; | |
D.prototype.scroll = D.prototype.scroll = function(a, b, c) { | |
void 0 === c && (c = 1); | |
var d = "up" === b || "down" === b, | |
e = 0; | |
"pixel" === a ? e = c : "line" === a ? e = c * (d ? this.nt : this.mt) : "page" === a ? (a = d ? this.ob.height : this.ob.width, a *= this.scale, 0 !== a && (e = Math.max(a - (d ? this.nt : this.mt), 0), e *= c)) : u.k("scrolling unit must be 'pixel', 'line', or 'page', not: " + a); | |
e /= this.scale; | |
c = this.position.copy(); | |
"up" === b ? c.y = this.position.y - e : "down" === b ? c.y = this.position.y + e : "left" === b ? c.x = this.position.x - e : "right" === b ? c.x = this.position.x + e : u.k("scrolling direction must be 'up', 'down', 'left', or 'right', not: " + b); | |
this.position = c | |
}; | |
D.prototype.scrollToRect = D.prototype.eI = function(a) { | |
var b = this.ob; | |
b.Kj(a) || (a = a.Ok, a.x -= b.width / 2, a.y -= b.height / 2, this.position = a) | |
}; | |
D.prototype.centerRect = function(a) { | |
var b = this.ob; | |
a = a.Ok; | |
a.x -= b.width / 2; | |
a.y -= b.height / 2; | |
this.position = a | |
}; | |
D.prototype.transformDocToView = D.prototype.VE = function(a) { | |
var b = this.Td; | |
b.reset(); | |
1 !== this.ac && b.scale(this.ac); | |
var c = this.Na; | |
(0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y); | |
return a.copy().transform(this.Td) | |
}; | |
D.prototype.transformViewToDoc = D.prototype.XE = function(a) { | |
var b = this.Td; | |
b.reset(); | |
1 !== this.ac && b.scale(this.ac); | |
var c = this.Na; | |
(0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y); | |
return Wa(a.copy(), this.Td) | |
}; | |
var vf; | |
D.None = vf = u.s(D, "None", 0); | |
var kj; | |
D.Uniform = kj = u.s(D, "Uniform", 1); | |
var lj; | |
D.UniformToFill = lj = u.s(D, "UniformToFill", 2); | |
var Hg; | |
D.CycleAll = Hg = u.s(D, "CycleAll", 10); | |
var Lg; | |
D.CycleNotDirected = Lg = u.s(D, "CycleNotDirected", 11); | |
var Vg; | |
D.CycleNotDirectedFast = Vg = u.s(D, "CycleNotDirectedFast", 12); | |
var Wg; | |
D.CycleNotUndirected = Wg = u.s(D, "CycleNotUndirected", 13); | |
var Ig; | |
D.CycleDestinationTree = Ig = u.s(D, "CycleDestinationTree", 14); | |
var Kg; | |
D.CycleSourceTree = Kg = u.s(D, "CycleSourceTree", 15); | |
var Ni; | |
D.DocumentScroll = Ni = u.s(D, "DocumentScroll", 1); | |
var Hj; | |
D.InfiniteScroll = Hj = u.s(D, "InfiniteScroll", 2); | |
u.defineProperty(D, { | |
GI: "validCycle" | |
}, function() { | |
return this.tv | |
}, function(a) { | |
var b = this.tv; | |
b !== a && (u.rb(a, D, D, "validCycle"), this.tv = a, this.h("validCycle", b, a)) | |
}); | |
u.defineProperty(D, { | |
pw: "linkSpacing" | |
}, function() { | |
return this.gj | |
}, function(a) { | |
var b = this.gj; | |
b !== a && (u.Be(a, D, "linkSpacing"), 0 > a && u.xa(a, ">= zero", D, "linkSpacing"), this.gj = a, this.h("linkSpacing", b, a)) | |
}); | |
u.u(D, { | |
nw: "layers" | |
}, function() { | |
return this.$b.i | |
}); | |
u.defineProperty(D, { | |
vf: "isModelReadOnly" | |
}, function() { | |
var a = this.Pd; | |
return null === a ? !1 : a.nb | |
}, function(a) { | |
var b = this.Pd; | |
null !== b && (b.nb = a) | |
}); | |
u.defineProperty(D, { | |
nb: "isReadOnly" | |
}, function() { | |
return this.vk | |
}, function(a) { | |
var b = this.vk; | |
b !== a && (u.j(a, "boolean", D, "isReadOnly"), this.vk = a, this.h("isReadOnly", b, a)) | |
}); | |
u.defineProperty(D, { | |
isEnabled: "isEnabled" | |
}, function() { | |
return this.Oe | |
}, function(a) { | |
var b = this.Oe; | |
b !== a && (u.j(a, "boolean", D, "isEnabled"), this.Oe = a, this.h("isEnabled", b, a)) | |
}); | |
u.defineProperty(D, { | |
Oy: "allowClipboard" | |
}, function() { | |
return this.Ht | |
}, function(a) { | |
var b = this.Ht; | |
b !== a && (u.j(a, "boolean", D, "allowClipboard"), this.Ht = a, this.h("allowClipboard", b, a)) | |
}); | |
u.defineProperty(D, { | |
Ij: "allowCopy" | |
}, function() { | |
return this.Xj | |
}, function(a) { | |
var b = this.Xj; | |
b !== a && (u.j(a, "boolean", D, "allowCopy"), this.Xj = a, this.h("allowCopy", b, a)) | |
}); | |
u.defineProperty(D, { | |
pm: "allowDelete" | |
}, function() { | |
return this.Yj | |
}, function(a) { | |
var b = this.Yj; | |
b !== a && (u.j(a, "boolean", D, "allowDelete"), this.Yj = a, this.h("allowDelete", b, a)) | |
}); | |
u.defineProperty(D, { | |
Bv: "allowDragOut" | |
}, function() { | |
return this.It | |
}, function(a) { | |
var b = this.It; | |
b !== a && (u.j(a, "boolean", D, "allowDragOut"), this.It = a, this.h("allowDragOut", b, a)) | |
}); | |
u.defineProperty(D, { | |
MC: "allowDrop" | |
}, function() { | |
return this.Jt | |
}, function(a) { | |
var b = this.Jt; | |
b !== a && (u.j(a, "boolean", D, "allowDrop"), this.Jt = a, this.h("allowDrop", b, a)) | |
}); | |
u.defineProperty(D, { | |
Fv: "allowTextEdit" | |
}, function() { | |
return this.gk | |
}, function(a) { | |
var b = this.gk; | |
b !== a && (u.j(a, "boolean", D, "allowTextEdit"), this.gk = a, this.h("allowTextEdit", b, a)) | |
}); | |
u.defineProperty(D, { | |
Cv: "allowGroup" | |
}, function() { | |
return this.Zj | |
}, function(a) { | |
var b = this.Zj; | |
b !== a && (u.j(a, "boolean", D, "allowGroup"), this.Zj = a, this.h("allowGroup", b, a)) | |
}); | |
u.defineProperty(D, { | |
Gv: "allowUngroup" | |
}, function() { | |
return this.hk | |
}, function(a) { | |
var b = this.hk; | |
b !== a && (u.j(a, "boolean", D, "allowUngroup"), this.hk = a, this.h("allowUngroup", b, a)) | |
}); | |
u.defineProperty(D, { | |
no: "allowInsert" | |
}, function() { | |
return this.Lt | |
}, function(a) { | |
var b = this.Lt; | |
b !== a && (u.j(a, "boolean", D, "allowInsert"), this.Lt = a, this.h("allowInsert", b, a)) | |
}); | |
u.defineProperty(D, { | |
js: "allowLink" | |
}, function() { | |
return this.$j | |
}, function(a) { | |
var b = this.$j; | |
b !== a && (u.j(a, "boolean", D, "allowLink"), this.$j = a, this.h("allowLink", b, a)) | |
}); | |
u.defineProperty(D, { | |
qm: "allowRelink" | |
}, function() { | |
return this.bk | |
}, function(a) { | |
var b = this.bk; | |
b !== a && (u.j(a, "boolean", D, "allowRelink"), this.bk = a, this.h("allowRelink", b, a)) | |
}); | |
u.defineProperty(D, { | |
Nk: "allowMove" | |
}, function() { | |
return this.ak | |
}, function(a) { | |
var b = this.ak; | |
b !== a && (u.j(a, "boolean", D, "allowMove"), this.ak = a, this.h("allowMove", b, a)) | |
}); | |
u.defineProperty(D, { | |
Dv: "allowReshape" | |
}, function() { | |
return this.ck | |
}, function(a) { | |
var b = this.ck; | |
b !== a && (u.j(a, "boolean", D, "allowReshape"), this.ck = a, this.h("allowReshape", b, a)) | |
}); | |
u.defineProperty(D, { | |
ks: "allowResize" | |
}, function() { | |
return this.dk | |
}, function(a) { | |
var b = this.dk; | |
b !== a && (u.j(a, "boolean", D, "allowResize"), this.dk = a, this.h("allowResize", b, a)) | |
}); | |
u.defineProperty(D, { | |
Ev: "allowRotate" | |
}, function() { | |
return this.ek | |
}, function(a) { | |
var b = this.ek; | |
b !== a && (u.j(a, "boolean", D, "allowRotate"), this.ek = a, this.h("allowRotate", b, a)) | |
}); | |
u.defineProperty(D, { | |
qf: "allowSelect" | |
}, function() { | |
return this.fk | |
}, function(a) { | |
var b = this.fk; | |
b !== a && (u.j(a, "boolean", D, "allowSelect"), this.fk = a, this.h("allowSelect", b, a)) | |
}); | |
u.defineProperty(D, { | |
NC: "allowUndo" | |
}, function() { | |
return this.Mt | |
}, function(a) { | |
var b = this.Mt; | |
b !== a && (u.j(a, "boolean", D, "allowUndo"), this.Mt = a, this.h("allowUndo", b, a)) | |
}); | |
u.defineProperty(D, { | |
Hv: "allowZoom" | |
}, function() { | |
return this.Ot | |
}, function(a) { | |
var b = this.Ot; | |
b !== a && (u.j(a, "boolean", D, "allowZoom"), this.Ot = a, this.h("allowZoom", b, a)) | |
}); | |
u.defineProperty(D, { | |
mz: "hasVerticalScrollbar" | |
}, function() { | |
return this.ru | |
}, function(a) { | |
var b = this.ru; | |
b !== a && (u.j(a, "boolean", D, "hasVerticalScrollbar"), this.ru = a, sj(this), this.na(), this.h("hasVerticalScrollbar", b, a), gj(this, !1)) | |
}); | |
u.defineProperty(D, { | |
lz: "hasHorizontalScrollbar" | |
}, function() { | |
return this.qu | |
}, function(a) { | |
var b = this.qu; | |
b !== a && (u.j(a, "boolean", D, "hasHorizontalScrollbar"), this.qu = a, sj(this), this.na(), this.h("hasHorizontalScrollbar", b, a), gj(this, !1)) | |
}); | |
u.defineProperty(D, { | |
Se: "allowHorizontalScroll" | |
}, function() { | |
return this.Kt | |
}, function(a) { | |
var b = this.Kt; | |
b !== a && (u.j(a, "boolean", D, "allowHorizontalScroll"), this.Kt = a, this.h("allowHorizontalScroll", b, a), gj(this, !1)) | |
}); | |
u.defineProperty(D, { | |
Te: "allowVerticalScroll" | |
}, function() { | |
return this.Nt | |
}, function(a) { | |
var b = this.Nt; | |
b !== a && (u.j(a, "boolean", D, "allowVerticalScroll"), this.Nt = a, this.h("allowVerticalScroll", b, a), gj(this, !1)) | |
}); | |
u.defineProperty(D, { | |
mt: "scrollHorizontalLineChange" | |
}, function() { | |
return this.bv | |
}, function(a) { | |
var b = this.bv; | |
b !== a && (u.j(a, "number", D, "scrollHorizontalLineChange"), 0 > a && u.xa(a, ">= 0", D, "scrollHorizontalLineChange"), this.bv = a, this.h("scrollHorizontalLineChange", b, a)) | |
}); | |
u.defineProperty(D, { | |
nt: "scrollVerticalLineChange" | |
}, function() { | |
return this.cv | |
}, function(a) { | |
var b = this.cv; | |
b !== a && (u.j(a, "number", D, "scrollVerticalLineChange"), 0 > a && u.xa(a, ">= 0", D, "scrollVerticalLineChange"), this.cv = a, this.h("scrollVerticalLineChange", b, a)) | |
}); | |
u.defineProperty(D, { | |
N: "lastInput" | |
}, function() { | |
return this.Pb | |
}, function(a) { | |
this.Pb = a | |
}); | |
u.defineProperty(D, { | |
uc: "firstInput" | |
}, function() { | |
return this.nk | |
}, function(a) { | |
this.nk = a | |
}); | |
u.defineProperty(D, { | |
bc: "currentCursor" | |
}, function() { | |
return this.ux | |
}, function(a) { | |
"" === a && (a = this.Rp); | |
this.ux !== a && (u.j(a, "string", D, "currentCursor"), null !== this.kb && (this.ux = a, this.kb.style.cursor = a, this.Kb.style.cursor = a)) | |
}); | |
u.defineProperty(D, { | |
pJ: "defaultCursor" | |
}, function() { | |
return this.Rp | |
}, function(a) { | |
"" === a && (a = "auto"); | |
var b = this.Rp; | |
b !== a && (u.j(a, "string", D, "defaultCursor"), this.Rp = a, this.h("defaultCursor", b, a)) | |
}); | |
u.defineProperty(D, { | |
DJ: "hasGestureZoom" | |
}, function() { | |
return this.An | |
}, function(a) { | |
var b = this.An; | |
b !== a && (u.j(a, "boolean", D, "hasGestureZoom"), this.An = a, this.h("hasGestureZoom", b, a)) | |
}); | |
u.defineProperty(D, { | |
click: "click" | |
}, function() { | |
return this.Xh | |
}, function(a) { | |
var b = this.Xh; | |
b !== a && (null !== a && u.j(a, "function", D, "click"), this.Xh = a, this.h("click", b, a)) | |
}); | |
u.defineProperty(D, { | |
us: "doubleClick" | |
}, function() { | |
return this.di | |
}, function(a) { | |
var b = this.di; | |
b !== a && (null !== a && u.j(a, "function", D, "doubleClick"), this.di = a, this.h("doubleClick", b, a)) | |
}); | |
u.defineProperty(D, { | |
Vy: "contextClick" | |
}, function() { | |
return this.Zh | |
}, function(a) { | |
var b = this.Zh; | |
b !== a && (null !== a && u.j(a, "function", D, "contextClick"), this.Zh = a, this.h("contextClick", b, a)) | |
}); | |
u.defineProperty(D, { | |
Gz: "mouseOver" | |
}, function() { | |
return this.ni | |
}, function(a) { | |
var b = this.ni; | |
b !== a && (null !== a && u.j(a, "function", D, "mouseOver"), this.ni = a, this.h("mouseOver", b, a)) | |
}); | |
u.defineProperty(D, { | |
Fz: "mouseHover" | |
}, function() { | |
return this.mi | |
}, function(a) { | |
var b = this.mi; | |
b !== a && (null !== a && u.j(a, "function", D, "mouseHover"), this.mi = a, this.h("mouseHover", b, a)) | |
}); | |
u.defineProperty(D, { | |
Ez: "mouseHold" | |
}, function() { | |
return this.li | |
}, function(a) { | |
var b = this.li; | |
b !== a && (null !== a && u.j(a, "function", D, "mouseHold"), this.li = a, this.h("mouseHold", b, a)) | |
}); | |
u.defineProperty(D, { | |
GH: "mouseDragOver" | |
}, function() { | |
return this.Pu | |
}, function(a) { | |
var b = this.Pu; | |
b !== a && (null !== a && u.j(a, "function", D, "mouseDragOver"), this.Pu = a, this.h("mouseDragOver", b, a)) | |
}); | |
u.defineProperty(D, { | |
Dz: "mouseDrop" | |
}, function() { | |
return this.ki | |
}, function(a) { | |
var b = this.ki; | |
b !== a && (null !== a && u.j(a, "function", D, "mouseDrop"), this.ki = a, this.h("mouseDrop", b, a)) | |
}); | |
u.defineProperty(D, { | |
mA: "toolTip" | |
}, function() { | |
return this.ui | |
}, function(a) { | |
var b = this.ui; | |
b !== a && (null !== a && u.C(a, lf, D, "toolTip"), this.ui = a, this.h("toolTip", b, a)) | |
}); | |
u.defineProperty(D, { | |
contextMenu: "contextMenu" | |
}, function() { | |
return this.$h | |
}, function(a) { | |
var b = this.$h; | |
b !== a && (null !== a && u.C(a, lf, D, "contextMenu"), this.$h = a, this.h("contextMenu", b, a)) | |
}); | |
u.defineProperty(D, { | |
Eb: "commandHandler" | |
}, function() { | |
return this.kx | |
}, function(a) { | |
var b = this.kx; | |
b !== a && (u.C(a, sa, D, "commandHandler"), null !== a.g && u.k("Cannot share CommandHandlers between Diagrams: " + a.toString()), null !== b && b.Dc(null), this.kx = a, a.Dc(this)) | |
}); | |
u.defineProperty(D, { | |
tb: "toolManager" | |
}, function() { | |
return this.Hy | |
}, function(a) { | |
var b = this.Hy; | |
b !== a && (u.C(a, jf, D, "toolManager"), null !== a.g && u.k("Cannot share ToolManagers between Diagrams: " + a.toString()), null !== b && b.Dc(null), this.Hy = a, a.Dc(this)) | |
}); | |
u.defineProperty(D, { | |
az: "defaultTool" | |
}, function() { | |
return this.Ax | |
}, function(a) { | |
var b = this.Ax; | |
b !== a && (u.C(a, xe, D, "defaultTool"), this.Ax = a, this.Va === b && (this.Va = a)) | |
}); | |
u.defineProperty(D, { | |
Va: "currentTool" | |
}, function() { | |
return this.wx | |
}, function(a) { | |
var b = this.wx; | |
if (null !== b) { | |
for (b.oa && b.doDeactivate(), b.cancelWaitAfter(), b.doStop(), b = this.Yl.i; b.next();) { | |
b.value.na() | |
} | |
} | |
null === a && (a = this.az); | |
null !== a && (u.C(a, xe, D, "currentTool"), this.wx = a, a.Dc(this), a.doStart()) | |
}); | |
u.u(D, { | |
selection: "selection" | |
}, function() { | |
return this.fv | |
}); | |
u.defineProperty(D, { | |
yH: "maxSelectionCount" | |
}, function() { | |
return this.Ku | |
}, function(a) { | |
var b = this.Ku; | |
if (b !== a) { | |
if (u.j(a, "number", D, "maxSelectionCount"), 0 <= a && !isNaN(a)) { | |
if (this.Ku = a, this.h("maxSelectionCount", b, a), !this.ga.fb && (a = this.selection.count - a, 0 < a)) { | |
this.Ba("ChangingSelection"); | |
for (var b = this.selection.Le(), c = 0; c < a; c++) { | |
b[c].$a = !1 | |
} | |
this.Ba("ChangedSelection") | |
} | |
} else { | |
u.xa(a, ">= 0", D, "maxSelectionCount") | |
} | |
} | |
}); | |
u.defineProperty(D, { | |
JH: "nodeSelectionAdornmentTemplate" | |
}, function() { | |
return this.Ru | |
}, function(a) { | |
var b = this.Ru; | |
b !== a && (u.C(a, lf, D, "nodeSelectionAdornmentTemplate"), this.Ru = a, this.h("nodeSelectionAdornmentTemplate", b, a)) | |
}); | |
u.defineProperty(D, { | |
NG: "groupSelectionAdornmentTemplate" | |
}, function() { | |
return this.nu | |
}, function(a) { | |
var b = this.nu; | |
b !== a && (u.C(a, lf, D, "groupSelectionAdornmentTemplate"), this.nu = a, this.h("groupSelectionAdornmentTemplate", b, a)) | |
}); | |
u.defineProperty(D, { | |
tH: "linkSelectionAdornmentTemplate" | |
}, function() { | |
return this.Fu | |
}, function(a) { | |
var b = this.Fu; | |
b !== a && (u.C(a, lf, D, "linkSelectionAdornmentTemplate"), this.Fu = a, this.h("linkSelectionAdornmentTemplate", b, a)) | |
}); | |
u.u(D, { | |
bw: "highlighteds" | |
}, function() { | |
return this.su | |
}); | |
u.defineProperty(D, { | |
Sh: "isModified" | |
}, function() { | |
var a = this.ga; | |
return a.isEnabled ? null !== a.Ei ? !0 : this.Wx && this.Kg !== a.Ji : this.Wx | |
}, function(a) { | |
if (this.Wx !== a) { | |
u.j(a, "boolean", D, "isModified"); | |
this.Wx = a; | |
var b = this.ga; | |
!a && b.isEnabled && (this.Kg = b.Ji); | |
a || ik(this) | |
} | |
}); | |
function ik(a) { | |
var b = a.Sh; | |
a.DC !== b && (a.DC = b, a.Ba("Modified")) | |
} | |
u.defineProperty(D, { | |
ha: "model" | |
}, function() { | |
return this.Pd | |
}, function(a) { | |
var b = this.Pd; | |
if (b !== a) { | |
u.C(a, J, D, "model"); | |
this.Va.doCancel(); | |
null !== b && b.ga !== a.ga && b.ga.OD && u.k("Do not replace a Diagram.model while a transaction is in progress."); | |
this.Mb.Ni(); | |
this.Mv(); | |
this.nf = !1; | |
this.wn = !0; | |
this.Kg = -2; | |
this.Ff = !1; | |
var c = this.xd; | |
this.xd = !0; | |
this.Mb.nl(); | |
null !== b && (b.Uz(this.GB), b instanceof Q && jk(this, b.Qj), jk(this, b.dh)); | |
this.Pd = a; | |
a.Ly(this.FB); | |
kk(this, a.dh); | |
a instanceof Q && lk(this, a.Qj); | |
a.Uz(this.FB); | |
a.Ly(this.GB); | |
this.xd = c; | |
this.Oc || this.na(); | |
null !== b && (a.ga.isEnabled = b.ga.isEnabled) | |
} | |
}); | |
u.defineProperty(D, { | |
Oa: null | |
}, function() { | |
return this.yB | |
}, function(a) { | |
this.yB = a | |
}); | |
u.u(D, { | |
rw: null | |
}, function() { | |
return this.uF | |
}); | |
function Qi(a, b) { | |
if (b.ha === a.ha) { | |
var c = b.Cd, | |
d = b.propertyName; | |
if (c === ae && "S" === d[0]) { | |
if ("StartingFirstTransaction" === d) { | |
c = a.tb, c.ef.each(function(b) { | |
b.Dc(a) | |
}), c.Nf.each(function(b) { | |
b.Dc(a) | |
}), c.Of.each(function(b) { | |
b.Dc(a) | |
}), a.xd || a.nf || (a.eu = !0, a.wn && (a.Ff = !0), a.oh.nl()) | |
} else { | |
if ("StartingUndo" === d || "StartingRedo" === d) { | |
var e = a.Mb; | |
e.Xg && !a.gb && e.Ni(); | |
a.Ba("ChangingSelection") | |
} else { | |
"StartedTransaction" === d && (e = a.Mb, e.Xg && !a.gb && e.Ni(), a.Au && e.nl()) | |
} | |
} | |
} else { | |
if (a.Oa) { | |
a.Oa = !1; | |
try { | |
var f = b.Mf; | |
if ("" !== f) { | |
if (c === $d) { | |
if ("linkFromKey" === f) { | |
var h = b.object, | |
k = a.pg(h); | |
if (null !== k) { | |
var l = b.newValue, | |
m = a.Ye(l); | |
k.V = m | |
} | |
} else { | |
if ("linkToKey" === f) { | |
h = b.object, k = a.pg(h), null !== k && (l = b.newValue, m = a.Ye(l), k.ba = m) | |
} else { | |
if ("linkFromPortId" === f) { | |
if (h = b.object, k = a.pg(h), null !== k) { | |
var n = b.newValue; | |
"string" === typeof n && (k.rg = n) | |
} | |
} else { | |
if ("linkToPortId" === f) { | |
h = b.object, k = a.pg(h), null !== k && (n = b.newValue, "string" === typeof n && (k.mh = n)) | |
} else { | |
if ("nodeGroupKey" === f) { | |
var h = b.object, | |
p = a.Ph(h); | |
if (null !== p) { | |
var q = b.newValue; | |
if (void 0 !== q) { | |
var r = a.Ye(q); | |
p.Sa = r instanceof V ? r : null | |
} else { | |
p.Sa = null | |
} | |
} | |
} else { | |
if ("linkLabelKeys" === f) { | |
if (h = b.object, k = a.pg(h), null !== k) { | |
var s = b.oldValue, | |
t = b.newValue; | |
if (u.isArray(s)) { | |
for (var v = u.qb(s), x = 0; x < v; x++) { | |
var A = u.ib(s, x), | |
m = a.Ye(A); | |
null !== m && (m.de = null) | |
} | |
} | |
if (u.isArray(t)) { | |
for (v = u.qb(t), x = 0; x < v; x++) { | |
A = u.ib(t, x), m = a.Ye(A), null !== m && (m.de = k) | |
} | |
} | |
} | |
} else { | |
if ("nodeParentKey" === f) { | |
var y = b.object, | |
C = a.Ye(b.newValue), | |
I = a.Xv(y); | |
if (null !== I) { | |
var H = I.Bs(); | |
null !== H ? null === C ? a.remove(H) : a.rd ? H.V = C : H.ba = C : mk(a, C, I) | |
} | |
} else { | |
if ("parentLinkCategory" === f) { | |
var y = b.object, | |
I = a.Xv(y), | |
R = b.newValue; | |
null !== I && "string" === typeof R && (H = I.Bs(), null !== H && (H.Jc = R)) | |
} else { | |
if ("nodeCategory" === f) { | |
var h = b.object, | |
aa = a.Ph(h), | |
R = b.newValue; | |
null !== aa && "string" === typeof R && (aa.Jc = R) | |
} else { | |
if ("linkCategory" === f) { | |
var h = b.object, | |
S = a.pg(h), | |
R = b.newValue; | |
null !== S && "string" === typeof R && (S.Jc = R) | |
} else { | |
if ("nodeDataArray" === f) { | |
var N = b.oldValue; | |
jk(a, N); | |
var Z = b.newValue; | |
kk(a, Z) | |
} else { | |
"linkDataArray" === f && (N = b.oldValue, jk(a, N), Z = b.newValue, lk(a, Z)) | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
a.Sh = !0 | |
} else { | |
c === be ? (Z = b.newValue, "nodeDataArray" === f && u.Ta(Z) ? nk(a, Z) : "linkDataArray" === f && u.Ta(Z) ? ok(a, Z) : "linkLabelKeys" === f && Ne(Z) && (k = a.pg(b.object), m = a.Ye(Z), null !== k && null !== m && (m.de = k)), a.Sh = !0) : c === ce ? (N = b.oldValue, "nodeDataArray" === f && u.Ta(N) ? pk(a, N) : "linkDataArray" === f && u.Ta(N) ? pk(a, N) : "linkLabelKeys" === f && Ne(N) && (m = a.Ye(N), null !== m && (m.de = null)), a.Sh = !0) : c === ae && ("SourceChanged" === f ? Pi(a, b.object, b.propertyName) : "ModelDisplaced" === f && a.ol()) | |
} | |
} else { | |
if (c === $d) { | |
var Ga = b.propertyName, | |
h = b.object; | |
if (h === a.ha) { | |
if ("nodeKeyProperty" === Ga || "nodeCategoryProperty" === Ga || "linkFromKeyProperty" === Ga || "linkToKeyProperty" === Ga || "linkFromPortIdProperty" === Ga || "linkToPortIdProperty" === Ga || "linkLabelKeysProperty" === Ga || "nodeIsGroupProperty" === Ga || "nodeGroupKeyProperty" === Ga || "nodeParentKeyProperty" === Ga || "linkCategoryProperty" === Ga) { | |
a.ga.fb || a.ol() | |
} | |
} else { | |
Pi(a, h, Ga) | |
} | |
a.Sh = !0 | |
} else { | |
if (c === be || c === ce) { | |
qk(a, b), a.Sh = !0 | |
} else { | |
if (c === ae) { | |
if ("FinishedUndo" === d || "FinishedRedo" === d) { | |
a.ga.gi = !0, a.Ba("ChangedSelection"), ej(a), a.ga.gi = !1 | |
} | |
a.eu = !0; | |
a.df(); | |
e = a.oh; | |
e.cd && 0 === a.ga.Me && fi(e); | |
"CommittedTransaction" === d && a.ga.Zx && (a.Kg = Math.min(a.Kg, a.ga.Ji - 1)); | |
ik(a); | |
var ua = b.iH; | |
ua && a.rw.clear(); | |
!a.jy && ua && (a.jy = !0, u.setTimeout(function() { | |
a.Va.standardMouseOver(); | |
a.jy = !1 | |
}, 10)) | |
} | |
} | |
} | |
} | |
} finally { | |
a.Oa = !0 | |
} | |
} | |
} | |
} | |
} | |
function Pi(a, b, c) { | |
if ("string" === typeof c) { | |
var d = a.Ph(b); | |
if (null !== d) { | |
d.Ob(c), a.ha instanceof qe && (d = a.pg(b), null !== d && d.Ob(c)) | |
} else { | |
for (var d = null, e = a.Ql.i; e.next();) { | |
for (var f = e.value, h = 0; h < f.length; h++) { | |
var k = f[h]; | |
null !== k.$f && (k = k.$f.ua(b), null !== k && (null === d && (d = u.hb()), d.push(k))) | |
} | |
if (null !== d) { | |
break | |
} | |
} | |
if (null !== d) { | |
for (e = 0; e < d.length; e++) { | |
d[e].Ob(c) | |
} | |
u.sa(d) | |
} | |
} | |
b === a.ha.$s && a.FI(c) | |
} | |
} | |
u.defineProperty(D, { | |
Kw: "skipsModelSourceBindings" | |
}, function() { | |
return this.eC | |
}, function(a) { | |
this.eC = a | |
}); | |
u.defineProperty(D, { | |
ut: null | |
}, function() { | |
return this.yy | |
}, function(a) { | |
this.yy = a | |
}); | |
function qk(a, b) { | |
var c = b.Cd === be, | |
d = c ? b.zg : b.Bg, | |
e = c ? b.newValue : b.oldValue, | |
f = a.Ql.ua(b.object); | |
if (Array.isArray(f)) { | |
for (var h = 0; h < f.length; h++) { | |
var k = f[h]; | |
if (c) { | |
rk(k, e, d) | |
} else { | |
var l = d; | |
if (!(0 > l)) { | |
var m = l; | |
sk(k) && m++; | |
k.Ge(m); | |
tk(k, m, l) | |
} | |
} | |
} | |
} | |
} | |
function Mj(a, b) { | |
var c = b.hi; | |
if (u.isArray(c)) { | |
var d = a.Ql.ua(c); | |
if (null === d) { | |
d = [], d.push(b), a.Ql.add(c, d) | |
} else { | |
for (c = 0; c < d.length; c++) { | |
if (d[c] === b) { | |
return | |
} | |
} | |
d.push(b) | |
} | |
} | |
} | |
function Qj(a, b) { | |
var c = b.hi; | |
if (u.isArray(c)) { | |
var d = a.Ql.ua(c); | |
if (null !== d) { | |
for (var e = 0; e < d.length; e++) { | |
if (d[e] === b) { | |
d.splice(e, 1); | |
0 === d.length && a.Ql.remove(c); | |
break | |
} | |
} | |
} | |
} | |
} | |
function Lj(a, b) { | |
for (var c = b.Aa.n, d = c.length, e = 0; e < d; e++) { | |
var f = c[e]; | |
f instanceof Ri && uk(a, f) | |
} | |
} | |
function uk(a, b) { | |
var c = b.element; | |
if (null !== c) { | |
var c = c.src, | |
d = a.Vn.ua(c); | |
if (null === d) { | |
d = [], d.push(b), a.Vn.add(c, d) | |
} else { | |
for (c = 0; c < d.length; c++) { | |
if (d[c] === b) { | |
return | |
} | |
} | |
d.push(b) | |
} | |
} | |
} | |
function Pj(a, b) { | |
for (var c = b.Aa.n, d = c.length, e = 0; e < d; e++) { | |
var f = c[e]; | |
f instanceof Ri && vk(a, f) | |
} | |
} | |
function vk(a, b) { | |
var c = b.element; | |
if (null !== c) { | |
var c = c.src, | |
d = a.Vn.ua(c); | |
if (null !== d) { | |
for (var e = 0; e < d.length; e++) { | |
if (d[e] === b) { | |
d.splice(e, 1); | |
0 === d.length && a.Vn.remove(c); | |
break | |
} | |
} | |
} | |
} | |
} | |
D.prototype.clear = D.prototype.clear = function() { | |
var a = null; | |
null !== this.bd && (a = this.bd.W); | |
this.ha.clear(); | |
for (var b = this.$b.length, c = 0; c < b; c++) { | |
this.$b.n[c].clear() | |
} | |
this.Zf.clear(); | |
this.Il.clear(); | |
this.Tn.clear(); | |
this.Ik.clear(); | |
this.Pn.clear(); | |
this.Db.clear(); | |
this.ai.clear(); | |
this.lk.clear(); | |
this.Ql.clear(); | |
this.fv.Ma(); | |
this.fv.clear(); | |
this.fv.freeze(); | |
this.su.Ma(); | |
this.su.clear(); | |
this.su.freeze(); | |
gf = this.gn = null; | |
hf = ""; | |
this.fu = (new z(NaN, NaN, NaN, NaN)).freeze(); | |
null !== a && (this.add(a), this.Db.remove(a)); | |
this.na() | |
}; | |
D.prototype.reset = D.prototype.reset = function() { | |
this.Oc = !0; | |
this.clear(); | |
this.$b = new E(we); | |
this.rE(); | |
this.qE(); | |
this.Na = (new w(NaN, NaN)).freeze(); | |
this.ac = 1; | |
this.uu = (new w(NaN, NaN)).freeze(); | |
this.vu = NaN; | |
this.Mu = 0.0001; | |
this.Ju = 100; | |
this.xv = (new w(NaN, NaN)).freeze(); | |
this.lu = (new z(NaN, NaN, NaN, NaN)).freeze(); | |
this.Bl = vf; | |
this.fn = uc; | |
this.tk = vf; | |
this.Cn = uc; | |
this.wu = this.tu = xb; | |
this.Rt = (new rb(16, 16, 16, 16)).freeze(); | |
this.zu = !0; | |
this.tv = Hg; | |
this.Rp = "auto"; | |
this.$h = this.ui = this.ki = this.Pu = this.li = this.mi = this.ni = this.Zh = this.di = this.Xh = null; | |
this.vk = !1; | |
this.Yj = this.Xj = this.Ht = this.Oe = !0; | |
this.Jt = this.It = !1; | |
this.Nt = this.Kt = this.ru = this.qu = this.Ot = this.Mt = this.fk = this.ek = this.dk = this.ck = this.ak = this.bk = this.$j = this.Lt = this.hk = this.Zj = this.gk = !0; | |
this.cv = this.bv = 16; | |
this.Qe = (new rb(5)).freeze(); | |
this.Ku = 999999999; | |
this.Od = null; | |
Ui(this); | |
this.bd = null; | |
this.ri = !0; | |
Ti(this); | |
this.Qb = new Je; | |
this.ri = !1; | |
this.ha = new Q; | |
this.nf = !1; | |
this.wn = !0; | |
this.Oc = this.Ff = !1; | |
this.na() | |
}; | |
D.prototype.rebuildParts = D.prototype.ol = function() { | |
for (var a = this.Kz.i; a.next();) { | |
var b = a.value, | |
c = a.key; | |
(!b.Hd() || b instanceof V) && u.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.jz.i; a.next();) { | |
b = a.value, c = a.key, b instanceof V || u.k('Invalid group template in Diagram.groupTemplateMap: template for "' + c + '" must be a Group, not a normal Node or Link: ' + b) | |
} | |
for (a = this.yz.i; a.next();) { | |
b = a.value, c = a.key, b instanceof W || u.k('Invalid link template in Diagram.linkTemplateMap: template for "' + c + '" must be a Link, not a normal Node or simple Part: ' + b) | |
} | |
a = u.hb(); | |
for (b = this.selection.i; b.next();) { | |
(c = b.value.data) && a.push(c) | |
} | |
for (var b = u.hb(), d = this.bw.i; d.next();) { | |
(c = d.value.data) && b.push(c) | |
} | |
c = u.hb(); | |
for (d = this.Ag.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.Sj.i; d.next();) { | |
e = d.value, null !== e.data && (c.push(e.data), c.push(e.location)) | |
} | |
d = this.ha; | |
d instanceof Q && jk(this, d.Qj); | |
jk(this, d.dh); | |
kk(this, d.dh); | |
d instanceof Q && lk(this, d.Qj); | |
for (d = 0; d < a.length; d++) { | |
e = this.Ph(a[d]), null !== e && (e.$a = !0) | |
} | |
for (d = 0; d < b.length; d++) { | |
e = this.Ph(b[d]), null !== e && (e.Yg = !0) | |
} | |
for (d = 0; d < c.length; d += 2) { | |
e = this.Ph(c[d]), null !== e && (e.location = c[d + 1]) | |
} | |
u.sa(a); | |
u.sa(b); | |
u.sa(c) | |
}; | |
function kk(a, b) { | |
if (null !== b) { | |
for (var c = a.ha, d = u.qb(b), e = 0; e < d; e++) { | |
var f = u.ib(b, e); | |
c.Ve(f) ? nk(a, f, !1) : c instanceof Q && ok(a, f) | |
} | |
if (c instanceof Q || c instanceof qe) { | |
for (e = 0; e < d; e++) { | |
f = u.ib(b, e), c.Ve(f) && wk(a, f) | |
} | |
if (c instanceof Q) { | |
for (c = a.links; c.next();) { | |
xk(c.value) | |
} | |
} | |
} | |
yk(a, !1) | |
} | |
} | |
function nk(a, b, c) { | |
if (void 0 !== b && null !== b && !a.ga.fb && !a.ai.contains(b)) { | |
void 0 === c && (c = !0); | |
var d = a.gz(b), | |
e = zk(a, b, d); | |
null !== e && (nf(e), e = e.copy(), null !== e && (e.Wh = d, a.Ym && (e.wk = "Tool"), a.add(e), e.data = b, c && wk(a, b))) | |
} | |
} | |
D.prototype.gz = function(a) { | |
return this.ha.gz(a) | |
}; | |
var Ak = !1, | |
Bk = !1; | |
function zk(a, b, c) { | |
var d = !1, | |
e = a.ha; | |
e instanceof Q && (d = e.uz(b)); | |
d ? (b = a.jz.ua(c), null === b && (b = a.jz.ua(""), null === b && (Bk || (Bk = !0, u.trace('No Group template found for category "' + c + '"'), u.trace(" Using default group template")), b = a.SA))) : (b = a.Kz.ua(c), null === b && (b = a.Kz.ua(""), null === b && (Ak || (Ak = !0, u.trace('No Node template found for category "' + c + '"'), u.trace(" Using default node template")), b = a.UA))); | |
return b | |
} | |
function wk(a, b) { | |
var c = a.ha; | |
if (c instanceof Q || c instanceof qe) { | |
var d = c.wb(b); | |
if (void 0 !== d) { | |
var e = Oe(c, d), | |
f = a.Ph(b); | |
if (null !== e && null !== f) { | |
for (e = e.i; e.next();) { | |
var h = e.value; | |
if (c instanceof Q) { | |
var k = c; | |
if (k.Ve(h)) { | |
if (f instanceof V && k.Fm(h) === d) { | |
var l = f, | |
h = a.Ph(h); | |
null !== h && (h.Sa = l) | |
} | |
} else { | |
var m = a.pg(h); | |
if (null !== m && f instanceof U && (l = f, k.$k(h) === d && (m.V = l), k.cl(h) === d && (m.ba = l), h = k.Pj(h), u.isArray(h))) { | |
for (k = 0; k < u.qb(h); k++) { | |
if (u.ib(h, k) === d) { | |
l.de = m; | |
break | |
} | |
} | |
} | |
} | |
} else { | |
c instanceof qe && (m = c, m.Ve(h) && f instanceof U && (l = f, m.Gm(h) === d && (h = a.Xv(h), mk(a, l, h)))) | |
} | |
} | |
Qe(c, d) | |
} | |
c instanceof Q ? (c = c.Fm(b), void 0 !== c && (c = a.Ye(c), c instanceof V && (f.Sa = c))) : c instanceof qe && (c = c.Gm(b), void 0 !== c && f instanceof U && (l = f, f = a.Ye(c), mk(a, f, l))) | |
} | |
} | |
} | |
function mk(a, b, c) { | |
if (null !== b && null !== c) { | |
var d = a.tb.UD, | |
e = b, | |
f = c; | |
if (a.rd) { | |
for (b = f.pe; b.next();) { | |
if (b.value.ba === f) { | |
return | |
} | |
} | |
} else { | |
for (e = c, f = b, b = e.pe; b.next();) { | |
if (b.value.V === e) { | |
return | |
} | |
} | |
} | |
null !== d && Jg(d, e, f, null, !0) || (d = a.Zv(c.data), b = Ck(a, d), null !== b && (nf(b), b = b.copy(), null !== b && (b.Wh = d, b.V = e, b.ba = f, a.add(b), b.data = c.data))) | |
} | |
} | |
function lk(a, b) { | |
if (null !== b) { | |
for (var c = u.qb(b), d = 0; d < c; d++) { | |
var e = u.ib(b, d); | |
ok(a, e) | |
} | |
yk(a, !1) | |
} | |
} | |
function ok(a, b) { | |
if (void 0 !== b && null !== b && !a.ga.fb && !a.lk.contains(b)) { | |
var c = a.Zv(b), | |
d = Ck(a, c); | |
if (null !== d && (nf(d), d = d.copy(), null !== d)) { | |
d.Wh = c; | |
var c = a.ha, | |
e = c.GG(b); | |
"" !== e && (d.rg = e); | |
e = c.$k(b); | |
void 0 !== e && (e = a.Ye(e), e instanceof U && (d.V = e)); | |
e = c.JG(b); | |
"" !== e && (d.mh = e); | |
e = c.cl(b); | |
void 0 !== e && (e = a.Ye(e), e instanceof U && (d.ba = e)); | |
c = c.Pj(b); | |
if (u.isArray(c)) { | |
for (var e = u.qb(c), f = 0; f < e; f++) { | |
var h = u.ib(c, f), | |
h = a.Ye(h); | |
null !== h && (h.de = d) | |
} | |
} | |
a.add(d); | |
d.data = b | |
} | |
} | |
} | |
D.prototype.Zv = function(a) { | |
var b = this.ha, | |
c = ""; | |
b instanceof Q ? c = b.Zv(a) : b instanceof qe && (c = b.IG(a)); | |
return c | |
}; | |
var Dk = !1; | |
function Ck(a, b) { | |
var c = a.yz.ua(b); | |
null === c && (c = a.yz.ua(""), null === c && (Dk || (Dk = !0, u.trace('No Link template found for category "' + b + '"'), u.trace(" Using default link template")), c = a.TA)); | |
return c | |
} | |
function jk(a, b) { | |
for (var c = u.qb(b), d = 0; d < c; d++) { | |
var e = u.ib(b, d); | |
pk(a, e) | |
} | |
} | |
function pk(a, b) { | |
if (void 0 !== b && null !== b) { | |
var c = a.Ph(b); | |
if (null !== c) { | |
c.$a = !1; | |
c.Yg = !1; | |
var d = c.layer; | |
if (null !== d && d.g === a) { | |
var e = a.ha; | |
if (e instanceof Q && c instanceof U) { | |
var f = c, | |
h = e.wb(f.data); | |
if (void 0 !== h) { | |
for (var k = f.pe; k.next();) { | |
Pe(e, h, k.value.data) | |
} | |
f.uf && (k = f.de, null !== k && Pe(e, h, k.data)); | |
if (f instanceof V) { | |
for (f = f.Lc; f.next();) { | |
k = f.value.data, e.Ve(k) && Pe(e, h, k) | |
} | |
} | |
} | |
} else { | |
if (e instanceof qe && c instanceof U) { | |
f = c; | |
k = a.pg(f.data); | |
if (null !== k) { | |
k.$a = !1; | |
k.Yg = !1; | |
var l = k.layer; | |
if (null !== l) { | |
var m = l.Ge(-1, k, !1); | |
0 <= m && a.Cc(ce, "parts", l, k, null, m, null); | |
m = k.Ss; | |
null !== m && m(k, l, null) | |
} | |
} | |
k = a.rd; | |
for (f = f.pe; f.next();) { | |
l = f.value, l = (k ? l.ba : l.V).data, e.Ve(l) && Pe(e, h, l) | |
} | |
} | |
} | |
e = d.Ge(-1, c, !1); | |
0 <= e && a.Cc(ce, "parts", d, c, null, e, null); | |
e = c.Ss; | |
null !== e && e(c, d, null) | |
} | |
} | |
} | |
} | |
D.prototype.findPartForKey = D.prototype.AG = function(a) { | |
if (null === a || void 0 === a) { | |
return null | |
} | |
a = this.ha.sf(a); | |
return null === a ? null : this.ai.ua(a) | |
}; | |
D.prototype.findNodeForKey = D.prototype.Ye = function(a) { | |
if (null === a || void 0 === a) { | |
return null | |
} | |
a = this.ha.sf(a); | |
if (null === a) { | |
return null | |
} | |
a = this.ai.ua(a); | |
return a instanceof U ? a : null | |
}; | |
D.prototype.findPartForData = D.prototype.Ph = function(a) { | |
if (null === a) { | |
return null | |
} | |
var b = this.ai.ua(a); | |
return null !== b ? b : b = this.lk.ua(a) | |
}; | |
D.prototype.findNodeForData = D.prototype.Xv = function(a) { | |
if (null === a) { | |
return null | |
} | |
a = this.ai.ua(a); | |
return a instanceof U ? a : null | |
}; | |
D.prototype.findLinkForData = D.prototype.pg = function(a) { | |
return null === a ? null : this.lk.ua(a) | |
}; | |
D.prototype.findNodesByExample = function(a) { | |
for (var b = new F, c = this.Tn.i; c.next();) { | |
var d = c.value, | |
e = d.data; | |
if (null !== e) { | |
for (var f = 0; f < arguments.length; f++) { | |
var h = arguments[f]; | |
if (u.Ta(h) && Ek(this, e, h)) { | |
b.add(d); | |
break | |
} | |
} | |
} | |
} | |
return b.i | |
}; | |
D.prototype.findLinksByExample = function(a) { | |
for (var b = new F, c = this.Pn.i; c.next();) { | |
var d = c.value, | |
e = d.data; | |
if (null !== e) { | |
for (var f = 0; f < arguments.length; f++) { | |
var h = arguments[f]; | |
if (u.Ta(h) && Ek(this, e, h)) { | |
b.add(d); | |
break | |
} | |
} | |
} | |
} | |
return b.i | |
}; | |
function Ek(a, b, c) { | |
for (var d in c) { | |
var e = b[d], | |
f = c[d]; | |
if (u.isArray(f)) { | |
if (!u.isArray(e) || e.length >= f.length) { | |
return !1 | |
} | |
for (var h = 0; h < e.length; h++) { | |
var k = e[h], | |
l = f[h]; | |
if (void 0 !== l && !Fk(a, k, l)) { | |
return !1 | |
} | |
} | |
} else { | |
if (!Fk(a, e, f)) { | |
return !1 | |
} | |
} | |
} | |
return !0 | |
} | |
function Fk(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 (u.Ta(b) && u.Ta(c)) { | |
if (!Ek(a, b, c)) { | |
return !1 | |
} | |
} else { | |
if (b !== c) { | |
return !1 | |
} | |
} | |
} | |
} | |
return !0 | |
} | |
u.defineProperty(D, { | |
eK: "nodeTemplate" | |
}, function() { | |
return this.oi.ua("") | |
}, function(a) { | |
var b = this.oi.ua(""); | |
b !== a && (u.C(a, G, D, "nodeTemplate"), this.oi.add("", a), this.h("nodeTemplate", b, a), this.ga.fb || this.ol()) | |
}); | |
u.defineProperty(D, { | |
Kz: "nodeTemplateMap" | |
}, function() { | |
return this.oi | |
}, function(a) { | |
var b = this.oi; | |
b !== a && (u.C(a, la, D, "nodeTemplateMap"), this.oi = a, this.h("nodeTemplateMap", b, a), this.ga.fb || this.ol()) | |
}); | |
u.defineProperty(D, { | |
CJ: "groupTemplate" | |
}, function() { | |
return this.ok.ua("") | |
}, function(a) { | |
var b = this.ok.ua(""); | |
b !== a && (u.C(a, V, D, "groupTemplate"), this.ok.add("", a), this.h("groupTemplate", b, a), this.ga.fb || this.ol()) | |
}); | |
u.defineProperty(D, { | |
jz: "groupTemplateMap" | |
}, function() { | |
return this.ok | |
}, function(a) { | |
var b = this.ok; | |
b !== a && (u.C(a, la, D, "groupTemplateMap"), this.ok = a, this.h("groupTemplateMap", b, a), this.ga.fb || this.ol()) | |
}); | |
u.defineProperty(D, { | |
UJ: "linkTemplate" | |
}, function() { | |
return this.hj.ua("") | |
}, function(a) { | |
var b = this.hj.ua(""); | |
b !== a && (u.C(a, W, D, "linkTemplate"), this.hj.add("", a), this.h("linkTemplate", b, a), this.ga.fb || this.ol()) | |
}); | |
u.defineProperty(D, { | |
yz: "linkTemplateMap" | |
}, function() { | |
return this.hj | |
}, function(a) { | |
var b = this.hj; | |
b !== a && (u.C(a, la, D, "linkTemplateMap"), this.hj = a, this.h("linkTemplateMap", b, a), this.ga.fb || this.ol()) | |
}); | |
u.defineProperty(D, { | |
fH: null | |
}, function() { | |
return this.Nl | |
}, function(a) { | |
this.Nl = a | |
}); | |
u.defineProperty(D, { | |
He: "isMouseCaptured" | |
}, function() { | |
return this.uB | |
}, function(a) { | |
var b = this.kb; | |
null !== b && (a ? (this.N.bubbles = !1, b.removeEventListener("mousemove", this.So, !1), b.removeEventListener("mousedown", this.Ro, !1), b.removeEventListener("mouseup", this.Uo, !1), b.removeEventListener("mousewheel", this.ah, !1), b.removeEventListener("DOMMouseScroll", this.ah, !1), b.removeEventListener("mouseout", this.To, !1), window.addEventListener("mousemove", this.So, !0), window.addEventListener("mousedown", this.Ro, !0), window.addEventListener("mouseup", this.Uo, !0), window.addEventListener("mousewheel", this.ah, !0), window.addEventListener("DOMMouseScroll", this.ah, !0), window.addEventListener("mouseout", this.To, !0), window.addEventListener("selectstart", this.preventDefault, !1)) : (window.removeEventListener("mousemove", this.So, !0), window.removeEventListener("mousedown", this.Ro, !0), window.removeEventListener("mouseup", this.Uo, !0), window.removeEventListener("mousewheel", this.ah, !0), window.removeEventListener("DOMMouseScroll", this.ah, !0), window.removeEventListener("mouseout", this.To, !0), window.removeEventListener("selectstart", this.preventDefault, !1), b.addEventListener("mousemove", this.So, !1), b.addEventListener("mousedown", this.Ro, !1), b.addEventListener("mouseup", this.Uo, !1), b.addEventListener("mousewheel", this.ah, !1), b.addEventListener("DOMMouseScroll", this.ah, !1), b.addEventListener("mouseout", this.To, !1)), this.uB = a) | |
}); | |
u.defineProperty(D, { | |
position: "position" | |
}, function() { | |
return this.Na | |
}, function(a) { | |
var b = this.Na; | |
if (!b.L(a)) { | |
u.C(a, w, D, "position"); | |
var c = this.ob.copy(); | |
a = a.copy(); | |
if (!this.Oc && null !== this.kb) { | |
this.Oc = !0; | |
var d = this.scale; | |
ij(this, a, this.Ed, this.Ab / d, this.zb / d, this.fn, !1); | |
this.Oc = !1 | |
} | |
this.Na = a.Z(); | |
a = this.Mb; | |
a.cd && si(a, b, this.Na); | |
this.Oc || this.et(c, this.ob) | |
} | |
}); | |
u.defineProperty(D, { | |
UG: "initialPosition" | |
}, function() { | |
return this.uu | |
}, function(a) { | |
this.uu.L(a) || (u.C(a, w, D, "initialPosition"), this.uu = a.Z()) | |
}); | |
u.defineProperty(D, { | |
VG: "initialScale" | |
}, function() { | |
return this.vu | |
}, function(a) { | |
this.vu !== a && (u.j(a, "number", D, "initialScale"), this.vu = a) | |
}); | |
u.defineProperty(D, { | |
Hs: "grid" | |
}, function() { | |
null === this.bd && aj(this); | |
return this.bd | |
}, function(a) { | |
var b = this.bd; | |
if (b !== a) { | |
null === b && (aj(this), b = this.bd); | |
u.C(a, B, D, "grid"); | |
a.type !== bj && u.k("Diagram.grid must be a Panel of type Panel.Grid"); | |
var c = b.P; | |
null !== c && c.remove(b); | |
this.bd = a; | |
a.name = "GRID"; | |
null !== c && c.add(a); | |
vj(this); | |
this.na(); | |
this.h("grid", b, a) | |
} | |
}); | |
u.u(D, { | |
ob: "viewportBounds" | |
}, function() { | |
var a = this.CC; | |
if (null === this.kb) { | |
return a | |
} | |
var b = this.Na, | |
c = this.ac; | |
a.m(b.x, b.y, Math.max(this.Ab, 0) / c, Math.max(this.zb, 0) / c); | |
return a | |
}); | |
u.defineProperty(D, { | |
vD: "fixedBounds" | |
}, function() { | |
return this.lu | |
}, function(a) { | |
var b = this.lu; | |
b.L(a) || (u.C(a, z, D, "fixedBounds"), -Infinity !== a.width && Infinity !== a.height && -Infinity !== a.height || u.k("fixedBounds width/height must not be Infinity"), this.lu = a = a.Z(), this.pc(), this.h("fixedBounds", b, a)) | |
}); | |
u.defineProperty(D, { | |
yE: "scrollMargin" | |
}, function() { | |
return this.wy | |
}, function(a) { | |
"number" === typeof a ? a = new rb(a) : u.C(a, rb, D, "scrollMargin"); | |
var b = this.wy; | |
b.L(a) || (this.wy = a = a.Z(), this.pc(), this.h("scrollMargin", b, a)) | |
}); | |
u.defineProperty(D, { | |
zE: "scrollMode" | |
}, function() { | |
return this.xy | |
}, function(a) { | |
var b = this.xy; | |
b !== a && (u.rb(a, D, D, "scrollMode"), this.xy = a, a === Ni && gj(this, !1), this.h("scrollMode", b, a)) | |
}); | |
u.defineProperty(D, { | |
hE: "positionComputation" | |
}, function() { | |
return this.py | |
}, function(a) { | |
var b = this.py; | |
b !== a && (null !== a && u.j(a, "function", D, "positionComputation"), this.py = a, gj(this, !1), this.h("positionComputation", b, a)) | |
}); | |
u.defineProperty(D, { | |
xE: "scaleComputation" | |
}, function() { | |
return this.sy | |
}, function(a) { | |
var b = this.sy; | |
b !== a && (null !== a && u.j(a, "function", D, "scaleComputation"), this.sy = a, Yj(this, this.scale, this.scale), this.h("scaleComputation", b, a)) | |
}); | |
u.u(D, { | |
Ed: "documentBounds" | |
}, function() { | |
return this.fu | |
}); | |
function jj(a, b) { | |
a.fi = !1; | |
var c = a.fu; | |
c.L(b) || (b = b.Z(), a.fu = b, gj(a, !1), a.Ba("DocumentBoundsChanged", null, c.copy()), sj(a)) | |
} | |
u.defineProperty(D, { | |
scale: "scale" | |
}, function() { | |
return this.ac | |
}, function(a) { | |
var b = this.ac; | |
u.Be(a, D, "scale"); | |
b !== a && Yj(this, b, a) | |
}); | |
u.defineProperty(D, { | |
po: "autoScale" | |
}, function() { | |
return this.Bl | |
}, function(a) { | |
var b = this.Bl; | |
b !== a && (u.rb(a, D, D, "autoScale"), this.Bl = a, this.h("autoScale", b, a), a !== vf && gj(this, !1)) | |
}); | |
u.defineProperty(D, { | |
FJ: "initialAutoScale" | |
}, function() { | |
return this.tk | |
}, function(a) { | |
var b = this.tk; | |
b !== a && (u.rb(a, D, D, "initialAutoScale"), this.tk = a, this.h("initialAutoScale", b, a)) | |
}); | |
u.defineProperty(D, { | |
WG: "initialViewportSpot" | |
}, function() { | |
return this.wu | |
}, function(a) { | |
var b = this.wu; | |
b !== a && (u.C(a, L, D, "initialViewportSpot"), a.Vc() || u.k("initialViewportSpot must be a real Spot: " + a), this.wu = a, this.h("initialViewportSpot", b, a)) | |
}); | |
u.defineProperty(D, { | |
TG: "initialDocumentSpot" | |
}, function() { | |
return this.tu | |
}, function(a) { | |
var b = this.tu; | |
b !== a && (u.C(a, L, D, "initialDocumentSpot"), a.Vc() || u.k("initialViewportSpot must be a real Spot: " + a), this.tu = a, this.h("initialDocumentSpot", b, a)) | |
}); | |
u.defineProperty(D, { | |
$g: "minScale" | |
}, function() { | |
return this.Mu | |
}, function(a) { | |
u.Be(a, D, "minScale"); | |
var b = this.Mu; | |
b !== a && (0 < a ? (this.Mu = a, this.h("minScale", b, a), a > this.scale && (this.scale = a)) : u.xa(a, "> 0", D, "minScale")) | |
}); | |
u.defineProperty(D, { | |
Zg: "maxScale" | |
}, function() { | |
return this.Ju | |
}, function(a) { | |
u.Be(a, D, "maxScale"); | |
var b = this.Ju; | |
b !== a && (0 < a ? (this.Ju = a, this.h("maxScale", b, a), a < this.scale && (this.scale = a)) : u.xa(a, "> 0", D, "maxScale")) | |
}); | |
u.defineProperty(D, { | |
yl: "zoomPoint" | |
}, function() { | |
return this.xv | |
}, function(a) { | |
this.xv.L(a) || (u.C(a, w, D, "zoomPoint"), this.xv = a = a.Z()) | |
}); | |
u.defineProperty(D, { | |
cD: "contentAlignment" | |
}, function() { | |
return this.fn | |
}, function(a) { | |
var b = this.fn; | |
b.L(a) || (u.C(a, L, D, "contentAlignment"), this.fn = a = a.Z(), this.h("contentAlignment", b, a), gj(this, !1)) | |
}); | |
u.defineProperty(D, { | |
GJ: "initialContentAlignment" | |
}, function() { | |
return this.Cn | |
}, function(a) { | |
var b = this.Cn; | |
b.L(a) || (u.C(a, L, D, "initialContentAlignment"), this.Cn = a = a.Z(), this.h("initialContentAlignment", b, a)) | |
}); | |
u.defineProperty(D, { | |
padding: "padding" | |
}, function() { | |
return this.Qe | |
}, function(a) { | |
"number" === typeof a ? a = new rb(a) : u.C(a, rb, D, "padding"); | |
var b = this.Qe; | |
b.L(a) || (this.Qe = a = a.Z(), this.pc(), this.h("padding", b, a)) | |
}); | |
u.u(D, { | |
Ag: "nodes" | |
}, function() { | |
return this.Tn.i | |
}); | |
u.u(D, { | |
links: "links" | |
}, function() { | |
return this.Pn.i | |
}); | |
u.u(D, { | |
Sj: "parts" | |
}, function() { | |
return this.Db.i | |
}); | |
D.prototype.findTopLevelNodesAndLinks = function() { | |
for (var a = new F(G), b = this.Tn.i; b.next();) { | |
var c = b.value; | |
c.Jo && a.add(c) | |
} | |
for (b = this.Pn.i; b.next();) { | |
c = b.value, c.Jo && a.add(c) | |
} | |
return a.i | |
}; | |
D.prototype.findTopLevelGroups = function() { | |
return this.Ik.i | |
}; | |
u.defineProperty(D, { | |
Qb: "layout" | |
}, function() { | |
return this.Od | |
}, function(a) { | |
var b = this.Od; | |
b !== a && (u.C(a, Je, D, "layout"), null !== b && (b.g = null, b.group = null), this.Od = a, a.g = this, a.group = null, this.Pt = !0, this.h("layout", b, a), this.ee()) | |
}); | |
D.prototype.layoutDiagram = function(a) { | |
ej(this); | |
a && yk(this, !0); | |
xj(this, !1) | |
}; | |
function yk(a, b) { | |
for (var c = a.Ik.i; c.next();) { | |
Gk(a, c.value, b) | |
} | |
null !== a.Qb && (b ? a.Qb.wf = !1 : a.Qb.H()) | |
} | |
function Gk(a, b, c) { | |
if (null !== b) { | |
for (var d = b.Rn.i; d.next();) { | |
Gk(a, d.value, c) | |
} | |
null !== b.Qb && (c ? b.Qb.wf = !1 : b.Qb.H()) | |
} | |
} | |
function xj(a, b) { | |
if (!a.Bx) { | |
var c = a.Qb, | |
d = a.Au; | |
a.Au = !0; | |
var e = a.Oa; | |
a.Oa = !0; | |
try { | |
a.Xb("Layout"); | |
for (var f = a.Ik.i; f.next();) { | |
Hk(a, f.value, b) | |
} | |
c.wf || b && !c.QD || (c.doLayout(a), ej(a), c.wf = !0) | |
} finally { | |
a.Xd("Layout"), a.Pt = !c.wf, a.Au = d, a.Oa = e | |
} | |
} | |
} | |
function Hk(a, b, c) { | |
if (null !== b) { | |
for (var d = b.Rn.i; d.next();) { | |
Hk(a, d.value, c) | |
} | |
d = b.Qb; | |
null === d || d.wf || c && !d.QD || (b.ky = !b.location.I(), d.doLayout(b), b.H(Ik), d.wf = !0, zj(a, b)) | |
} | |
} | |
u.defineProperty(D, { | |
rd: "isTreePathToChildren" | |
}, function() { | |
return this.zu | |
}, function(a) { | |
var b = this.zu; | |
if (b !== a && (u.j(a, "boolean", D, "isTreePathToChildren"), this.zu = a, this.h("isTreePathToChildren", b, a), !this.ga.fb)) { | |
for (a = this.Ag; a.next();) { | |
Jk(a.value) | |
} | |
} | |
}); | |
D.prototype.findTreeRoots = function() { | |
for (var a = new E(U), b = this.Ag; b.next();) { | |
var c = b.value; | |
c.Jo && null === c.Bs() && a.add(c) | |
} | |
return a.i | |
}; | |
u.defineProperty(D, { | |
ne: null | |
}, function() { | |
return this.mB | |
}, function(a) { | |
this.mB = a | |
}); | |
function Oi(a) { | |
function b(a) { | |
var b = a.toLowerCase(), | |
h = new E("function"); | |
c.add(a, h); | |
c.add(b, h); | |
d.add(a, a); | |
d.add(b, a) | |
} | |
var c = new la("string", E), | |
d = new la("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.Dx = c; | |
a.Cx = d | |
} | |
function ma(a, b) { | |
var c = a.Cx.ua(b); | |
return null !== c ? c : a.Cx.ua(b.toLowerCase()) | |
} | |
function Kk(a, b) { | |
var c = a.Dx.ua(b); | |
if (null !== c) { | |
return c | |
} | |
c = a.Dx.ua(b.toLowerCase()); | |
if (null !== c) { | |
return c | |
} | |
u.k("Unknown DiagramEvent name: " + b); | |
return null | |
} | |
D.prototype.addDiagramListener = D.prototype.My = function(a, b) { | |
u.j(a, "string", D, "addDiagramListener:name"); | |
u.j(b, "function", D, "addDiagramListener:listener"); | |
var c = Kk(this, a); | |
null !== c && c.add(b) | |
}; | |
D.prototype.removeDiagramListener = D.prototype.mE = function(a, b) { | |
u.j(a, "string", D, "removeDiagramListener:name"); | |
u.j(b, "function", D, "addDiagramListener:listener"); | |
var c = Kk(this, a); | |
null !== c && c.remove(b) | |
}; | |
D.prototype.raiseDiagramEvent = D.prototype.Ba = function(a, b, c) { | |
var d = Kk(this, a), | |
e = new Nd; | |
e.g = this; | |
e.name = ma(this, a); | |
void 0 !== b && (e.iA = b); | |
void 0 !== c && (e.Nz = c); | |
a = d.length; | |
if (1 === a) { | |
d = d.ja(0), d(e) | |
} else { | |
if (0 !== a) { | |
for (b = d.Le(), c = 0; c < a; c++) { | |
d = b[c], d(e) | |
} | |
} | |
} | |
return e.cancel | |
}; | |
function Cg(a, b) { | |
var c = !1; | |
a.ob.Kj(b) && (c = !0); | |
c = a.ez(b, function(a) { | |
return a.W | |
}, function(a) { | |
return a instanceof W | |
}, !0, function(a) { | |
return a instanceof W | |
}, c); | |
if (0 !== c.count) { | |
for (c = c.i; c.next();) { | |
var d = c.value; | |
d.el && d.Wb() | |
} | |
} | |
} | |
D.prototype.isUnoccupied = D.prototype.Lo = function(a, b) { | |
void 0 === b && (b = null); | |
return Lk(this, !1, null, b).Lo(a.x, a.y, a.width, a.height) | |
}; | |
function Lk(a, b, c, d) { | |
null === a.nd && (a.nd = new Mk); | |
if (a.nd.Ms || a.nd.group !== c || a.nd.gA !== d) { | |
if (null === c) { | |
b = a.fi ? fj(a) : a.Ed.copy(); | |
b.Kf(100, 100); | |
a.nd.initialize(b); | |
b = u.Tf(); | |
for (var e = a.Ag; e.next();) { | |
var f = e.value, | |
h = f.layer; | |
null !== h && h.visible && !h.zc && Nk(a, f, d, b) | |
} | |
} else { | |
for (c.ca.I() || c.rf(), b = c.ca.copy(), b.Kf(20, 20), a.nd.initialize(b), b = u.Tf(), e = c.Lc; e.next();) { | |
f = e.value, f instanceof U && Nk(a, f, d, b) | |
} | |
} | |
u.ic(b); | |
a.nd.group = c; | |
a.nd.gA = d; | |
a.nd.Ms = !1 | |
} else { | |
b && Ok(a.nd) | |
} | |
return a.nd | |
} | |
function Nk(a, b, c, d) { | |
if (b !== c) { | |
if (b.Ia() && b.canAvoid()) { | |
c = b.getAvoidableRect(d); | |
d = a.nd.to; | |
b = a.nd.ro; | |
for (var e = c.x + c.width, f = c.y + c.height, h = c.x; h < e; h += d) { | |
for (var k = c.y; k < f; k += b) { | |
Pk(a.nd, h, k) | |
} | |
Pk(a.nd, h, f) | |
} | |
for (k = c.y; k < f; k += b) { | |
Pk(a.nd, e, k) | |
} | |
Pk(a.nd, e, f) | |
} else { | |
if (b instanceof V) { | |
for (b = b.Lc; b.next();) { | |
e = b.value, e instanceof U && Nk(a, e, c, d) | |
} | |
} | |
} | |
} | |
} | |
function Qk(a, b) { | |
null === a.nd || a.nd.Ms || null !== b && !b.canAvoid() || (a.nd.Ms = !0) | |
} | |
D.prototype.simulatedMouseMove = D.prototype.Jw = function(a, b, c) { | |
if (null !== Ef) { | |
var d = Ef.g; | |
c instanceof D || (c = null); | |
var e = Ff; | |
c !== e && (null !== e && e !== d && null !== e.tb.Gd && (Kf(e), Ef.gw = !1, e.tb.Gd.doSimulatedDragLeave()), Ff = c, null !== c && c !== d && null !== c.tb.Gd && (eg(), e = c.tb.Gd, ag.contains(e) || ag.add(e), c.tb.Gd.doSimulatedDragEnter())); | |
if (null === c || c === d || !c.MC || c.nb || !c.no) { | |
return !1 | |
} | |
d = c.tb.Gd; | |
null !== d && (null !== a ? b = c.bq(a) : null === b && (b = new w), c.Pb.da = b, c.Pb.Wk = !1, c.Pb.up = !1, d.doSimulatedDragOver()); | |
return !0 | |
} | |
return !1 | |
}; | |
D.prototype.simulatedMouseUp = D.prototype.JE = function(a, b, c, d) { | |
if (null !== Ef) { | |
null === d && (d = b); | |
b = Ff; | |
var e = Ef.g; | |
if (d !== b) { | |
if (null !== b && b !== e && null !== b.tb.Gd) { | |
return Kf(b), Ef.gw = !1, b.tb.Gd.doSimulatedDragLeave(), !1 | |
} | |
Ff = d; | |
null !== d && null !== d.tb.Gd && (eg(), b = d.tb.Gd, ag.contains(b) || ag.add(b), d.tb.Gd.doSimulatedDragEnter()) | |
} | |
if (null === d) { | |
return Ef.doCancel(), !0 | |
} | |
if (d !== this) { | |
return null !== a && (c = d.bq(a)), d.Pb.da = c, d.Pb.Wk = !1, d.Pb.up = !0, a = d.tb.Gd, null !== a && a.doSimulatedDrop(), a = Ef, null !== a && (d = a.mayCopy(), a.Af = d ? "Copy" : "Move", a.stopTool()), !0 | |
} | |
} | |
return !1 | |
}; | |
u.defineProperty(D, { | |
SC: "autoScrollRegion" | |
}, function() { | |
return this.Rt | |
}, function(a) { | |
"number" === typeof a ? a = new rb(a) : u.C(a, rb, D, "autoScrollRegion"); | |
var b = this.Rt; | |
b.L(a) || (this.Rt = a = a.Z(), this.pc(), this.h("autoScrollRegion", b, a)) | |
}); | |
function xg(a, b) { | |
a.Qt.assign(b); | |
Rk(a, a.Qt).pd(a.position) ? Kf(a) : Sk(a) | |
} | |
function Sk(a) { | |
-1 === a.an && (a.an = u.setInterval(function() { | |
if (-1 !== a.an) { | |
Kf(a); | |
var b = a.N.event; | |
if (null !== b) { | |
var c = Rk(a, a.Qt); | |
c.pd(a.position) || (a.position = c, a.N.da = a.XE(a.Qt), a.Jw(b, null, b.target.Y) || a.doMouseMove(), a.fi = !0, jj(a, a.mg()), a.Nd = !0, a.df(), Sk(a)) | |
} | |
} | |
}, a.lF)) | |
} | |
function Kf(a) { | |
-1 !== a.an && (u.clearInterval(a.an), a.an = -1) | |
} | |
function Rk(a, b) { | |
var c = a.position, | |
d = a.SC; | |
if (0 >= d.top && 0 >= d.left && 0 >= d.right && 0 >= d.bottom) { | |
return c | |
} | |
var e = a.ob, | |
f = a.scale, | |
e = u.Vj(0, 0, e.width * f, e.height * f), | |
h = u.Yb(0, 0); | |
if (b.x >= e.x && b.x < e.x + d.left) { | |
var k = Math.max(a.mt, 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.mt, 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.nt, 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.nt, 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.pd(K.Wj) || (c = new w(c.x + h.x / f, c.y + h.y / f)); | |
u.ic(e); | |
u.v(h); | |
return c | |
} | |
D.prototype.makeSVG = D.prototype.makeSvg = function(a) { | |
void 0 === a && (a = new pa); | |
a.context = "svg"; | |
a = Tk(this, a); | |
return null !== a ? a.tl : null | |
}; | |
D.prototype.makeImage = function(a) { | |
void 0 === a && (a = new pa); | |
var b = (a.document || document).createElement("img"); | |
b.src = this.uH(a); | |
return b | |
}; | |
D.prototype.makeImageData = D.prototype.uH = function(a) { | |
void 0 === a && (a = new pa); | |
var b = Tk(this, a); | |
return null !== b ? b.toDataURL(a.type, a.details) : "" | |
}; | |
var Uk = !1; | |
function Tk(a, b) { | |
a.Mb.Ni(); | |
a.df(); | |
if (null === a.kb) { | |
return null | |
} | |
"object" !== typeof b && u.k("properties argument must be an Object."); | |
var c = !1, | |
d = b.size || null, | |
e = b.scale || null; | |
void 0 !== b.scale && isNaN(b.scale) && (e = "NaN"); | |
var f = b.maxSize; | |
void 0 === b.maxSize && (c = !0, f = "svg" === b.context ? new ia(Infinity, Infinity) : new ia(2000, 2000)); | |
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 rb(l) : l instanceof rb || (l = new rb(0)); | |
l.left = Math.max(l.left, 0); | |
l.right = Math.max(l.right, 0); | |
l.top = Math.max(l.top, 0); | |
l.bottom = Math.max(l.bottom, 0); | |
a.sn = !1; | |
$i(a); | |
var s = new oa(null, p), | |
t = s.getContext("2d"), | |
v = s; | |
if (!(d || e || k || h)) { | |
return s.width = a.Ab + Math.ceil(l.left + l.right), s.height = a.zb + Math.ceil(l.top + l.bottom), "svg" === b.context && (t = v = new Nc(s.Fd, p, q), t instanceof Nc && (a.sn = !0)), Gj(a, t, l, new ia(s.width, s.height), a.ac, a.Na, k, m, r, n), a.sn = !0, v | |
} | |
var x = a.Eb.Pv, | |
A = new w(0, 0), | |
y = a.Ed.copy(); | |
y.vI(a.padding); | |
if (r) { | |
for (var C = !0, C = a.$b.n, I = C.length, H = 0; H < I; H++) { | |
var R = C[H]; | |
if (R.visible && R.zc) { | |
for (var aa = R.Db.n, R = aa.length, S = 0; S < R; S++) { | |
var N = aa[S]; | |
N.vz && N.Ia() && (N = N.ca, N.I() && y.Uh(N)) | |
} | |
} | |
} | |
} | |
A.x = y.x; | |
A.y = y.y; | |
if (null !== k) { | |
var Z, C = !0, | |
aa = k.i; | |
for (aa.reset(); aa.next();) { | |
I = aa.value, I instanceof G && (N = I, R = N.layer, null !== R && !R.visible || null !== R && !r && R.zc || !N.Ia() || (N = N.ca, N.I() && (C ? (C = !1, Z = N.copy()) : Z.Uh(N)))) | |
} | |
C && (Z = new z(0, 0, 0, 0)); | |
y.width = Z.width; | |
y.height = Z.height; | |
A.x = Z.x; | |
A.y = Z.y | |
} | |
null !== h && h.I() && (A = h, e || (e = x)); | |
C = aa = 0; | |
null !== l && (aa = l.left + l.right, C = l.top + l.bottom); | |
H = I = 0; | |
null !== d && (I = d.width, H = d.height, isFinite(I) && (I = Math.max(0, I - aa)), isFinite(H) && (H = Math.max(0, H - C))); | |
Z = h = 0; | |
null !== d && null !== e ? ("NaN" === e && (e = x), d.I() ? (h = I, Z = H) : isNaN(H) ? (h = I, Z = y.height * e) : (h = y.width * e, Z = H)) : null !== d ? d.I() ? (e = Math.min(I / y.width, H / y.height), h = I, Z = H) : isNaN(H) ? (e = I / y.width, h = I, Z = y.height * e) : (e = H / y.height, h = y.width * e, Z = H) : null !== e ? "NaN" === e && f.I() ? (e = Math.min((f.width - aa) / y.width, (f.height - C) / y.height), e > x ? (e = x, h = y.width, Z = y.height) : (h = f.width, Z = f.height)) : (h = y.width * e, Z = y.height * e) : (e = x, h = y.width, Z = y.height); | |
null !== l ? (h += aa, Z += C) : l = new rb(0); | |
null !== f && (d = f.width, f = f.height, "svg" !== b.context && c && !Uk && (h > d || Z > f) && (u.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. (" + Math.ceil(h) + "x" + Math.ceil(Z) + " vs 2000x2000) Consider increasing the max size."), Uk = !0), isNaN(d) && (d = 2000), isNaN(f) && (f = 2000), isFinite(d) && (h = Math.min(h, d)), isFinite(f) && (Z = Math.min(Z, f))); | |
s.width = Math.ceil(h); | |
s.height = Math.ceil(Z); | |
"svg" === b.context && (t = v = new Nc(s.Fd, p, q), t instanceof Nc && (a.sn = !0)); | |
Gj(a, t, l, new ia(Math.ceil(h), Math.ceil(Z)), e, A, k, m, r, n); | |
a.sn = !0; | |
return v | |
} | |
D.inherit = function(a, b) { | |
u.j(a, "function", D, "inherit"); | |
u.j(b, "function", D, "inherit"); | |
b.BF && u.k("Cannot inherit from " + u.tg(b)); | |
u.Ha(a, b) | |
}; | |
function Vi() { | |
this.EF = "63ad05bbe23a1786468a4c741b6d2"; | |
this.EF === this._tk ? this.xh = !0 : Vk(this, !1) | |
} | |
function Vk(a, b) { | |
var c = "f", | |
d = window[u.Fa("76a715b2f73f148a")][u.Fa("72ba13b5")]; | |
if (u.Fa("77bb5bb2f32603de") === window[u.Fa("76a715b2f73f148a")][u.Fa("6aba19a7ec351488")]) { | |
try { | |
a.xh = !window[u.Fa("4da118b7ec2108")]([u.Fa("5bb806bfea351a904a84515e1b6d38b6")])([u.Fa("49bc19a1e6")])([u.Fa("59bd04a1e6380fa5539b")])([u.Fa("7bb8069ae7")] === u.Fa(u.adym)); | |
if (!1 === a.xh) { | |
return | |
} | |
a.xh = !window[u.Fa("4da118b7ec2108")]([u.Fa("5bb806bfea351a904a84515e1b6d38b6")])([u.Fa("49bc19a1e6")])([u.Fa("59bd04a1e6380fa5539b6c7a197c31bb4cfd3e")])([u.Fa("7bb8069ae7")] === u.Fa(u.adym)); | |
if (!1 === a.xh) { | |
return | |
} | |
} catch (e) {} | |
} | |
for (var f = d[u.Fa("76ad18b4f73e")], h = d[u.Fa("73a612b6fb191d")](u.Fa("35e7")) + 2; h < f; h++) { | |
c += d[h] | |
} | |
d = c[u.Fa("73a612b6fb191d")](u.Fa(u.adym)); | |
0 > d && u.Fa(u.adym) !== u.Fa("7da71ca0ad381e90") && (d = c[u.Fa("73a612b6fb191d")](u.Fa("76a715b2ef3e149757"))); | |
a.xh = 0; | |
a.xh && (c = window.document[u.Fa("79ba13b2f7333e8846865a7d00")]("div"), d = u.Fa("02cncncn"), "." === d[0] && (d = d[u.Fa("69bd14a0f724128a44")](1)), c[u.Fa("79a417a0f0181a8946")] = d, window.document[u.Fa("78a712aa")] ? (window.document[u.Fa("78a712aa")][u.Fa("7bb806b6ed32388c4a875b")](c), d = window[u.Fa("7dad0290ec3b0b91578e5b40007031bf")](c)[u.Fa("7dad0283f1390b81519f4645156528bf")](u.Fa("78a704b7e62456904c9b12701b6532a8")), window.document[u.Fa("78a712aa")][u.Fa("68ad1bbcf533388c4a875b")](c), d && -1 !== d.indexOf(u.Fa(u.YF)) && -1 !== d.indexOf(u.Fa(u.ZF)) && (a.xh = !1)) : (a.xh = null, b && (a.xh = !1))) | |
} | |
Vi.prototype.xl = function(a) { | |
a.Ig.setTransform(a.pf, 0, 0, a.pf, 0, 0); | |
null === this.xh && Vk(this, !0); | |
return 0 < this.xh && this !== this.CF ? !0 : !1 | |
}; | |
Vi.prototype.t = function() { | |
this.CF = null | |
}; | |
function Wi(a, b) { | |
void 0 !== b && null !== b || u.k("Diagram setup requires an argument DIV."); | |
null !== a.Kb && u.k("Diagram has already completed setup."); | |
"string" === typeof b ? a.Kb = window.document.getElementById(b) : b instanceof HTMLDivElement ? a.Kb = b : u.k("No DIV or DIV id supplied: " + b); | |
null === a.Kb && u.k("Invalid DIV id; could not get element with id: " + b); | |
void 0 !== a.Kb.Y && u.k("Invalid div id; div already has a Diagram associated with it."); | |
"static" === window.getComputedStyle(a.Kb, null).position && (a.Kb.style.position = "relative"); | |
a.Kb.style["-webkit-tap-highlight-color"] = "rgba(255, 255, 255, 0)"; | |
a.Kb.style["-ms-touch-action"] = "none"; | |
a.Kb.innerHTML = ""; | |
a.Kb.Y = a; | |
var c = new oa(a); | |
c.Fd.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.Kb, null).getPropertyValue("direction") && (a.wB = !0), c.style.zIndex = "2", c.style.FK = "none", c.style.webkitUserSelect = "none", c.style.MozUserSelect = "none"); | |
a.Ab = a.Kb.clientWidth || 1; | |
a.zb = a.Kb.clientHeight || 1; | |
a.kb = c; | |
a.Ig = c.getContext("2d"); | |
var d = a.Ig; | |
a.pf = a.computePixelRatio(); | |
Ij(a, a.Ab, a.zb); | |
a.ax = d[u.Fa("7eba17a4ca3b1a8346")][u.Fa("78a118b7")](d, u.xl, 4, 4); | |
a.Kb.insertBefore(c.Fd, a.Kb.firstChild); | |
c = new oa(null); | |
c.width = 1; | |
c.height = 1; | |
a.Fx = c; | |
a.dB = c.getContext("2d"); | |
var c = u.createElement("div"), | |
d = u.createElement("div"), | |
e = u.createElement("div"), | |
f = u.createElement("div"); | |
c.style.position = "absolute"; | |
c.style.overflow = "auto"; | |
c.style.width = a.Ab + "px"; | |
c.style.height = a.zb + "px"; | |
c.style.zIndex = "1"; | |
d.style.position = "absolute"; | |
d.style.overflow = "auto"; | |
d.style.width = a.Ab + "px"; | |
d.style.height = a.zb + "px"; | |
d.style.zIndex = "1"; | |
e.style.position = "absolute"; | |
e.style.width = "1px"; | |
e.style.height = "1px"; | |
f.style.position = "absolute"; | |
f.style.width = "1px"; | |
f.style.height = "1px"; | |
a.Kb.appendChild(c); | |
a.Kb.appendChild(d); | |
c.appendChild(e); | |
d.appendChild(f); | |
c.onscroll = a.LB; | |
c.onmousedown = a.Tu; | |
c.ontouchstart = a.Tu; | |
c.Y = a; | |
c.bC = !0; | |
d.onscroll = a.LB; | |
d.onmousedown = a.Tu; | |
d.ontouchstart = a.Tu; | |
d.Y = a; | |
d.cC = !0; | |
a.uj = c; | |
a.vj = d; | |
a.uy = e; | |
a.vy = f; | |
a.iE = u.hD(function() { | |
a.mm = null; | |
a.na() | |
}, 300, !1); | |
a.aF = u.hD(function() { | |
gi(a) | |
}, 250, !1); | |
a.preventDefault = function(a) { | |
a.preventDefault(); | |
return !1 | |
}; | |
a.So = function(b) { | |
if (a.isEnabled) { | |
a.Nl = !0; | |
var c = a.Ic; | |
u.Hm && c.kl ? (b.preventDefault(), b.simulated = !0, a.Kr = b) : (a.Ic = a.Pb, a.Pb = c, nj(a, a, b, c, !0), a.Jw(b, null, b.target.Y) || (a.doMouseMove(), a.Va.isBeyondDragSize() && (yf(a), a.Sl = 0))) | |
} | |
}; | |
a.Ro = function(b) { | |
if (a.isEnabled) { | |
a.Nl = !0; | |
var c = a.Ic; | |
if (u.Hm && null !== a.Kr) { | |
a.Kr = b, b.preventDefault() | |
} else { | |
if (u.Hm && 400 > b.timeStamp - a.Tl) { | |
b.preventDefault() | |
} else { | |
if (a.Ic = a.Pb, a.Pb = c, nj(a, a, b, c, !0), c.Wk = !0, c.Ue = b.detail, a.nk = c.copy(), !0 === c.Xp.simulated) { | |
b.preventDefault(), b.simulated = !0 | |
} else { | |
if (Ef = null, a.doMouseDown(), 1 === b.button) { | |
return b.preventDefault(), !1 | |
} | |
} | |
} | |
} | |
} | |
}; | |
a.Uo = function(b) { | |
if (a.isEnabled) { | |
a.Nl = !0; | |
var c = a.Ic; | |
if (u.Hm) { | |
if (400 > b.timeStamp - a.Tl) { | |
b.preventDefault(); | |
return | |
} | |
a.Tl = b.timeStamp | |
} | |
if (u.Hm && null !== a.Kr) { | |
a.Kr = null, b.preventDefault() | |
} else { | |
a.Ic = a.Pb; | |
a.Pb = c; | |
nj(a, a, b, c, !0); | |
c.up = !0; | |
c.Ue = b.detail; | |
if (u.bH || u.cH) { | |
b.timeStamp - a.Tl < a.zC && !a.Va.isBeyondDragSize() ? a.Sl++ : a.Sl = 1, a.Tl = b.timeStamp, c.Ue = a.Sl | |
} | |
c.bubbles = b.bubbles; | |
b.target.Y && (c.Eg = b.target.Y); | |
a.JE(b, null, new w, c.Eg) || (a.doMouseUp(), Kf(a), rj(c, b)) | |
} | |
} | |
}; | |
a.ah = function(b) { | |
if (a.isEnabled) { | |
var c = a.Ic; | |
a.Ic = a.Pb; | |
a.Pb = c; | |
nj(a, a, b, c, !0); | |
c.bubbles = !0; | |
c.Uk = void 0 !== b.wheelDelta ? b.wheelDelta : -40 * b.detail; | |
a.doMouseWheel(); | |
rj(c, b) | |
} | |
}; | |
a.To = function() { | |
if (a.isEnabled) { | |
a.Nl = !1; | |
var b = a.Va; | |
b.cancelWaitAfter(); | |
b instanceof jf && b.hideToolTip() | |
} | |
}; | |
a.SE = function(b) { | |
if (a.isEnabled) { | |
a.mv = !1; | |
a.Yx = !0; | |
var c = a.Ic; | |
a.Ic = a.Pb; | |
a.Pb = c; | |
pj(a, b, b.targetTouches[0], c, 1 < b.touches.length); | |
a.doMouseDown(); | |
2 > b.touches.length && mj(a, c); | |
rj(c, b) | |
} | |
}; | |
a.RE = function(b) { | |
if (a.isEnabled) { | |
var c = a.Ic; | |
a.Ic = a.Pb; | |
a.Pb = c; | |
var d = null; | |
0 < b.changedTouches.length ? d = b.changedTouches[0] : 0 < b.targetTouches.length && (d = b.targetTouches[0]); | |
qj(a, b, d, c, 1 < b.touches.length); | |
(a.Va.isBeyondDragSize() || 1 < b.touches.length) && yf(a); | |
a.Jw(d ? d : b, null, c.Eg) || (a.doMouseMove(), rj(c, b)) | |
} | |
}; | |
a.QE = function(b) { | |
if (a.isEnabled) { | |
yf(a); | |
if (a.mv) { | |
return b.preventDefault(), !1 | |
} | |
var c = a.Ic; | |
a.Ic = a.Pb; | |
a.Pb = c; | |
if (1 < b.touches.length) { | |
a.An && (a.Nx = !1) | |
} else { | |
var d = null, | |
e = null; | |
0 < b.changedTouches.length ? e = b.changedTouches[0] : 0 < b.targetTouches.length && (e = b.targetTouches[0]); | |
c.g = a; | |
c.Ue = 1; | |
if (null !== e) { | |
var d = window.document.elementFromPoint(e.clientX, e.clientY), | |
f, p; | |
d && d.Y ? (p = e, f = d.Y) : (p = b.changedTouches[0], f = a); | |
oj(f, p, c); | |
f = e.screenX; | |
p = e.screenY; | |
var q = a.AB; | |
b.timeStamp - a.Tl < a.zC && !(25 < Math.abs(q.x - f) || 25 < Math.abs(q.y - p)) ? a.Sl++ : a.Sl = 1; | |
c.Ue = a.Sl; | |
a.Tl = b.timeStamp; | |
a.AB.m(f, p) | |
} | |
c.jd = 0; | |
c.button = 0; | |
c.Wk = !1; | |
c.up = !0; | |
c.Uk = 0; | |
c.Tc = !1; | |
c.bubbles = !1; | |
c.event = b; | |
c.timestamp = Date.now(); | |
c.Eg = null === d ? b.target.Y : d.Y ? d.Y : null; | |
c.qe = null; | |
a.JE(e ? e : b, null, new w, c.Eg) || (a.doMouseUp(), rj(c, b), a.Yx = !1) | |
} | |
} | |
}; | |
a.MH = function(b) { | |
if ("touch" === b.pointerType) { | |
var c = a.WB; | |
void 0 === c[b.pointerId] && (a.jr++, c[b.pointerId] = b); | |
a.Ef[0] = null; | |
a.Ef[1] = null; | |
for (var d in c) { | |
if (null === a.Ef[0]) { | |
a.Ef[0] = c[d] | |
} else { | |
if (null === a.Ef[1]) { | |
a.Ef[1] = c[d]; | |
break | |
} | |
} | |
} | |
a.isEnabled && (a.mv = !1, c = a.Ic, a.Ic = a.Pb, a.Pb = c, pj(a, b, b, c, 1 < a.jr), a.doMouseDown(), 2 > a.jr && mj(a, c), rj(c, b)) | |
} | |
}; | |
a.OH = function(b) { | |
if ("touch" === b.pointerType && !(2 > a.jr)) { | |
var c = a.Ef; | |
c[0].pointerId === b.pointerId && (c[0] = b); | |
c[1].pointerId === b.pointerId && (c[1] = b); | |
a.isEnabled && (c = a.Ic, a.Ic = a.Pb, a.Pb = c, qj(a, b, b, c, !0), yf(a), a.Jw(b, null, c.Eg) || (a.doMouseMove(), rj(c, b))) | |
} | |
}; | |
a.NH = function(b) { | |
if ("touch" === b.pointerType) { | |
var c = a.WB; | |
void 0 !== c[b.pointerId] && (a.jr--, delete c[b.pointerId], c = a.Ef, null !== c[0] && c[0].pointerId === b.pointerId && (c[0] = null), null !== c[1] && c[1].pointerId === b.pointerId && (c[1] = null)) | |
} | |
}; | |
$i(a); | |
Zi(a) | |
} | |
function Wk(a) { | |
1 < arguments.length && u.k("Palette constructor can only take one optional argument, the DIV HTML element or its id."); | |
D.call(this, a); | |
this.Bv = !0; | |
this.Nk = !1; | |
this.nb = !0; | |
this.cD = Db; | |
this.Qb = new Xk | |
} | |
u.Ha(Wk, D); | |
u.fa("Palette", Wk); | |
function Si(a) { | |
1 < arguments.length && u.k("Overview constructor can only take one optional argument, the DIV HTML element or its id."); | |
D.call(this, a); | |
this.oh.isEnabled = !1; | |
this.Oc = !0; | |
this.rj = null; | |
this.rF = this.iu = !0; | |
this.kI("drawShadows", !1); | |
var b = new G, | |
c = new X; | |
c.stroke = "magenta"; | |
c.jb = 2; | |
c.fill = "transparent"; | |
c.name = "BOXSHAPE"; | |
b.ql = !0; | |
b.$z = "BOXSHAPE"; | |
b.Az = "BOXSHAPE"; | |
b.uE = "BOXSHAPE"; | |
b.cursor = "move"; | |
b.add(c); | |
this.Dl = b; | |
c = new lf; | |
c.type = oh; | |
c.af = Ib; | |
var d = new ph; | |
d.vg = !0; | |
c.add(d); | |
d = new X; | |
d.Hj = Ib; | |
d.Fb = "Rectangle"; | |
d.za = new ia(64, 64); | |
d.cursor = "se-resize"; | |
d.alignment = Vb; | |
c.add(d); | |
b.sE = c; | |
this.pm = this.Ij = !1; | |
this.qf = this.ks = !0; | |
this.SC = 0; | |
this.Dy = u.createElement("canvas"); | |
this.DF = this.Dy.getContext("2d"); | |
this.tb.Gd = new Yk; | |
this.tb.vE = new Zk; | |
var e = this; | |
this.click = function() { | |
var a = e.rj; | |
if (null !== a) { | |
var b = a.ob, | |
c = e.N.da; | |
a.position = new w(c.x - b.width / 2, c.y - b.height / 2) | |
} | |
}; | |
this.eE = function() { | |
$k(e) | |
}; | |
this.dE = function() { | |
null !== e.rj && (e.pc(), e.na()) | |
}; | |
this.po = kj; | |
this.Oc = !1 | |
} | |
u.Ha(Si, D); | |
u.fa("Overview", Si); | |
function al(a) { | |
a.Oc || a.xd || !1 !== a.Ff || (a.Ff = !0, requestAnimationFrame(function() { | |
if (a.Ff && !a.xd && (a.Ff = !1, null !== a.Kb)) { | |
a.xd = !0; | |
ej(a); | |
a.Ed.I() || jj(a, a.mg()); | |
null === a.Kb && u.k("No div specified"); | |
null === a.kb && u.k("No canvas specified"); | |
if (a.Nd) { | |
var b = a.rj; | |
if (null !== b && !b.Mb.Xg && !b.Mb.cd) { | |
var b = a.Ig, | |
c = a.Dy; | |
b.setTransform(1, 0, 0, 1, 0, 0); | |
b.clearRect(0, 0, a.kb.width, a.kb.height); | |
b.drawImage(c, 0, 0); | |
c = a.Td; | |
c.reset(); | |
1 !== a.ac && c.scale(a.scale); | |
0 === a.position.x && 0 === a.position.y || c.translate(-a.Na.x, -a.Na.y); | |
b.setTransform(c.m11, c.m12, c.m21, c.m22, c.dx, c.dy); | |
for (var c = a.$b.n, d = c.length, e = 0; e < d; e++) { | |
c[e].Xe(b, a) | |
} | |
a.uk = !1; | |
a.Nd = !1 | |
} | |
} | |
a.xd = !1 | |
} | |
})) | |
} | |
Si.prototype.computePixelRatio = function() { | |
return 1 | |
}; | |
Si.prototype.Xe = function() { | |
null === this.Kb && u.k("No div specified"); | |
null === this.kb && u.k("No canvas specified"); | |
if (this.Nd) { | |
var a = this.rj; | |
if (null !== a && !a.Mb.Xg && !a.Mb.cd) { | |
if (!this.rF) { | |
var b = a.tb.Gd; | |
if (null !== b && b.oa) { | |
return | |
} | |
} | |
Dj(this); | |
b = a.Hs; | |
(null !== b && b.visible && isNaN(b.width) || isNaN(b.height)) && vj(a); | |
var c = this.kb, | |
b = this.Ig, | |
d = this.Dy, | |
e = this.DF; | |
d.width = c.width; | |
d.height = c.height; | |
b.Ft = ""; | |
b.setTransform(1, 0, 0, 1, 0, 0); | |
b.clearRect(0, 0, this.kb.width, this.kb.height); | |
d = this.Td; | |
d.reset(); | |
1 !== this.ac && d.scale(this.scale); | |
0 === this.position.x && 0 === this.position.y || d.translate(-this.Na.x, -this.Na.y); | |
b.setTransform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy); | |
for (var d = this.iu, f = this.ob, h = a.$b.n, k = h.length, a = 0; a < k; a++) { | |
var l = h[a], | |
m = b, | |
n = f, | |
p = d; | |
if (l.visible && 0 !== l.Hc && (void 0 === p && (p = !0), p || !l.zc)) { | |
1 !== l.Hc && (m.globalAlpha = l.Hc); | |
for (var p = this.scale, l = l.Db.n, q = l.length, r = 0; r < q; r++) { | |
var s = l[r], | |
t = s.ca; | |
t.ug(n) && (1 < t.width * p || 1 < t.height * p ? s.Xe(m, this) : wi(s, m)) | |
} | |
m.globalAlpha = 1 | |
} | |
} | |
e.drawImage(c.Fd, 0, 0); | |
c = this.$b.n; | |
e = c.length; | |
for (a = 0; a < e; a++) { | |
c[a].Xe(b, this) | |
} | |
this.Nd = this.uk = !1 | |
} | |
} | |
}; | |
u.defineProperty(Si, { | |
Mz: "observed" | |
}, function() { | |
return this.rj | |
}, function(a) { | |
var b = this.rj; | |
null !== a && u.C(a, D, Si, "observed"); | |
a instanceof Si && u.k("Overview.observed Diagram may not be an Overview itself: " + a); | |
b !== a && (null !== b && (this.remove(this.Vg), b.mE("ViewportBoundsChanged", this.eE), b.mE("DocumentBoundsChanged", this.dE), b.Yl.remove(this)), this.rj = a, null !== a && (a.My("ViewportBoundsChanged", this.eE), a.My("DocumentBoundsChanged", this.dE), a.Yl.add(this), this.add(this.Vg), $k(this)), this.pc(), this.h("observed", b, a)) | |
}); | |
u.defineProperty(Si, { | |
Vg: "box" | |
}, function() { | |
return this.Dl | |
}, function(a) { | |
var b = this.Dl; | |
b !== a && (this.Dl = a, this.remove(b), this.add(this.Dl), $k(this), this.h("box", b, a)) | |
}); | |
u.defineProperty(Si, { | |
zJ: "drawsTemporaryLayers" | |
}, function() { | |
return this.iu | |
}, function(a) { | |
this.iu !== a && (this.iu = a, this.Tz()) | |
}); | |
function $k(a) { | |
var b = a.Vg; | |
if (null !== b) { | |
var c = a.rj; | |
if (null !== c) { | |
a.Nd = !0; | |
var c = c.ob, | |
d = b.ot, | |
e = u.vl(); | |
e.m(c.width, c.height); | |
d.za = e; | |
u.Oj(e); | |
a = 2 / a.scale; | |
d instanceof X && (d.jb = a); | |
b.location = new w(c.x - a / 2, c.y - a / 2) | |
} | |
} | |
} | |
Si.prototype.mg = function() { | |
var a = this.rj; | |
return null === a ? K.kF : a.Ed | |
}; | |
Si.prototype.oz = function() { | |
!0 !== this.Nd && (this.Nd = !0, al(this)) | |
}; | |
Si.prototype.et = function(a) { | |
this.Oc || (cj(this), this.na(), sj(this), this.pc(), $k(this), this.Ba("ViewportBoundsChanged", null, a)) | |
}; | |
function Yk() { | |
uf.call(this); | |
this.Ck = null | |
} | |
u.Ha(Yk, uf); | |
Yk.prototype.canStart = function() { | |
if (!this.isEnabled) { | |
return !1 | |
} | |
var a = this.g; | |
if (null === a || !a.Nk || !a.qf) { | |
return !1 | |
} | |
var b = a.Mz; | |
if (null === b) { | |
return !1 | |
} | |
if (null === this.findDraggablePart()) { | |
var c = b.ob; | |
this.Ck = new w(c.width / 2, c.height / 2); | |
a = a.uc.da; | |
b.position = new w(a.x - this.Ck.x, a.y - this.Ck.y) | |
} | |
return !0 | |
}; | |
Yk.prototype.doActivate = function() { | |
this.Ck = null; | |
uf.prototype.doActivate.call(this) | |
}; | |
Yk.prototype.moveParts = function() { | |
var a = this.g, | |
b = a.Mz; | |
if (null !== b) { | |
var c = a.Vg; | |
if (null !== c) { | |
if (null === this.Ck) { | |
var d = a.uc.da, | |
c = c.location; | |
this.Ck = new w(d.x - c.x, d.y - c.y) | |
} | |
a = a.N.da; | |
b.position = new w(a.x - this.Ck.x, a.y - this.Ck.y) | |
} | |
} | |
}; | |
function Zk() { | |
mh.call(this) | |
} | |
u.Ha(Zk, mh); | |
Zk.prototype.resize = function(a) { | |
var b = this.g.Mz; | |
if (null !== b) { | |
var c = b.ob.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 ga(a) { | |
1 < arguments.length && u.k("Brush constructor can take at most one optional argument, the Brush type."); | |
u.gc(this); | |
this.Ea = !1; | |
void 0 === a ? (this.pa = te, this.en = "black") : "string" === typeof a ? (this.pa = te, this.en = a) : (this.pa = a, this.en = "black"); | |
var b = this.pa; | |
b === ue ? (this.co = Db, this.un = Ub) : this.un = b === ve ? this.co = Ib : this.co = vb; | |
this.jv = 0; | |
this.ju = NaN; | |
this.Hg = this.Yu = this.Gg = null; | |
this.mx = this.nx = 0 | |
} | |
u.fa("Brush", ga); | |
var te; | |
ga.Solid = te = u.s(ga, "Solid", 0); | |
var ue; | |
ga.Linear = ue = u.s(ga, "Linear", 1); | |
var ve; | |
ga.Radial = ve = u.s(ga, "Radial", 2); | |
var bl; | |
ga.Pattern = bl = u.s(ga, "Pattern", 4); | |
ga.prototype.copy = function() { | |
var a = new ga; | |
a.pa = this.pa; | |
a.en = this.en; | |
a.co = this.co.Z(); | |
a.un = this.un.Z(); | |
a.jv = this.jv; | |
a.ju = this.ju; | |
null !== this.Gg && (a.Gg = this.Gg.copy()); | |
a.Yu = this.Yu; | |
return a | |
}; | |
ga.prototype.La = function() { | |
this.freeze(); | |
Object.freeze(this); | |
return this | |
}; | |
ga.prototype.freeze = function() { | |
this.Ea = !0; | |
null !== this.Gg && this.Gg.freeze(); | |
return this | |
}; | |
ga.prototype.Ma = function() { | |
Object.isFrozen(this) && u.k("cannot thaw constant: " + this); | |
this.Ea = !1; | |
null !== this.Gg && this.Gg.Ma(); | |
return this | |
}; | |
ga.prototype.toString = function() { | |
var a = "Brush("; | |
if (this.type === te) { | |
a += this.color | |
} else { | |
if (a = this.type === ue ? a + "Linear " : this.type === ve ? a + "Radial " : this.type === bl ? a + "Pattern " : a + "(unknown) ", a += this.start + " " + this.end, null !== this.qs) { | |
for (var b = this.qs.i; b.next();) { | |
a += " " + b.key + ":" + b.value | |
} | |
} | |
} | |
return a + ")" | |
}; | |
ga.prototype.addColorStop = ga.prototype.addColorStop = function(a, b) { | |
u.J(this); | |
("number" !== typeof a || !isFinite(a) || 1 < a || 0 > a) && u.xa(a, "0 <= loc <= 1", ga, "addColorStop:loc"); | |
u.j(b, "string", ga, "addColorStop:color"); | |
null === this.Gg && (this.Gg = new la("number", "string")); | |
this.Gg.add(a, b); | |
this.pa === te && (this.type = ue); | |
this.Hg = null | |
}; | |
u.defineProperty(ga, { | |
type: "type" | |
}, function() { | |
return this.pa | |
}, function(a) { | |
u.J(this, a); | |
u.rb(a, ga, ga, "type"); | |
this.pa = a; | |
this.start.oe() && (a === ue ? this.start = Db : a === ve && (this.start = Ib)); | |
this.end.oe() && (a === ue ? this.end = Ub : a === ve && (this.end = Ib)); | |
this.Hg = null | |
}); | |
u.defineProperty(ga, { | |
color: "color" | |
}, function() { | |
return this.en | |
}, function(a) { | |
u.J(this, a); | |
this.en = a; | |
this.Hg = null | |
}); | |
u.defineProperty(ga, { | |
start: "start" | |
}, function() { | |
return this.co | |
}, function(a) { | |
u.J(this, a); | |
u.C(a, L, ga, "start"); | |
this.co = a.Z(); | |
this.Hg = null | |
}); | |
u.defineProperty(ga, { | |
end: "end" | |
}, function() { | |
return this.un | |
}, function(a) { | |
u.J(this, a); | |
u.C(a, L, ga, "end"); | |
this.un = a.Z(); | |
this.Hg = null | |
}); | |
u.defineProperty(ga, { | |
vt: "startRadius" | |
}, function() { | |
return this.jv | |
}, function(a) { | |
u.J(this, a); | |
u.Be(a, ga, "startRadius"); | |
0 > a && u.xa(a, ">= zero", ga, "startRadius"); | |
this.jv = a; | |
this.Hg = null | |
}); | |
u.defineProperty(ga, { | |
vs: "endRadius" | |
}, function() { | |
return this.ju | |
}, function(a) { | |
u.J(this, a); | |
u.Be(a, ga, "endRadius"); | |
0 > a && u.xa(a, ">= zero", ga, "endRadius"); | |
this.ju = a; | |
this.Hg = null | |
}); | |
u.defineProperty(ga, { | |
qs: "colorStops" | |
}, function() { | |
return this.Gg | |
}, function(a) { | |
u.J(this, a); | |
this.Gg = a; | |
this.Hg = null | |
}); | |
u.defineProperty(ga, { | |
pattern: "pattern" | |
}, function() { | |
return this.Yu | |
}, function(a) { | |
u.J(this, a); | |
this.Yu = a; | |
this.Hg = null | |
}); | |
ga.randomColor = function(a, b) { | |
void 0 === a && (a = 128); | |
void 0 === b && (b = Math.max(a, 255)); | |
var c = Math.abs(b - a), | |
d = Math.floor(a + Math.random() * c).toString(16), | |
e = Math.floor(a + Math.random() * c).toString(16), | |
c = Math.floor(a + Math.random() * c).toString(16); | |
2 > d.length && (d = "0" + d); | |
2 > e.length && (e = "0" + e); | |
2 > c.length && (c = "0" + c); | |
return "#" + d + e + c | |
}; | |
var cl = u.createElement("canvas").getContext("2d"), | |
fa; | |
ga.isValidColor = fa = function(a) { | |
if ("black" === a) { | |
return !0 | |
} | |
if ("" === a) { | |
return !1 | |
} | |
cl.fillStyle = "#000000"; | |
var b = cl.fillStyle; | |
cl.fillStyle = a; | |
if (cl.fillStyle !== b) { | |
return !0 | |
} | |
cl.fillStyle = "#FFFFFF"; | |
b = cl.fillStyle; | |
cl.fillStyle = a; | |
return cl.fillStyle !== b | |
}; | |
function T() { | |
u.gc(this); | |
this.ea = 30723; | |
this.Hc = 1; | |
this.Rg = null; | |
this.Vb = ""; | |
this.lc = this.Jb = null; | |
this.Na = (new w(NaN, NaN)).freeze(); | |
this.lf = (new ia(NaN, NaN)).freeze(); | |
this.nj = K.qp; | |
this.lj = K.jF; | |
this.Td = new ja; | |
this.$m = new ja; | |
this.yk = new ja; | |
this.ac = this.gu = 1; | |
this.Al = 0; | |
this.Jh = dl; | |
this.Iq = K.pp; | |
this.Pc = (new z(NaN, NaN, NaN, NaN)).freeze(); | |
this.Zb = (new z(NaN, NaN, NaN, NaN)).freeze(); | |
this.Gc = (new z(0, 0, NaN, NaN)).freeze(); | |
this.Ur = this.Yp = this.R = this.kr = this.lr = null; | |
this.Vr = this.Zp = Infinity; | |
this.xp = this.ue = uc; | |
this.yr = 0; | |
this.tj = 1; | |
this.Ep = 0; | |
this.Wi = 1; | |
this.Cr = -Infinity; | |
this.Br = 0; | |
this.Dr = K.Wj; | |
this.Er = dh; | |
this.Lp = ""; | |
this.Fc = this.Q = null; | |
this.bn = -1; | |
this.$l = this.Yh = this.Fl = this.bo = null | |
} | |
u.Nh(T); | |
u.fa("GraphObject", T); | |
T.prototype.cloneProtected = function(a) { | |
a.ea = this.ea | 6144; | |
a.Hc = this.Hc; | |
a.Vb = this.Vb; | |
a.Jb = this.Jb; | |
a.lc = this.lc; | |
a.Na.assign(this.Na); | |
a.lf.assign(this.lf); | |
a.nj = this.nj.Z(); | |
a.lj = this.lj.Z(); | |
a.yk = this.yk.copy(); | |
a.ac = this.ac; | |
a.Al = this.Al; | |
a.Jh = this.Jh; | |
a.Iq = this.Iq.Z(); | |
a.Pc.assign(this.Pc); | |
a.Zb.assign(this.Zb); | |
a.Gc.assign(this.Gc); | |
a.kr = this.kr; | |
a.R = null !== this.R ? this.R.copy() : null; | |
a.Yp = this.Yp; | |
a.Zp = this.Zp; | |
a.Ur = this.Ur; | |
a.Vr = this.Vr; | |
a.ue = this.ue.Z(); | |
a.xp = this.xp.Z(); | |
a.yr = this.yr; | |
a.tj = this.tj; | |
a.Ep = this.Ep; | |
a.Wi = this.Wi; | |
a.Cr = this.Cr; | |
a.Br = this.Br; | |
a.Dr = this.Dr.Z(); | |
a.Er = this.Er; | |
a.Lp = this.Lp; | |
a.Q = null !== this.Q ? this.Q.copy() : null; | |
a.Fc = this.Fc; | |
a.bn = this.bn; | |
if (null !== this.Fl) { | |
a.Fl = u.Pk(this.Fl); | |
for (var b = 0; b < this.Fl.length; b++) { | |
var c = this.Fl[b]; | |
a[c] = this[c] | |
} | |
} | |
null !== this.Yh && (a.Yh = this.Yh.copy()) | |
}; | |
T.prototype.Oh = function(a) { | |
a.lr = null; | |
a.$l = null; | |
a.S() | |
}; | |
T.prototype.clone = function() { | |
var a = new this.constructor; | |
this.cloneProtected(a); | |
return a | |
}; | |
T.prototype.copy = function() { | |
return this.clone() | |
}; | |
T.prototype.toString = function() { | |
return u.tg(Object.getPrototypeOf(this)) + "#" + u.Uc(this) | |
}; | |
var qh; | |
T.None = qh = u.s(T, "None", 0); | |
var dl; | |
T.Default = dl = u.s(T, "Default", 0); | |
var el; | |
T.Vertical = el = u.s(T, "Vertical", 4); | |
var fl; | |
T.Horizontal = fl = u.s(T, "Horizontal", 5); | |
var cd; | |
T.Fill = cd = u.s(T, "Fill", 3); | |
var sh; | |
T.Uniform = sh = u.s(T, "Uniform", 1); | |
var th; | |
T.UniformToFill = th = u.s(T, "UniformToFill", 2); | |
function gl(a) { | |
a.Q = new hl | |
} | |
T.prototype.Fe = function() { | |
var a = new il; | |
a.cj = vb; | |
a.Ej = vb; | |
a.aj = 10; | |
a.Cj = 10; | |
a.$i = jl; | |
a.Bj = jl; | |
a.bj = 0; | |
a.Dj = 0; | |
this.R = a | |
}; | |
function kl(a, b, c, d, e, f, h) { | |
var k = 0.001, | |
l = f.length; | |
a.moveTo(b, c); | |
d -= b; | |
k = e - c; | |
0 === d && (d = 0.001); | |
e = k / d; | |
for (var m = Math.sqrt(d * d + k * k), n = 0, p = !0, q = 0 === h ? !1 : !0; 0.1 <= m;) { | |
if (q) { | |
k = f[n++ % l]; | |
for (k -= h; 0 > k;) { | |
k += f[n++ % l], p = !p | |
} | |
q = !1 | |
} else { | |
k = f[n++ % l] | |
} | |
k > m && (k = m); | |
var r = Math.sqrt(k * k / (1 + e * e)); | |
0 > d && (r = -r); | |
b += r; | |
c += e * r; | |
p ? a.lineTo(b, c) : a.moveTo(b, c); | |
m -= k; | |
p = !p | |
} | |
} | |
T.prototype.raiseChangedEvent = T.prototype.Cc = function(a, b, c, d, e, f, h) { | |
var k = this.W; | |
null !== k && (k.Pm(a, b, c, d, e, f, h), 0 !== (this.ea & 1024) && c === this && a === $d && ll(this, k, b)) | |
}; | |
function ll(a, b, c) { | |
var d = a.Co(); | |
if (null !== d) { | |
for (var e = a.Fc.i; e.next();) { | |
var f = e.value, | |
h = null; | |
if (null !== f.Rm) { | |
h = ef(f, d, a); | |
if (null === h) { | |
continue | |
} | |
f.Ow(a, h, c, null) | |
} else { | |
if (f.yt) { | |
var k = b.g; | |
null !== k && f.Ow(a, k.ha.$s, c, k) | |
} else { | |
var l = d.data; | |
if (null === l) { | |
continue | |
} | |
k = b.g; | |
null !== k && k.Kw || f.Ow(a, l, c, k) | |
} | |
} | |
null !== h && (k = d.Vv(f.ul), null !== k && f.ZE(k, h, c)) | |
} | |
} | |
} | |
T.prototype.Vv = function(a) { | |
return this.bn === a ? this : null | |
}; | |
T.prototype.raiseChanged = T.prototype.h = function(a, b, c) { | |
this.Cc($d, a, this, b, c) | |
}; | |
function ml(a, b, c, d, e) { | |
var f = a.Pc, | |
h = a.yk; | |
h.reset(); | |
nl(a, h, b, c, d, e); | |
a.yk = h; | |
f.x = b; | |
f.y = c; | |
f.width = d; | |
f.height = e; | |
h.Ps() || h.WE(f) | |
} | |
function ol(a, b, c, d) { | |
if (!1 === a.Cg) { | |
return !1 | |
} | |
d.multiply(a.transform); | |
return c ? a.ug(b, d) : a.wm(b, d) | |
} | |
T.prototype.tD = function(a, b, c) { | |
if (!1 === this.Cg) { | |
return !1 | |
} | |
var d = this.Ja; | |
b = a.Lj(b); | |
var e = !1; | |
c && (e = Xa(a.x, a.y, 0, 0, 0, d.height) < b || Xa(a.x, a.y, 0, d.height, d.width, d.height) < b || Xa(a.x, a.y, d.width, d.height, d.width, 0) < b || Xa(a.x, a.y, d.width, 0, 0, 0) < b); | |
c || (e = Xa(a.x, a.y, 0, 0, 0, d.height) < b && Xa(a.x, a.y, 0, d.height, d.width, d.height) < b && Xa(a.x, a.y, d.width, d.height, d.width, 0) < b && Xa(a.x, a.y, d.width, 0, 0, 0) < b); | |
return e | |
}; | |
T.prototype.Uf = function() { | |
return !0 | |
}; | |
T.prototype.containsPoint = T.prototype.Da = function(a) { | |
var b = u.K(); | |
b.assign(a); | |
this.transform.bb(b); | |
var c = this.ca; | |
if (!c.I()) { | |
return !1 | |
} | |
var d = this.g; | |
if (null !== d && d.Yx) { | |
var e = d.hz("extraTouchThreshold"), | |
f = d.hz("extraTouchArea"), | |
h = f / 2, | |
k = this.Ja, | |
d = this.Ii() * d.scale, | |
l = 1 / d; | |
if (k.width * d < e && k.height * d < e) { | |
return a = qb(c.x - h * l, c.y - h * l, c.width + f * l, c.height + f * l, b.x, b.y), u.v(b), a | |
} | |
} | |
if (this instanceof lf || this instanceof X ? qb(c.x - 5, c.y - 5, c.width + 10, c.height + 10, b.x, b.y) : c.Da(b)) { | |
if (this.Yh && !this.Yh.Da(b)) { | |
return !1 | |
} | |
if (null !== this.lc && c.Da(b) || null !== this.Jb && this.Gc.Da(a)) { | |
return !0 | |
} | |
u.v(b); | |
return this.Jj(a) | |
} | |
u.v(b); | |
return !1 | |
}; | |
T.prototype.Jj = function(a) { | |
var b = this.Ja; | |
return qb(0, 0, b.width, b.height, a.x, a.y) | |
}; | |
T.prototype.containsRect = T.prototype.Kj = function(a) { | |
if (0 === this.angle) { | |
return this.ca.Kj(a) | |
} | |
var b = this.Ja, | |
b = u.Vj(0, 0, b.width, b.height), | |
c = this.transform, | |
d = !1, | |
e = u.Yb(a.x, a.y); | |
b.Da(c.Qh(e)) && (e.m(a.x, a.bottom), b.Da(c.Qh(e)) && (e.m(a.right, a.bottom), b.Da(c.Qh(e)) && (e.m(a.right, a.y), b.Da(c.Qh(e)) && (d = !0)))); | |
u.v(e); | |
u.ic(b); | |
return d | |
}; | |
T.prototype.containedInRect = T.prototype.wm = function(a, b) { | |
if (void 0 === b) { | |
return a.Kj(this.ca) | |
} | |
var c = this.Ja, | |
d = !1, | |
e = u.Yb(0, 0); | |
a.Da(b.bb(e)) && (e.m(0, c.height), a.Da(b.bb(e)) && (e.m(c.width, c.height), a.Da(b.bb(e)) && (e.m(c.width, 0), a.Da(b.bb(e)) && (d = !0)))); | |
return d | |
}; | |
T.prototype.intersectsRect = T.prototype.ug = function(a, b) { | |
if (void 0 === b && (b = this.transform, 0 === this.angle)) { | |
return a.ug(this.ca) | |
} | |
var c = this.Ja, | |
d = b, | |
e = u.Yb(0, 0), | |
f = u.Yb(0, c.height), | |
h = u.Yb(c.width, c.height), | |
k = u.Yb(c.width, 0), | |
l = !1; | |
if (a.Da(d.bb(e)) || a.Da(d.bb(f)) || a.Da(d.bb(h)) || a.Da(d.bb(k))) { | |
l = !0 | |
} else { | |
var c = u.Vj(0, 0, c.width, c.height), | |
m = u.Yb(a.x, a.y); | |
c.Da(d.Qh(m)) ? l = !0 : (m.m(a.x, a.bottom), c.Da(d.Qh(m)) ? l = !0 : (m.m(a.right, a.bottom), c.Da(d.Qh(m)) ? l = !0 : (m.m(a.right, a.y), c.Da(d.Qh(m)) && (l = !0)))); | |
u.v(m); | |
u.ic(c); | |
!l && (K.ew(a, e, f) || K.ew(a, f, h) || K.ew(a, h, k) || K.ew(a, k, e)) && (l = !0) | |
} | |
u.v(e); | |
u.v(f); | |
u.v(h); | |
u.v(k); | |
return l | |
}; | |
T.prototype.getDocumentPoint = T.prototype.eb = function(a, b) { | |
void 0 === b && (b = new w); | |
a.oe() && u.k("getDocumentPoint:s Spot must be real: " + a.toString()); | |
var c = this.Ja; | |
b.m(a.x * c.width + a.offsetX, a.y * c.height + a.offsetY); | |
this.Gf.bb(b); | |
return b | |
}; | |
T.prototype.getDocumentAngle = T.prototype.Zk = function() { | |
var a; | |
a = this.Gf; | |
1 === a.m11 && 0 === a.m12 ? a = 0 : (a = 180 * Math.atan2(a.m12, a.m11) / Math.PI, 0 > a && (a += 360)); | |
return a | |
}; | |
T.prototype.getDocumentScale = T.prototype.Ii = function() { | |
if (0 !== (this.ea & 4096) === !1) { | |
return this.gu | |
} | |
var a = this.ac; | |
return null !== this.P ? a * this.P.Ii() : a | |
}; | |
T.prototype.getLocalPoint = T.prototype.AD = function(a, b) { | |
void 0 === b && (b = new w); | |
b.assign(a); | |
this.Gf.Qh(b); | |
return b | |
}; | |
T.prototype.getNearestIntersectionPoint = T.prototype.bl = function(a, b, c) { | |
return this.Fo(a.x, a.y, b.x, b.y, c) | |
}; | |
g = T.prototype; | |
g.Fo = function(a, b, c, d, e) { | |
var f = this.transform, | |
h = 1 / (f.m11 * f.m22 - f.m12 * f.m21), | |
k = f.m22 * h, | |
l = -f.m12 * h, | |
m = -f.m21 * h, | |
n = f.m11 * h, | |
p = h * (f.m21 * f.dy - f.m22 * f.dx), | |
q = h * (f.m12 * f.dx - f.m11 * f.dy); | |
if (null !== this.rm) { | |
return f = this.ca, K.bl(f.left, f.top, f.right, f.bottom, a, b, c, d, e) | |
} | |
h = a * k + b * m + p; | |
a = a * l + b * n + q; | |
b = c * k + d * m + p; | |
c = c * l + d * n + q; | |
e.m(0, 0); | |
d = this.Ja; | |
c = K.bl(0, 0, d.width, d.height, h, a, b, c, e); | |
e.transform(f); | |
return c | |
}; | |
function Ph(a, b, c, d, e) { | |
if (!1 !== Aj(a)) { | |
var f = a.margin, | |
h = f.right + f.left, | |
f = f.top + f.bottom; | |
b = Math.max(b - h, 0); | |
c = Math.max(c - f, 0); | |
e = e || 0; | |
d = Math.max((d || 0) - h, 0); | |
e = Math.max(e - f, 0); | |
var h = a.angle, | |
f = 0, | |
f = a.za, | |
k = 0; | |
a.jb && (k = a.jb); | |
90 === h || 270 === h ? (b = isFinite(f.height) ? f.height + k : b, c = isFinite(f.width) ? f.width + k : c) : (b = isFinite(f.width) ? f.width + k : b, c = isFinite(f.height) ? f.height + k : c); | |
var f = d || 0, | |
k = e || 0, | |
l = a instanceof B; | |
switch (pl(a, !0)) { | |
case qh: | |
k = f = 0; | |
l && (c = b = Infinity); | |
break; | |
case cd: | |
isFinite(b) && b > d && (f = b); | |
isFinite(c) && c > e && (k = c); | |
break; | |
case fl: | |
isFinite(b) && b > d && (f = b); | |
k = 0; | |
l && (c = Infinity); | |
break; | |
case el: | |
isFinite(c) && c > e && (k = c), f = 0, l && (b = Infinity) | |
} | |
var l = a.cf, | |
m = a.xg; | |
f > l.width && m.width < l.width && (f = l.width); | |
k > l.height && m.height < l.height && (k = l.height); | |
d = Math.max(f / a.scale, m.width); | |
e = Math.max(k / a.scale, m.height); | |
l.width < d && (d = Math.min(m.width, d)); | |
l.height < e && (e = Math.min(m.height, e)); | |
b = Math.min(l.width, b); | |
c = Math.min(l.height, c); | |
b = Math.max(d, b); | |
c = Math.max(e, c); | |
if (90 === h || 270 === h) { | |
f = b, b = c, c = f, f = d, d = e, e = f | |
} | |
a.Pc.Ma(); | |
a.Qo(b, c, d, e); | |
a.Pc.freeze(); | |
a.Pc.I() || u.k("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.Pc.toString()); | |
uj(a, !1) | |
} | |
} | |
g.yc = function(a, b, c, d, e) { | |
this.Lg(); | |
var f = u.Tf(); | |
f.assign(this.Zb); | |
this.Zb.Ma(); | |
if (!1 === Bj(this)) { | |
var h = this.Zb; | |
h.x = a; | |
h.y = b; | |
h.width = c; | |
h.height = d | |
} else { | |
this.yi(a, b, c, d) | |
} | |
this.Zb.freeze(); | |
this.Yh = void 0 === e ? null : e; | |
c = !1; | |
void 0 !== e ? c = !0 : null !== this.P && (e = this.P.Gc, d = this.Ca, null !== this.rm && (d = this.Zb), c = b + d.height, d = a + d.width, c = !(0 <= a + 0.05 && d <= e.width + 0.05 && 0 <= b + 0.05 && c <= e.height + 0.05), this instanceof qa && (a = this.Gc, this.Iu > a.height || this.ej.Pe > a.width)) && (c = !0); | |
this.ea = c ? this.ea | 256 : this.ea & -257; | |
this.Zb.I() || u.k("Non-real actualBounds has been set. Object " + this + ", actualBounds: " + this.Zb.toString()); | |
this.uw(f, this.Zb); | |
u.ic(f) | |
}; | |
g.yi = function() {}; | |
function ql(a, b, c, d, e) { | |
var f = a.ca; | |
f.x = b; | |
f.y = c; | |
f.width = d; | |
f.height = e; | |
if (!a.za.I()) { | |
f = a.Pc; | |
c = a.margin; | |
b = c.right + c.left; | |
var h = c.top + c.bottom; | |
c = f.width + b; | |
f = f.height + h; | |
d += b; | |
e += h; | |
b = pl(a, !0); | |
c === d && f === e && (b = qh); | |
switch (b) { | |
case qh: | |
if (c > d || f > e) { | |
uj(a, !0), Ph(a, c > d ? d : c, f > e ? e : f) | |
} | |
break; | |
case cd: | |
uj(a, !0); | |
Ph(a, d, e, 0, 0); | |
break; | |
case fl: | |
uj(a, !0); | |
Ph(a, d, f, 0, 0); | |
break; | |
case el: | |
uj(a, !0), Ph(a, c, e, 0, 0) | |
} | |
} | |
} | |
g.uw = function() { | |
rl(this, !1); | |
var a = this.W; | |
null !== a && null !== a.g && (a.dl(), this.Su(a), this.na(), a = this.W, null !== a && (a.ot !== this && a.tE !== this && a.wE !== this || sl(a, !0))) | |
}; | |
g.Su = function(a) { | |
null !== this.Kd && sl(a, !0) | |
}; | |
g.Xe = function(a, b) { | |
if (this.visible) { | |
var c = this.opacity, | |
d = 1; | |
if (1 !== c) { | |
if (0 === c) { | |
return | |
} | |
d = a.globalAlpha; | |
a.globalAlpha = d * c | |
} | |
if (a instanceof Nc) { | |
a: { | |
if (this.visible) { | |
var e = null, | |
f = a.lw; | |
if (this instanceof B && (this.type === tl || this.type === ul)) { | |
vl(this, a, b) | |
} else { | |
var h = this.Zb; | |
if (0 !== h.width && 0 !== h.height && !isNaN(h.x) && !isNaN(h.y)) { | |
var k = this.transform, | |
l = this.P; | |
0 !== (this.ea & 4096) === !0 && wl(this); | |
var m = 0 !== (this.ea & 256), | |
n = !1; | |
this instanceof qa && xl(this, a); | |
if (m) { | |
n = l.Uf() ? l.Ja : l.ca; | |
if (this.Yh) { | |
var p = this.Yh, | |
q = p.x, | |
r = p.y, | |
s = p.width, | |
p = p.height | |
} else { | |
q = Math.max(h.x, n.x), r = Math.max(h.y, n.y), s = Math.min(h.right, n.right) - q, p = Math.min(h.bottom, n.bottom) - r | |
} | |
if (q > h.width + h.x || h.x > n.width + n.x || r > h.height + h.y || h.y > n.height + n.y) { | |
break a | |
} | |
n = !0; | |
Uc(a, 1, 0, 0, 1, 0, 0); | |
a.save(); | |
a.beginPath(); | |
a.rect(q, r, s, p); | |
a.clip() | |
} | |
q = !1; | |
if (this instanceof G && (q = !0, !this.Ia())) { | |
break a | |
} | |
r = !1; | |
s = b.Sg; | |
this.W && s.drawShadows && (r = this.W.il); | |
a.Fi.bf = [1, 0, 0, 1, 0, 0]; | |
null !== this.lc && (yl(this, a, this.lc, !0, !0), this.lc instanceof ga && this.lc.type === ve ? (a.beginPath(), a.rect(h.x, h.y, h.width, h.height), zl(a, this.lc)) : a.fillRect(h.x, h.y, h.width, h.height)); | |
q && this.il && s.drawShadows && (Uc(a, 1, 0, 0, 1, 0, 0), h = this.im, a.shadowOffsetX = h.x, a.shadowOffsetY = h.y, a.shadowColor = this.hm, a.shadowBlur = this.gm / b.scale, a.ab()); | |
this instanceof B ? Uc(a, k.m11, k.m12, k.m21, k.m22, k.dx, k.dy) : a.Fi.bf = [k.m11, k.m12, k.m21, k.m22, k.dx, k.dy]; | |
if (null !== this.Jb) { | |
var p = this.Ja, | |
h = k = 0, | |
s = p.width, | |
p = p.height, | |
t = 0; | |
this instanceof X && (p = this.Qa.mb, k = p.x, h = p.y, s = p.width, p = p.height, t = this.Ug); | |
yl(this, a, this.Jb, !0, !1); | |
this.Jb instanceof ga && this.Jb.type === ve ? (a.beginPath(), a.rect(k - t / 2, h - t / 2, s + t, p + t), zl(a, this.Jb)) : a.fillRect(k - t / 2, h - t / 2, s + t, p + t) | |
} | |
s = h = k = 0; | |
r && (null !== this.Jb || null !== this.lc || null !== l && 0 !== (l.ea & 512) || null !== l && l.type === Yi && l.Jf() !== this) ? (Al(this, !0), k = a.shadowOffsetX, h = a.shadowOffsetY, s = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0) : Al(this, !1); | |
this.Mj(a, b); | |
r && 0 !== (this.ea & 512) === !0 && (a.shadowOffsetX = k, a.shadowOffsetY = h, a.shadowBlur = s); | |
q && r && (a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0); | |
m && (a.restore(), n && a.tf.pop(), $i(b, a)); | |
this instanceof B && (e = a.tf.pop()); | |
q && r && a.tf.pop(); | |
null !== a.oD && (null === e && (f === a.lw ? (Uc(a, 1, 0, 0, 1, 0, 0), e = a.tf.pop()) : e = a.lw), a.oD(this, e)) | |
} | |
} | |
} | |
} | |
} | |
else { | |
if (this instanceof B && (this.type === tl || this.type === ul)) { | |
vl(this, a, b); | |
1 !== c && (a.globalAlpha = d); | |
return | |
} | |
q = this.Zb; | |
if (0 !== q.width && 0 !== q.height && !isNaN(q.x) && !isNaN(q.y)) { | |
e = this.transform; | |
f = this.P; | |
0 !== (this.ea & 4096) === !0 && wl(this); | |
l = 0 !== (this.ea & 256); | |
this instanceof qa && xl(this, a); | |
if (l) { | |
m = f.Uf() ? f.Ja : f.ca; | |
this.Yh ? (h = this.Yh, n = h.x, r = h.y, k = h.width, h = h.height) : (n = Math.max(q.x, m.x), r = Math.max(q.y, m.y), k = Math.min(q.right, m.right) - n, h = Math.min(q.bottom, m.bottom) - r); | |
if (n > q.width + q.x || q.x > m.width + m.x || r > q.height + q.y || q.y > m.height + m.y) { | |
1 !== c && (a.globalAlpha = d); | |
return | |
} | |
a.save(); | |
a.beginPath(); | |
a.rect(n, r, k, h); | |
a.clip() | |
} | |
r = b.Sg; | |
m = !1; | |
if (this instanceof G) { | |
m = !0; | |
if (!this.Ia()) { | |
1 !== c && (a.globalAlpha = d); | |
return | |
} | |
this.il && r.drawShadows && (n = this.im, a.shadowOffsetX = n.x * b.scale * b.pf, a.shadowOffsetY = n.y * b.scale * b.pf, a.shadowColor = this.hm, a.shadowBlur = this.gm) | |
} | |
n = !1; | |
this.W && r.drawShadows && (n = this.W.il); | |
null !== this.lc && (yl(this, a, this.lc, !0, !0), this.lc instanceof ga && this.lc.type === ve ? (a.beginPath(), a.rect(q.x, q.y, q.width, q.height), zl(a, this.lc)) : a.fillRect(q.x, q.y, q.width, q.height)); | |
e.Ps() || a.transform(e.m11, e.m12, e.m21, e.m22, e.dx, e.dy); | |
null !== this.Jb && (h = this.Ja, r = q = 0, k = h.width, h = h.height, s = 0, this instanceof X && (h = this.Qa.mb, q = h.x, r = h.y, k = h.width, h = h.height, s = this.Ug), yl(this, a, this.Jb, !0, !1), this.Jb instanceof ga && this.Jb.type === ve ? (a.beginPath(), a.rect(q - s / 2, r - s / 2, k + s, h + s), zl(a, this.Jb)) : a.fillRect(q - s / 2, r - s / 2, k + s, h + s)); | |
k = r = q = 0; | |
n && (null !== this.Jb || null !== this.lc || null !== f && 0 !== (f.ea & 512) || null !== f && (f.type === Yi || f.type === oh) && f.Jf() !== this) ? (Al(this, !0), q = a.shadowOffsetX, r = a.shadowOffsetY, k = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0) : Al(this, !1); | |
this.Mj(a, b); | |
n && 0 !== (this.ea & 512) === !0 && (a.shadowOffsetX = q, a.shadowOffsetY = r, a.shadowBlur = k); | |
m && n && (a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0); | |
l ? (a.restore(), this instanceof B ? $i(b, a, !0) : $i(b, a, !1)) : e.Ps() || (f = 1 / (e.m11 * e.m22 - e.m12 * e.m21), a.transform(e.m22 * f, -e.m12 * f, -e.m21 * f, e.m11 * f, f * (e.m21 * e.dy - e.m22 * e.dx), f * (e.m12 * e.dx - e.m11 * e.dy))) | |
} | |
} | |
1 !== c && (a.globalAlpha = d) | |
} | |
}; | |
function vl(a, b, c) { | |
var d = a.Zb; | |
0 === d.width || 0 === d.height || isNaN(d.x) || isNaN(d.y) || (null !== a.lc && (yl(a, b, a.lc, !0, !0), a.lc instanceof ga && a.lc.type === ve ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), zl(b, a.lc)) : b.fillRect(d.x, d.y, d.width, d.height)), null !== a.Jb && (yl(a, b, a.Jb, !0, !1), a.Jb instanceof ga && a.Jb.type === ve ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), zl(b, a.Jb)) : b.fillRect(d.x, d.y, d.width, d.height)), a.Mj(b, c)) | |
} | |
g.Mj = function() {}; | |
function zl(a, b) { | |
if (b instanceof ga && b.type === ve && !(a instanceof Nc)) { | |
var c = b.nx, | |
d = b.mx; | |
d > c ? (a.scale(c / d, 1), a.translate((d - c) / 2, 0)) : c > d && (a.scale(1, d / c), a.translate(0, (c - d) / 2)); | |
a.Gt ? a.clip() : a.fill(); | |
d > c ? (a.translate(-(d - c) / 2, 0), a.scale(1 / (c / d), 1)) : c > d && (a.translate(0, -(c - d) / 2), a.scale(1, 1 / (d / c))) | |
} else { | |
a.Gt ? a.clip() : a.fill() | |
} | |
} | |
function Bl(a) { | |
a.Gt || a.stroke() | |
} | |
function yl(a, b, c, d, e) { | |
if (null !== c) { | |
var f = 1, | |
h = 1; | |
if ("string" === typeof c) { | |
d ? b.Vm !== c && (b.fillStyle = c, b.Vm = c) : b.Wm !== c && (b.strokeStyle = c, b.Wm = c) | |
} else { | |
if (c.type === te) { | |
c = c.color, d ? b.Vm !== c && (b.fillStyle = c, b.Vm = c) : b.Wm !== c && (b.strokeStyle = c, b.Wm = c) | |
} else { | |
var k, h = a.Ja, | |
f = h.width, | |
h = h.height; | |
if (e) { | |
var l = a.ca, | |
f = l.width, | |
h = l.height | |
} | |
var m = b instanceof CanvasRenderingContext2D; | |
if (m && (c.Hg && c.type === bl || c.nx === f && c.mx === h)) { | |
k = c.Hg | |
} else { | |
var n = l = 0, | |
p = 0, | |
q = 0, | |
r = 0, | |
s = 0, | |
s = r = 0; | |
e && (l = a.ca, f = l.width, h = l.height, r = l.x, s = l.y); | |
l = c.start.x * f + c.start.offsetX; | |
n = c.start.y * h + c.start.offsetY; | |
p = c.end.x * f + c.end.offsetX; | |
q = c.end.y * h + c.end.offsetY; | |
l += r; | |
p += r; | |
n += s; | |
q += s; | |
c.type === ue ? k = b.createLinearGradient(l, n, p, q) : c.type === ve ? (s = isNaN(c.vs) ? Math.max(f, h) / 2 : c.vs, isNaN(c.vt) ? (r = 0, s = Math.max(f, h) / 2) : r = c.vt, k = b.createRadialGradient(l, n, r, p, q, s)) : c.type === bl ? k = b.createPattern(c.pattern, "repeat") : u.Ld(c.type, "Brush type"); | |
if (c.type !== bl && (a = c.qs, null !== a)) { | |
for (a = a.i; a.next();) { | |
k.addColorStop(a.key, a.value) | |
} | |
} | |
m && (c.Hg = k, c.nx = f, c.mx = h) | |
} | |
d ? b.Vm !== k && (b.fillStyle = k, b.Vm = k) : b.Wm !== k && (b.strokeStyle = k, b.Wm = k) | |
} | |
} | |
} | |
} | |
T.prototype.isContainedBy = T.prototype.gl = function(a) { | |
if (a instanceof B) { | |
a: { | |
if (this !== a && null !== a) { | |
for (var b = this.P; null !== b;) { | |
if (b === a) { | |
a = !0; | |
break a | |
} | |
b = b.P | |
} | |
} | |
a = !1 | |
} | |
} | |
else { | |
a = !1 | |
} | |
return a | |
}; | |
T.prototype.isVisibleObject = T.prototype.ll = function() { | |
if (!this.visible) { | |
return !1 | |
} | |
var a = this.P; | |
return null !== a ? a.ll() : !0 | |
}; | |
function wl(a) { | |
if (0 !== (a.ea & 2048) === !0) { | |
var b = a.Td; | |
b.reset(); | |
if (!a.Zb.I() || !a.Pc.I()) { | |
Cl(a, !1); | |
return | |
} | |
b.translate(a.Zb.x, a.Zb.y); | |
b.translate(-a.Ca.x, -a.Ca.y); | |
var c = a.Ja; | |
nl(a, b, c.x, c.y, c.width, c.height); | |
Cl(a, !1); | |
Dl(a, !0) | |
} | |
0 !== (a.ea & 4096) === !0 && (b = a.P, null === b ? (a.$m.set(a.Td), a.gu = a.scale, Dl(a, !1)) : null !== b.Gf && (c = a.$m, c.reset(), b.Uf() ? c.multiply(b.$m) : null !== b.P && c.multiply(b.P.$m), c.multiply(a.Td), a.gu = a.scale * b.gu, Dl(a, !1))) | |
} | |
function nl(a, b, c, d, e, f) { | |
1 !== a.scale && b.scale(a.scale); | |
if (0 !== a.angle) { | |
var h = Ib; | |
a.af && a.af.Vc() && (h = a.af); | |
var k = u.K(); | |
if (a instanceof G && a.fc !== a) { | |
for (c = a.fc, d = c.Ja, k.st(d.x, d.y, d.width, d.height, h), c.yk.bb(k), k.offset(-c.Ca.x, -c.Ca.y), h = c.P; null !== h && h !== a;) { | |
h.yk.bb(k), k.offset(-h.Ca.x, -h.Ca.y), h = h.P | |
} | |
} else { | |
k.st(c, d, e, f, h) | |
} | |
b.rotate(a.angle, k.x, k.y); | |
u.v(k) | |
} | |
} | |
g = T.prototype; | |
g.S = function(a) { | |
void 0 === a && (a = !1); | |
if (!0 !== Aj(this)) { | |
uj(this, !0); | |
rl(this, !0); | |
var b = this.P; | |
null !== b ? a || b.S() : (a = this.g, null !== a && (a.Zf.add(this), this instanceof U && (a.ga.fb || this.$e(), null !== this.de && El(this.de)), a.ee(!0))); | |
if (this instanceof B) { | |
if (this.pa === Yi || this.pa === ah) { | |
a = this.Jf(), null !== a && a.S(!0) | |
} | |
a = this.Aa.n; | |
for (var b = a.length, c = 0; c < b; c++) { | |
var d = a[c]; | |
!0 !== Aj(d) && (d.za.I() || (d instanceof ph || d instanceof B || d instanceof qa || pl(d, !1) !== qh) && d.S(!0)) | |
} | |
} | |
} | |
}; | |
g.Io = function() { | |
!1 === Aj(this) && (uj(this, !0), rl(this, !0)) | |
}; | |
function El(a) { | |
if (!1 === Bj(a)) { | |
if (null !== a.P) { | |
a.P.S() | |
} else { | |
var b = a.g; | |
null !== b && (b.Zf.add(a), a instanceof U && a.$e(), b.ee()) | |
} | |
rl(a, !0) | |
} | |
} | |
g.Lg = function() { | |
0 !== (this.ea & 2048) === !1 && (Cl(this, !0), Dl(this, !0)) | |
}; | |
g.nz = function() { | |
Dl(this, !0) | |
}; | |
g.na = function() { | |
var a = this.W; | |
null !== a && a.na() | |
}; | |
function pl(a, b) { | |
var c = a.stretch, | |
d = a.P; | |
if (null !== d && d.pa === Fl) { | |
return Gl(a, d.hd(a.rc), d.gd(a.column), b) | |
} | |
if (null !== d && d.pa === Yi && d.Jf() === a) { | |
return Hl(a, cd, b) | |
} | |
if (c === dl) { | |
if (null !== d) { | |
if (d.pa === oh && d.Jf() === a) { | |
return Hl(a, cd, b) | |
} | |
c = d.Dd; | |
return c === dl ? Hl(a, qh, b) : Hl(a, c, b) | |
} | |
return Hl(a, qh, b) | |
} | |
return Hl(a, c, b) | |
} | |
function Gl(a, b, c, d) { | |
var e = a.stretch; | |
if (e !== dl) { | |
return Hl(a, e, d) | |
} | |
var f = e = null; | |
switch (b.stretch) { | |
case el: | |
f = !0; | |
break; | |
case cd: | |
f = !0 | |
} | |
switch (c.stretch) { | |
case fl: | |
e = !0; | |
break; | |
case cd: | |
e = !0 | |
} | |
b = a.P.Dd; | |
null === e && (e = b === fl || b === cd); | |
null === f && (f = b === el || b === cd); | |
return !0 === e && !0 === f ? Hl(a, cd, d) : !0 === e ? Hl(a, fl, d) : !0 === f ? Hl(a, el, d) : Hl(a, qh, d) | |
} | |
function Hl(a, b, c) { | |
if (c) { | |
return b | |
} | |
if (b === qh) { | |
return qh | |
} | |
c = a.za; | |
if (c.I()) { | |
return qh | |
} | |
a = a.angle; | |
if (!isNaN(c.width)) { | |
if (90 !== a && 270 !== a) { | |
if (b === fl) { | |
return qh | |
} | |
if (b === cd) { | |
return el | |
} | |
} else { | |
if (b === el) { | |
return qh | |
} | |
if (b === cd) { | |
return fl | |
} | |
} | |
} | |
if (!isNaN(c.height)) { | |
if (90 !== a && 270 !== a) { | |
if (b === el) { | |
return qh | |
} | |
if (b === cd) { | |
return fl | |
} | |
} else { | |
if (b === fl) { | |
return qh | |
} | |
if (b === cd) { | |
return el | |
} | |
} | |
} | |
return b | |
} | |
u.defineProperty(T, { | |
Ew: "segmentOrientation" | |
}, function() { | |
return this.Er | |
}, function(a) { | |
var b = this.Er; | |
b !== a && (this.Er = a, this.S(), this.h("segmentOrientation", b, a), a === dh && (this.angle = 0)) | |
}); | |
u.defineProperty(T, { | |
Qf: "segmentIndex" | |
}, function() { | |
return this.Cr | |
}, function(a) { | |
a = Math.round(a); | |
var b = this.Cr; | |
b !== a && (this.Cr = a, this.S(), this.h("segmentIndex", b, a)) | |
}); | |
u.defineProperty(T, { | |
Dw: "segmentFraction" | |
}, function() { | |
return this.Br | |
}, function(a) { | |
isNaN(a) ? a = 0 : 0 > a ? a = 0 : 1 < a && (a = 1); | |
var b = this.Br; | |
b !== a && (this.Br = a, this.S(), this.h("segmentFraction", b, a)) | |
}); | |
u.defineProperty(T, { | |
CE: "segmentOffset" | |
}, function() { | |
return this.Dr | |
}, function(a) { | |
var b = this.Dr; | |
b.L(a) || (this.Dr = a = a.Z(), this.S(), this.h("segmentOffset", b, a)) | |
}); | |
u.defineProperty(T, { | |
stretch: "stretch" | |
}, function() { | |
return this.Jh | |
}, function(a) { | |
var b = this.Jh; | |
b !== a && (this.Jh = a, this.S(), this.h("stretch", b, a)) | |
}); | |
u.defineProperty(T, { | |
name: "name" | |
}, function() { | |
return this.Vb | |
}, function(a) { | |
var b = this.Vb; | |
b !== a && (this.Vb = a, null !== this.W && (this.W.Bk = null), this.h("name", b, a)) | |
}); | |
u.defineProperty(T, { | |
opacity: "opacity" | |
}, function() { | |
return this.Hc | |
}, function(a) { | |
var b = this.Hc; | |
b !== a && (u.j(a, "number", T, "opacity"), (0 > a || 1 < a) && u.xa(a, "0 <= value <= 1", T, "opacity"), this.Hc = a, this.h("opacity", b, a), a = this.g, b = this.W, null !== a && null !== b && a.na(Ki(b, b.ca))) | |
}); | |
u.defineProperty(T, { | |
visible: "visible" | |
}, function() { | |
return 0 !== (this.ea & 1) | |
}, function(a) { | |
var b = 0 !== (this.ea & 1); | |
b !== a && (this.ea ^= 1, this.h("visible", b, a), b = this.P, null !== b ? b.S() : this instanceof G && this.Ie(a), this.na(), Il(this)) | |
}); | |
u.defineProperty(T, { | |
Cg: "pickable" | |
}, function() { | |
return 0 !== (this.ea & 2) | |
}, function(a) { | |
var b = 0 !== (this.ea & 2); | |
b !== a && (this.ea ^= 2, this.h("pickable", b, a)) | |
}); | |
u.defineProperty(T, { | |
CG: "fromLinkableDuplicates" | |
}, function() { | |
return 0 !== (this.ea & 4) | |
}, function(a) { | |
var b = 0 !== (this.ea & 4); | |
b !== a && (this.ea ^= 4, this.h("fromLinkableDuplicates", b, a)) | |
}); | |
u.defineProperty(T, { | |
DG: "fromLinkableSelfNode" | |
}, function() { | |
return 0 !== (this.ea & 8) | |
}, function(a) { | |
var b = 0 !== (this.ea & 8); | |
b !== a && (this.ea ^= 8, this.h("fromLinkableSelfNode", b, a)) | |
}); | |
u.defineProperty(T, { | |
zI: "toLinkableDuplicates" | |
}, function() { | |
return 0 !== (this.ea & 16) | |
}, function(a) { | |
var b = 0 !== (this.ea & 16); | |
b !== a && (this.ea ^= 16, this.h("toLinkableDuplicates", b, a)) | |
}); | |
u.defineProperty(T, { | |
AI: "toLinkableSelfNode" | |
}, function() { | |
return 0 !== (this.ea & 32) | |
}, function(a) { | |
var b = 0 !== (this.ea & 32); | |
b !== a && (this.ea ^= 32, this.h("toLinkableSelfNode", b, a)) | |
}); | |
u.defineProperty(T, { | |
vg: "isPanelMain" | |
}, function() { | |
return 0 !== (this.ea & 64) | |
}, function(a) { | |
var b = 0 !== (this.ea & 64); | |
b !== a && (this.ea ^= 64, this.S(), this.h("isPanelMain", b, a)) | |
}); | |
u.defineProperty(T, { | |
qz: "isActionable" | |
}, function() { | |
return 0 !== (this.ea & 128) | |
}, function(a) { | |
var b = 0 !== (this.ea & 128); | |
b !== a && (this.ea ^= 128, this.h("isActionable", b, a)) | |
}); | |
u.defineProperty(T, { | |
rm: "areaBackground" | |
}, function() { | |
return this.lc | |
}, function(a) { | |
var b = this.lc; | |
b !== a && (a instanceof ga && a.freeze(), this.lc = a, this.na(), this.h("areaBackground", b, a)) | |
}); | |
u.defineProperty(T, { | |
background: "background" | |
}, function() { | |
return this.Jb | |
}, function(a) { | |
var b = this.Jb; | |
b !== a && (a instanceof ga && a.freeze(), this.Jb = a, this.na(), this.h("background", b, a)) | |
}); | |
function Al(a, b) { | |
a.ea = b ? a.ea | 512 : a.ea & -513 | |
} | |
function Jl(a, b) { | |
a.ea = b ? a.ea | 1024 : a.ea & -1025 | |
} | |
function Cl(a, b) { | |
a.ea = b ? a.ea | 2048 : a.ea & -2049 | |
} | |
function Dl(a, b) { | |
a.ea = b ? a.ea | 4096 : a.ea & -4097 | |
} | |
function Aj(a) { | |
return 0 !== (a.ea & 8192) | |
} | |
function uj(a, b) { | |
a.ea = b ? a.ea | 8192 : a.ea & -8193 | |
} | |
function Bj(a) { | |
return 0 !== (a.ea & 16384) | |
} | |
function rl(a, b) { | |
a.ea = b ? a.ea | 16384 : a.ea & -16385 | |
} | |
u.u(T, { | |
W: "part" | |
}, function() { | |
if (this instanceof G) { | |
return this | |
} | |
if (this.$l) { | |
return this.$l | |
} | |
var a; | |
for (a = this.P; a;) { | |
if (a instanceof G) { | |
return this.$l = a | |
} | |
a = a.P | |
} | |
return null | |
}); | |
u.u(T, { | |
P: "panel" | |
}, function() { | |
return this.Rg | |
}); | |
T.prototype.rl = function(a) { | |
this.Rg = a | |
}; | |
u.u(T, { | |
layer: "layer" | |
}, function() { | |
var a = this.W; | |
return null !== a ? a.layer : null | |
}); | |
u.u(T, { | |
g: "diagram" | |
}, function() { | |
var a = this.W; | |
return null !== a ? a.g : null | |
}, { | |
configurable: !0 | |
}); | |
u.defineProperty(T, { | |
position: "position" | |
}, function() { | |
return this.Na | |
}, function(a) { | |
var b = this.Na; | |
b.L(a) || (a = a.Z(), this.eA(a, b) && this.h("position", b, a)) | |
}); | |
T.prototype.eA = function(a) { | |
this.Na = a; | |
El(this); | |
this.Lg(); | |
return !0 | |
}; | |
T.prototype.HE = function(a, b) { | |
this.Na.m(a, b); | |
Kl(this, !0); | |
this.Lg() | |
}; | |
u.u(T, { | |
ca: "actualBounds" | |
}, function() { | |
return this.Zb | |
}); | |
u.defineProperty(T, { | |
scale: "scale" | |
}, function() { | |
return this.ac | |
}, function(a) { | |
var b = this.ac; | |
b !== a && (0 >= a && u.k("GraphObject.scale must be greater than zero"), this.ac = a, this.Lg(), this.S(), this.h("scale", b, a)) | |
}); | |
u.defineProperty(T, { | |
angle: "angle" | |
}, function() { | |
return this.Al | |
}, function(a) { | |
var b = this.Al; | |
b !== a && (a %= 360, 0 > a && (a += 360), b !== a && (this.Al = a, this.S(), this.Lg(), this.h("angle", b, a))) | |
}); | |
u.defineProperty(T, { | |
za: "desiredSize" | |
}, function() { | |
return this.lf | |
}, function(a) { | |
var b = this.lf; | |
b.L(a) || (this.lf = a = a.Z(), this.S(), this instanceof X && this.me(), this.h("desiredSize", b, a), a = this.W, null !== a && 0 !== (this.ea & 1024) && (ll(this, a, "width"), ll(this, a, "height"))) | |
}); | |
u.defineProperty(T, { | |
width: "width" | |
}, function() { | |
return this.lf.width | |
}, function(a) { | |
if (this.lf.width !== a) { | |
var b = this.lf; | |
this.lf = a = (new ia(a, this.lf.height)).freeze(); | |
this.S(); | |
this instanceof X && this.me(); | |
this.h("desiredSize", b, a); | |
b = this.W; | |
null !== b && 0 !== (this.ea & 1024) && ll(this, b, "width") | |
} | |
}); | |
u.defineProperty(T, { | |
height: "height" | |
}, function() { | |
return this.lf.height | |
}, function(a) { | |
if (this.lf.height !== a) { | |
var b = this.lf; | |
this.lf = a = (new ia(this.lf.width, a)).freeze(); | |
this.S(); | |
this instanceof X && this.me(); | |
this.h("desiredSize", b, a); | |
b = this.W; | |
null !== b && 0 !== (this.ea & 1024) && ll(this, b, "height") | |
} | |
}); | |
u.defineProperty(T, { | |
xg: "minSize" | |
}, function() { | |
return this.nj | |
}, function(a) { | |
var b = this.nj; | |
b.L(a) || (a = a.copy(), isNaN(a.width) && (a.width = 0), isNaN(a.height) && (a.height = 0), a.freeze(), this.nj = a, this.S(), this.h("minSize", b, a)) | |
}); | |
u.defineProperty(T, { | |
cf: "maxSize" | |
}, function() { | |
return this.lj | |
}, function(a) { | |
var b = this.lj; | |
b.L(a) || (a = a.copy(), isNaN(a.width) && (a.width = Infinity), isNaN(a.height) && (a.height = Infinity), a.freeze(), this.lj = a, this.S(), this.h("maxSize", b, a)) | |
}); | |
u.u(T, { | |
Ca: "measuredBounds" | |
}, function() { | |
return this.Pc | |
}); | |
u.u(T, { | |
Ja: "naturalBounds" | |
}, function() { | |
return this.Gc | |
}, { | |
configurable: !0 | |
}); | |
u.defineProperty(T, { | |
margin: "margin" | |
}, function() { | |
return this.Iq | |
}, function(a) { | |
"number" === typeof a && (a = new rb(a)); | |
var b = this.Iq; | |
b.L(a) || (this.Iq = a = a.Z(), this.S(), this.h("margin", b, a)) | |
}); | |
u.u(T, { | |
transform: null | |
}, function() { | |
0 !== (this.ea & 2048) === !0 && wl(this); | |
return this.Td | |
}); | |
u.u(T, { | |
Gf: null | |
}, function() { | |
0 !== (this.ea & 4096) === !0 && wl(this); | |
return this.$m | |
}); | |
u.defineProperty(T, { | |
alignment: "alignment" | |
}, function() { | |
return this.ue | |
}, function(a) { | |
var b = this.ue; | |
b.L(a) || (a.oe() && !a.Kc() && u.k("alignment must be a real Spot or Spot.Default"), this.ue = a = a.Z(), El(this), this.h("alignment", b, a)) | |
}); | |
u.defineProperty(T, { | |
column: "column" | |
}, function() { | |
return this.Ep | |
}, function(a) { | |
a = Math.round(a); | |
var b = this.Ep; | |
b !== a && (0 > a && u.xa(a, ">= 0", T, "column"), this.Ep = a, this.S(), this.h("column", b, a)) | |
}); | |
u.defineProperty(T, { | |
aG: "columnSpan" | |
}, function() { | |
return this.Wi | |
}, function(a) { | |
a = Math.round(a); | |
var b = this.Wi; | |
b !== a && (1 > a && u.xa(a, ">= 1", T, "columnSpan"), this.Wi = a, this.S(), this.h("columnSpan", b, a)) | |
}); | |
u.defineProperty(T, { | |
rc: "row" | |
}, function() { | |
return this.yr | |
}, function(a) { | |
a = Math.round(a); | |
var b = this.yr; | |
b !== a && (0 > a && u.xa(a, ">= 0", T, "row"), this.yr = a, this.S(), this.h("row", b, a)) | |
}); | |
u.defineProperty(T, { | |
rowSpan: "rowSpan" | |
}, function() { | |
return this.tj | |
}, function(a) { | |
a = Math.round(a); | |
var b = this.tj; | |
b !== a && (1 > a && u.xa(a, ">= 1", T, "rowSpan"), this.tj = a, this.S(), this.h("rowSpan", b, a)) | |
}); | |
u.defineProperty(T, { | |
Hj: "alignmentFocus" | |
}, function() { | |
return this.xp | |
}, function(a) { | |
var b = this.xp; | |
b.L(a) || (a.oe() && !a.Kc() && u.k("alignmentFocus must be a real Spot or Spot.Default"), this.xp = a = a.Z(), this.S(), this.h("alignmentFocus", b, a)) | |
}); | |
u.defineProperty(T, { | |
Kd: "portId" | |
}, function() { | |
return this.kr | |
}, function(a) { | |
var b = this.kr; | |
if (b !== a) { | |
var c = this.W; | |
null === c || c instanceof U || (u.k("portID being set on a Link: " + a), c = null); | |
null !== b && null !== c && Ll(c, this); | |
this.kr = a; | |
if (null !== a && c) { | |
c.zh = !0; | |
null === c.Rd && Ml(c); | |
var d = this.Kd; | |
null !== d && c.Rd.add(d, this) | |
} | |
this.h("portId", b, a) | |
} | |
}); | |
function Nl(a) { | |
var b = { | |
value: null | |
}; | |
Ol(a, b); | |
return b.value | |
} | |
function Ol(a, b) { | |
var c = a.P; | |
return null === c || !Ol(c, b) && a.visible ? (b.value = a, !1) : !0 | |
} | |
function Il(a) { | |
var b = a.W; | |
b instanceof U && (a = a.g, null === a || a.ga.fb || b.$e()) | |
} | |
u.defineProperty(T, { | |
xb: "toSpot" | |
}, function() { | |
return null !== this.R ? this.R.Ej : vb | |
}, function(a) { | |
null === this.R && this.Fe(); | |
var b = this.R.Ej; | |
b.L(a) || (a = a.Z(), this.R.Ej = a, this.h("toSpot", b, a), Il(this)) | |
}); | |
u.defineProperty(T, { | |
wl: "toEndSegmentLength" | |
}, function() { | |
return null !== this.R ? this.R.Cj : 10 | |
}, function(a) { | |
null === this.R && this.Fe(); | |
var b = this.R.Cj; | |
b !== a && (0 > a && u.xa(a, ">= 0", T, "toEndSegmentLength"), this.R.Cj = a, this.h("toEndSegmentLength", b, a), Il(this)) | |
}); | |
u.defineProperty(T, { | |
xt: "toEndSegmentDirection" | |
}, function() { | |
return null !== this.R ? this.R.Bj : jl | |
}, function(a) { | |
null === this.R && this.Fe(); | |
var b = this.R.Bj; | |
b !== a && (this.R.Bj = a, this.h("toEndSegmentDirection", b, a), Il(this)) | |
}); | |
u.defineProperty(T, { | |
zt: "toShortLength" | |
}, function() { | |
return null !== this.R ? this.R.Dj : 0 | |
}, function(a) { | |
null === this.R && this.Fe(); | |
var b = this.R.Dj; | |
b !== a && (this.R.Dj = a, this.h("toShortLength", b, a), Il(this)) | |
}); | |
u.defineProperty(T, { | |
OE: "toLinkable" | |
}, function() { | |
return this.Ur | |
}, function(a) { | |
var b = this.Ur; | |
b !== a && (this.Ur = a, this.h("toLinkable", b, a)) | |
}); | |
u.defineProperty(T, { | |
BI: "toMaxLinks" | |
}, function() { | |
return this.Vr | |
}, function(a) { | |
var b = this.Vr; | |
b !== a && (0 > a && u.xa(a, ">= 0", T, "toMaxLinks"), this.Vr = a, this.h("toMaxLinks", b, a)) | |
}); | |
u.defineProperty(T, { | |
vb: "fromSpot" | |
}, function() { | |
return null !== this.R ? this.R.cj : vb | |
}, function(a) { | |
null === this.R && this.Fe(); | |
var b = this.R.cj; | |
b.L(a) || (a = a.Z(), this.R.cj = a, this.h("fromSpot", b, a), Il(this)) | |
}); | |
u.defineProperty(T, { | |
Yk: "fromEndSegmentLength" | |
}, function() { | |
return null !== this.R ? this.R.aj : 10 | |
}, function(a) { | |
null === this.R && this.Fe(); | |
var b = this.R.aj; | |
b !== a && (0 > a && u.xa(a, ">= 0", T, "fromEndSegmentLength"), this.R.aj = a, this.h("fromEndSegmentLength", b, a), Il(this)) | |
}); | |
u.defineProperty(T, { | |
Fs: "fromEndSegmentDirection" | |
}, function() { | |
return null !== this.R ? this.R.$i : jl | |
}, function(a) { | |
null === this.R && this.Fe(); | |
var b = this.R.$i; | |
b !== a && (this.R.$i = a, this.h("fromEndSegmentDirection", b, a), Il(this)) | |
}); | |
u.defineProperty(T, { | |
Gs: "fromShortLength" | |
}, function() { | |
return null !== this.R ? this.R.bj : 0 | |
}, function(a) { | |
null === this.R && this.Fe(); | |
var b = this.R.bj; | |
b !== a && (this.R.bj = a, this.h("fromShortLength", b, a), Il(this)) | |
}); | |
u.defineProperty(T, { | |
wD: "fromLinkable" | |
}, function() { | |
return this.Yp | |
}, function(a) { | |
var b = this.Yp; | |
b !== a && (this.Yp = a, this.h("fromLinkable", b, a)) | |
}); | |
u.defineProperty(T, { | |
EG: "fromMaxLinks" | |
}, function() { | |
return this.Zp | |
}, function(a) { | |
var b = this.Zp; | |
b !== a && (0 > a && u.xa(a, ">= 0", T, "fromMaxLinks"), this.Zp = a, this.h("fromMaxLinks", b, a)) | |
}); | |
u.defineProperty(T, { | |
cursor: "cursor" | |
}, function() { | |
return this.Lp | |
}, function(a) { | |
var b = this.Lp; | |
b !== a && (u.j(a, "string", T, "cursor"), this.Lp = a, this.h("cursor", b, a)) | |
}); | |
u.defineProperty(T, { | |
click: "click" | |
}, function() { | |
return null !== this.Q ? this.Q.Xh : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.Xh; | |
b !== a && (null !== a && u.j(a, "function", T, "click"), this.Q.Xh = a, this.h("click", b, a)) | |
}); | |
u.defineProperty(T, { | |
us: "doubleClick" | |
}, function() { | |
return null !== this.Q ? this.Q.di : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.di; | |
b !== a && (null !== a && u.j(a, "function", T, "doubleClick"), this.Q.di = a, this.h("doubleClick", b, a)) | |
}); | |
u.defineProperty(T, { | |
Vy: "contextClick" | |
}, function() { | |
return null !== this.Q ? this.Q.Zh : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.Zh; | |
b !== a && (null !== a && u.j(a, "function", T, "contextClick"), this.Q.Zh = a, this.h("contextClick", b, a)) | |
}); | |
u.defineProperty(T, { | |
$D: "mouseEnter" | |
}, function() { | |
return null !== this.Q ? this.Q.Tq : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.Tq; | |
b !== a && (null !== a && u.j(a, "function", T, "mouseEnter"), this.Q.Tq = a, this.h("mouseEnter", b, a)) | |
}); | |
u.defineProperty(T, { | |
aE: "mouseLeave" | |
}, function() { | |
return null !== this.Q ? this.Q.Uq : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.Uq; | |
b !== a && (null !== a && u.j(a, "function", T, "mouseLeave"), this.Q.Uq = a, this.h("mouseLeave", b, a)) | |
}); | |
u.defineProperty(T, { | |
Gz: "mouseOver" | |
}, function() { | |
return null !== this.Q ? this.Q.ni : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.ni; | |
b !== a && (null !== a && u.j(a, "function", T, "mouseOver"), this.Q.ni = a, this.h("mouseOver", b, a)) | |
}); | |
u.defineProperty(T, { | |
Fz: "mouseHover" | |
}, function() { | |
return null !== this.Q ? this.Q.mi : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.mi; | |
b !== a && (null !== a && u.j(a, "function", T, "mouseHover"), this.Q.mi = a, this.h("mouseHover", b, a)) | |
}); | |
u.defineProperty(T, { | |
Ez: "mouseHold" | |
}, function() { | |
return null !== this.Q ? this.Q.li : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.li; | |
b !== a && (null !== a && u.j(a, "function", T, "mouseHold"), this.Q.li = a, this.h("mouseHold", b, a)) | |
}); | |
u.defineProperty(T, { | |
EH: "mouseDragEnter" | |
}, function() { | |
return null !== this.Q ? this.Q.Rq : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.Rq; | |
b !== a && (null !== a && u.j(a, "function", T, "mouseDragEnter"), this.Q.Rq = a, this.h("mouseDragEnter", b, a)) | |
}); | |
u.defineProperty(T, { | |
FH: "mouseDragLeave" | |
}, function() { | |
return null !== this.Q ? this.Q.Sq : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.Sq; | |
b !== a && (null !== a && u.j(a, "function", T, "mouseDragLeave"), this.Q.Sq = a, this.h("mouseDragLeave", b, a)) | |
}); | |
u.defineProperty(T, { | |
Dz: "mouseDrop" | |
}, function() { | |
return null !== this.Q ? this.Q.ki : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.ki; | |
b !== a && (null !== a && u.j(a, "function", T, "mouseDrop"), this.Q.ki = a, this.h("mouseDrop", b, a)) | |
}); | |
u.defineProperty(T, { | |
HC: "actionDown" | |
}, function() { | |
return null !== this.Q ? this.Q.sp : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.sp; | |
b !== a && (null !== a && u.j(a, "function", T, "actionDown"), this.Q.sp = a, this.h("actionDown", b, a)) | |
}); | |
u.defineProperty(T, { | |
IC: "actionMove" | |
}, function() { | |
return null !== this.Q ? this.Q.tp : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.tp; | |
b !== a && (null !== a && u.j(a, "function", T, "actionMove"), this.Q.tp = a, this.h("actionMove", b, a)) | |
}); | |
u.defineProperty(T, { | |
JC: "actionUp" | |
}, function() { | |
return null !== this.Q ? this.Q.vp : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.vp; | |
b !== a && (null !== a && u.j(a, "function", T, "actionUp"), this.Q.vp = a, this.h("actionUp", b, a)) | |
}); | |
u.defineProperty(T, { | |
GC: "actionCancel" | |
}, function() { | |
return null !== this.Q ? this.Q.rp : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.rp; | |
b !== a && (null !== a && u.j(a, "function", T, "actionCancel"), this.Q.rp = a, this.h("actionCancel", b, a)) | |
}); | |
u.defineProperty(T, { | |
mA: "toolTip" | |
}, function() { | |
return null !== this.Q ? this.Q.ui : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.ui; | |
b !== a && (null !== a && u.C(a, lf, T, "toolTip"), this.Q.ui = a, this.h("toolTip", b, a)) | |
}); | |
u.defineProperty(T, { | |
contextMenu: "contextMenu" | |
}, function() { | |
return null !== this.Q ? this.Q.$h : null | |
}, function(a) { | |
null === this.Q && gl(this); | |
var b = this.Q.$h; | |
b !== a && (null !== a && u.C(a, lf, T, "contextMenu"), this.Q.$h = a, this.h("contextMenu", b, a)) | |
}); | |
T.prototype.bind = T.prototype.bind = function(a) { | |
a.hg = this; | |
var b = this.Co(); | |
null !== b && Pl(b) && u.k("Cannot add a Binding to a template that has already been copied: " + a); | |
null === this.Fc && (this.Fc = new E(bf)); | |
this.Fc.add(a) | |
}; | |
T.prototype.findTemplateBinder = T.prototype.Co = function() { | |
for (var a = this instanceof B ? this : this.P; null !== a;) { | |
if (null !== a.Cl) { | |
return a | |
} | |
a = a.P | |
} | |
return null | |
}; | |
T.fromSvg = T.fromSVG = function(a) { | |
return Ql(a) | |
}; | |
T.prototype.setProperties = function(a) { | |
u.pt(this, a) | |
}; | |
var Rl; | |
T.make = Rl = function(a, b) { | |
var c = arguments, | |
d = null, | |
e = null; | |
if ("function" === typeof a) { | |
e = a | |
} else { | |
if ("string" === typeof a) { | |
var f = Sl.ua(a); | |
"function" === typeof f ? (c = u.Pk(arguments), d = f(c)) : e = da[a] | |
} | |
} | |
null === d && (void 0 === e && (d = window.$, void 0 !== d && void 0 !== d.noop && u.k("GraphObject.make failed to complete. Is it conflicting with another $ var? (such as jQuery)"), u.k("GraphObject.make failed to complete, it may be conflicting with another var.")), null !== e && e.constructor || u.k("GraphObject.make requires a class function or class name, not: " + a), d = new e); | |
f = 1; | |
if (d instanceof D && 1 < c.length) { | |
var h = d, | |
e = c[1]; | |
if ("string" === typeof e || e instanceof HTMLDivElement) { | |
Wi(h, e), f++ | |
} | |
} | |
for (; f < c.length; f++) { | |
e = c[f], void 0 === e ? u.k("Undefined value at argument " + f + " for object being constructed by GraphObject.make: " + d) : Tl(d, e) | |
} | |
return d | |
}; | |
function Tl(a, b) { | |
if ("string" === typeof b) { | |
if (a instanceof qa) { | |
a.text = b | |
} else { | |
if (a instanceof X) { | |
a.Fb = b | |
} else { | |
if (a instanceof Ri) { | |
a.source = b | |
} else { | |
if (a instanceof B) { | |
var c = Da(B, b); | |
null !== c ? a.type = c : u.k("Unknown Panel type as an argument to GraphObject.make: " + b) | |
} else { | |
a instanceof ga ? (c = Da(ga, b), null !== c ? a.type = c : u.k("Unknown Brush type as an argument to GraphObject.make: " + b)) : a instanceof $c ? (c = Da($c, b), null !== c ? a.type = c : u.k("Unknown Geometry type as an argument to GraphObject.make: " + b)) : a instanceof Jd ? (c = Da(Jd, b), null !== c ? a.type = c : u.k("Unknown PathSegment type as an argument to GraphObject.make: " + b)) : u.k("Unable to use a string as an argument to GraphObject.make: " + b) | |
} | |
} | |
} | |
} | |
} else { | |
if (b instanceof T) { | |
c = b, a instanceof B || u.k("A GraphObject can only be added to a Panel, not to: " + a), a.add(c) | |
} else { | |
if (b instanceof Se) { | |
var d = b, | |
c = a, | |
e; | |
d.be && c.hd ? e = c.hd(d.index) : !d.be && c.gd ? e = c.gd(d.index) : u.k("A RowColumnDefinition can only be added to a Panel, not to: " + a); | |
e.ss(d) | |
} else { | |
if (b instanceof ea) { | |
a instanceof W && b.Ce === W ? 2 === (b.value & 2) ? a.Bw = b : b === kh || b === ch || b === bh ? a.We = b : b === Ul || b === Vl || b === Wl ? a.gs = b : b !== Xl && b !== dh && u.k("Unknown Link enum value for a Link property: " + b) : a instanceof B && b.Ce === B ? a.type = b : a instanceof qa && b.Ce === qa ? a.bF = b : a instanceof X && (b === qh || b === sh || b === th || b === dl) ? a.zD = b : a instanceof Ri && (b === qh || b === sh || b === th) ? a.SG = b : a instanceof T && b.Ce === W ? (c = a, 0 === b.name.indexOf("Orient") ? c.Ew = b : u.k("Unknown Link enum value for GraphObject.segmentOrientation property: " + b)) : a instanceof T && b.Ce === T ? a.stretch = b : a instanceof Se && b.Ce === Se ? a.tt = b : a instanceof D && b.Ce === D ? a.po = b : a instanceof ga && b.Ce === ga ? a.type = b : a instanceof $c && b.Ce === $c ? a.type = b : a instanceof Jd && b.Ce === Jd ? a.type = b : a instanceof bf && b.Ce === bf ? a.mode = b : a instanceof Od && b.Ce === Od ? a.Cd = b : a instanceof Y && b.Ce === Y ? 0 === b.name.indexOf("Alignment") ? a.alignment = b : 0 === b.name.indexOf("Arrangement") ? a.Hf = 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.DI = b : u.k("Unknown enum value: " + b) : a instanceof Yl && b.Ce === Yl ? 0 === b.name.indexOf("Aggressive") ? a.OF = b : 0 === b.name.indexOf("Cycle") ? a.lG = b : 0 === b.name.indexOf("Init") ? a.XG = b : 0 === b.name.indexOf("Layer") ? a.nH = b : u.k("Unknown enum value: " + b) : a instanceof Xk && b.Ce === Xk ? b === Zl || b === $l || b === am || b === bm ? a.sorting = b : b === cm || b === dm ? a.Hf = b : b === em || b === fm ? a.alignment = b : u.k("Unknown enum value: " + b) : a instanceof gm && b.Ce === gm ? b === hm || b === im || b === jm || b === km || b === lm ? a.sorting = b : b === mm || b === nm || b === om || b === pm ? a.direction = b : b === xm || b === ym || b === zm || b === Am ? a.Hf = b : b === Bm || b === Cm ? a.sw = b : u.k("Unknown enum value: " + b) : u.k("No property to set for this enum value: " + b) | |
} else { | |
if (b instanceof bf) { | |
a instanceof T ? a.bind(b) : a instanceof Se ? a.bind(b) : u.k("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: " + a) | |
} else { | |
if (b instanceof bd) { | |
a instanceof $c ? a.ub.add(b) : u.k("A PathFigure can only be added to a Geometry, not to: " + a) | |
} else { | |
if (b instanceof Jd) { | |
a instanceof bd ? a.Ga.add(b) : u.k("A PathSegment can only be added to a PathFigure, not to: " + a) | |
} else { | |
if (b instanceof Je) { | |
a instanceof D ? a.Qb = b : a instanceof V ? a.Qb = b : u.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++) { | |
Tl(a, b[c]) | |
} | |
} else { | |
if ("object" === typeof b && null !== b) { | |
if (a instanceof ga) { | |
e = new pa; | |
for (c in b) { | |
d = parseFloat(c), isNaN(d) ? e[c] = b[c] : a.addColorStop(d, b[c]) | |
} | |
u.pt(a, e) | |
} else { | |
if (a instanceof Se) { | |
void 0 !== b.row ? (e = b.row, (void 0 === e || null === e || Infinity === e || isNaN(e) || 0 > e) && u.k("Must specify non-negative integer row for RowColumnDefinition " + b), a.be = !0, a.index = e) : void 0 !== b.column && (e = b.column, (void 0 === e || null === e || Infinity === e || isNaN(e) || 0 > e) && u.k("Must specify non-negative integer column for RowColumnDefinition " + b), a.be = !1, a.index = e); | |
e = new pa; | |
for (c in b) { | |
"row" !== c && "column" !== c && (e[c] = b[c]) | |
} | |
u.pt(a, e) | |
} else { | |
u.pt(a, b) | |
} | |
} | |
} else { | |
u.k('Unknown initializer "' + b + '" for object being constructed by GraphObject.make: ' + a) | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
var Sl = new la("string", "function"); | |
T.getBuilders = function() { | |
var a = new la("string", "function"), | |
b; | |
for (b in Sl) { | |
if (b !== b.toLowerCase()) { | |
var c = Sl[b]; | |
"function" === typeof c && a.add(b, c) | |
} | |
} | |
a.freeze(); | |
return a | |
}; | |
var Dm; | |
T.defineBuilder = Dm = function(a, b) { | |
u.j(a, "string", T, "defineBuilder:name"); | |
u.j(b, "function", T, "defineBuilder:func"); | |
var c = a.toLowerCase(); | |
"" !== a && "none" !== c && a !== c || u.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: " + a); | |
Sl.add(a, b) | |
}; | |
var Em; | |
T.takeBuilderArgument = Em = 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 | |
}; | |
Dm("Button", function() { | |
var a = new ga(ue); | |
a.addColorStop(0, "white"); | |
a.addColorStop(1, "lightgray"); | |
var b = new ga(ue); | |
b.addColorStop(0, "white"); | |
b.addColorStop(1, "dodgerblue"); | |
a = Rl(B, Yi, { | |
qz: !0 | |
}, { | |
_buttonFillNormal: a, | |
_buttonStrokeNormal: "gray", | |
_buttonFillOver: b, | |
_buttonStrokeOver: "blue" | |
}, Rl(X, { | |
name: "ButtonBorder", | |
Fb: "Rectangle", | |
A: new L(0, 0, 2.761423749153968, 2.761423749153968), | |
B: new L(1, 1, -2.761423749153968, -2.761423749153968), | |
fill: a, | |
stroke: "gray" | |
})); | |
a.$D = function(a, b) { | |
var e = b.ke("ButtonBorder"); | |
if (e instanceof X) { | |
var f = b._buttonFillOver; | |
b._buttonFillNormal = e.fill; | |
e.fill = f; | |
f = b._buttonStrokeOver; | |
b._buttonStrokeNormal = e.stroke; | |
e.stroke = f | |
} | |
}; | |
a.aE = function(a, b) { | |
var e = b.ke("ButtonBorder"); | |
e instanceof X && (e.fill = b._buttonFillNormal, e.stroke = b._buttonStrokeNormal) | |
}; | |
return a | |
}); | |
Dm("TreeExpanderButton", function() { | |
var a = Rl("Button", { | |
_treeExpandedFigure: "MinusLine", | |
_treeCollapsedFigure: "PlusLine" | |
}, Rl(X, { | |
name: "ButtonIcon", | |
Fb: "MinusLine", | |
za: K.op | |
}, (new bf("figure", "isTreeExpanded", function(a, c) { | |
var d = c.P; | |
return a ? d._treeExpandedFigure : d._treeCollapsedFigure | |
})).tw()), { | |
visible: !1 | |
}, (new bf("visible", "isTreeLeaf", function(a) { | |
return !a | |
})).tw()); | |
a.click = function(a, c) { | |
var d = c.W; | |
d instanceof lf && (d = d.Mh); | |
if (d instanceof U) { | |
var e = d.g; | |
if (null !== e) { | |
e = e.Eb; | |
if (d.Wc) { | |
if (!e.canCollapseTree(d)) { | |
return | |
} | |
} else { | |
if (!e.canExpandTree(d)) { | |
return | |
} | |
} | |
a.Tc = !0; | |
d.Wc ? e.collapseTree(d) : e.expandTree(d) | |
} | |
} | |
}; | |
return a | |
}); | |
Dm("SubGraphExpanderButton", function() { | |
var a = Rl("Button", { | |
_subGraphExpandedFigure: "MinusLine", | |
_subGraphCollapsedFigure: "PlusLine" | |
}, Rl(X, { | |
name: "ButtonIcon", | |
Fb: "MinusLine", | |
za: K.op | |
}, (new bf("figure", "isSubGraphExpanded", function(a, c) { | |
var d = c.P; | |
return a ? d._subGraphExpandedFigure : d._subGraphCollapsedFigure | |
})).tw())); | |
a.click = function(a, c) { | |
var d = c.W; | |
d instanceof lf && (d = d.Mh); | |
if (d instanceof V) { | |
var e = d.g; | |
if (null !== e) { | |
e = e.Eb; | |
if (d.ce) { | |
if (!e.canCollapseSubGraph(d)) { | |
return | |
} | |
} else { | |
if (!e.canExpandSubGraph(d)) { | |
return | |
} | |
} | |
a.Tc = !0; | |
d.ce ? e.collapseSubGraph(d) : e.expandSubGraph(d) | |
} | |
} | |
}; | |
return a | |
}); | |
Dm("ContextMenuButton", function() { | |
var a = Rl("Button"); | |
a.stretch = fl; | |
var b = a.ke("ButtonBorder"); | |
b instanceof X && (b.Fb = "Rectangle", b.A = new L(0, 0, 2, 3), b.B = new L(1, 1, -2, -2)); | |
return a | |
}); | |
Dm("PanelExpanderButton", function(a) { | |
var b = Em(a, "COLLAPSIBLE"); | |
a = Rl("Button", Rl(X, "TriangleUp", { | |
za: new ia(6, 4) | |
}, (new bf("figure", "visible", function(a) { | |
return a ? "TriangleUp" : "TriangleDown" | |
})).tw(b))); | |
var c = a.ke("ButtonBorder"); | |
c instanceof X && (c.stroke = null, c.fill = "transparent"); | |
a.click = function(a, c) { | |
var f = c.g; | |
if (null !== f) { | |
var h = c.W.ke(b); | |
null !== h && (f.Xb("Collapse/Expand Panel"), h.visible = !h.visible, f.Xd("Collapse/Expand Panel")) | |
} | |
}; | |
return a | |
}); | |
function hl() { | |
this.$h = this.ui = this.rp = this.vp = this.tp = this.sp = this.ki = this.Sq = this.Rq = this.li = this.mi = this.ni = this.Uq = this.Tq = this.Zh = this.di = this.Xh = null | |
} | |
hl.prototype.copy = function() { | |
var a = new hl; | |
a.Xh = this.Xh; | |
a.di = this.di; | |
a.Zh = this.Zh; | |
a.Tq = this.Tq; | |
a.Uq = this.Uq; | |
a.ni = this.ni; | |
a.mi = this.mi; | |
a.li = this.li; | |
a.Rq = this.Rq; | |
a.Sq = this.Sq; | |
a.ki = this.ki; | |
a.sp = this.sp; | |
a.tp = this.tp; | |
a.vp = this.vp; | |
a.rp = this.rp; | |
a.ui = this.ui; | |
a.$h = this.$h; | |
return a | |
}; | |
function B(a) { | |
T.call(this); | |
void 0 === a ? 0 === arguments.length ? this.pa = vh : u.k("invalid argument to Panel constructor: undefined") : (u.rb(a, B, B, "type"), this.pa = a); | |
this.Aa = new E(T); | |
this.Qe = K.pp; | |
this.Mg = !1; | |
this.pa === bj && (this.Mg = !0); | |
this.iq = !1; | |
this.Op = uc; | |
this.ci = dl; | |
this.pa === Fl && Fm(this); | |
this.lo = sh; | |
this.cq = (new ia(10, 10)).freeze(); | |
this.dq = K.Wj; | |
this.Cl = this.sh = null; | |
this.wq = NaN; | |
this.ag = this.hi = null; | |
this.Jn = "category"; | |
this.$f = null; | |
this.wi = new z(NaN, NaN, NaN, NaN); | |
this.lm = null; | |
this.zh = !1; | |
this.zr = null | |
} | |
u.Ha(B, T); | |
u.Nh(B); | |
u.fa("Panel", B); | |
function Fm(a) { | |
a.Xi = K.pp; | |
a.vh = 1; | |
a.bi = null; | |
a.Hl = null; | |
a.uh = 1; | |
a.th = null; | |
a.Gl = null; | |
a.Ad = []; | |
a.td = []; | |
a.em = Gm; | |
a.El = Gm; | |
a.vi = 0; | |
a.ii = 0 | |
} | |
B.prototype.cloneProtected = function(a) { | |
T.prototype.cloneProtected.call(this, a); | |
a.pa = this.pa; | |
a.Qe = this.Qe.Z(); | |
a.Mg = this.Mg; | |
a.iq = this.iq; | |
a.Op = this.Op.Z(); | |
a.ci = this.ci; | |
if (a.pa === Fl) { | |
a.Xi = this.Xi.Z(); | |
a.vh = this.vh; | |
a.bi = this.bi; | |
a.Hl = this.Hl; | |
a.uh = this.uh; | |
a.th = this.th; | |
a.Gl = this.Gl; | |
var b = []; | |
if (0 < this.Ad.length) { | |
for (var c = this.Ad, d = c.length, e = 0; e < d; e++) { | |
if (void 0 !== c[e]) { | |
var f = c[e].copy(); | |
f.rl(a); | |
b[e] = f | |
} | |
} | |
} | |
a.Ad = b; | |
b = []; | |
if (0 < this.td.length) { | |
for (c = this.td, d = c.length, e = 0; e < d; e++) { | |
void 0 !== c[e] && (f = c[e].copy(), f.rl(a), b[e] = f) | |
} | |
} | |
a.td = b; | |
a.em = this.em; | |
a.El = this.El; | |
a.vi = this.vi; | |
a.ii = this.ii | |
} | |
a.lo = this.lo; | |
a.cq.assign(this.cq); | |
a.dq = this.dq.Z(); | |
a.sh = this.sh; | |
a.Cl = this.Cl; | |
a.wq = this.wq; | |
a.hi = this.hi; | |
a.ag = this.ag; | |
a.Jn = this.Jn; | |
a.wi.assign(this.wi); | |
a.zh = this.zh; | |
null !== this.zr && (a.zr = this.zr) | |
}; | |
B.prototype.Oh = function(a) { | |
T.prototype.Oh.call(this, a); | |
a.Aa = this.Aa; | |
for (var b = a.Aa.n, c = b.length, d = 0; d < c; d++) { | |
b[d].Rg = a | |
} | |
a.lm = null | |
}; | |
B.prototype.copy = function() { | |
var a = T.prototype.copy.call(this); | |
if (null !== a) { | |
for (var b = this.Aa.n, c = b.length, d = 0; d < c; d++) { | |
var e = b[d].copy(), | |
f = a; | |
e.rl(f); | |
e.$l = null; | |
var h = f.Aa, | |
k = h.count; | |
h.Zd(k, e); | |
h = f.W; | |
if (null !== h) { | |
h.Bk = null; | |
null !== e.Kd && h instanceof U && (h.zh = !0); | |
var l = f.g; | |
null !== l && l.ga.fb || h.Cc(be, "elements", f, null, e, null, k) | |
} | |
} | |
return a | |
} | |
return null | |
}; | |
B.prototype.toString = function() { | |
return "Panel(" + this.type + ")#" + u.Uc(this) | |
}; | |
var vh; | |
B.Position = vh = u.s(B, "Position", 0); | |
B.Horizontal = u.s(B, "Horizontal", 1); | |
var Xi; | |
B.Vertical = Xi = u.s(B, "Vertical", 2); | |
var oh; | |
B.Spot = oh = u.s(B, "Spot", 3); | |
var Yi; | |
B.Auto = Yi = u.s(B, "Auto", 4); | |
var Fl; | |
B.Table = Fl = u.s(B, "Table", 5); | |
B.Viewbox = u.s(B, "Viewbox", 6); | |
var tl; | |
B.TableRow = tl = u.s(B, "TableRow", 7); | |
var ul; | |
B.TableColumn = ul = u.s(B, "TableColumn", 8); | |
var ah; | |
B.Link = ah = u.s(B, "Link", 9); | |
var bj; | |
B.Grid = bj = u.s(B, "Grid", 10); | |
u.defineProperty(B, { | |
type: "type" | |
}, function() { | |
return this.pa | |
}, function(a) { | |
var b = this.pa; | |
b !== a && (b !== tl && b !== ul || u.k("Cannot change Panel.type when it is already a TableRow or a TableColumn: " + a), this.pa = a, this.pa === bj ? this.Mg = !0 : this.pa === Fl && Fm(this), this.S(), this.h("type", b, a)) | |
}); | |
u.u(B, { | |
elements: "elements" | |
}, function() { | |
return this.Aa.i | |
}); | |
u.u(B, { | |
Ja: "naturalBounds" | |
}, function() { | |
return this.Gc | |
}); | |
u.defineProperty(B, { | |
padding: "padding" | |
}, function() { | |
return this.Qe | |
}, function(a) { | |
"number" === typeof a ? (0 > a && u.xa(a, ">= 0", B, "padding"), a = new rb(a)) : (u.C(a, rb, B, "padding"), 0 > a.left && u.xa(a.left, ">= 0", B, "padding:value.left"), 0 > a.right && u.xa(a.right, ">= 0", B, "padding:value.right"), 0 > a.top && u.xa(a.top, ">= 0", B, "padding:value.top"), 0 > a.bottom && u.xa(a.bottom, ">= 0", B, "padding:value.bottom")); | |
var b = this.Qe; | |
b.L(a) || (this.Qe = a = a.Z(), this.S(), this.h("padding", b, a)) | |
}); | |
u.defineProperty(B, { | |
Tk: "defaultAlignment" | |
}, function() { | |
return this.Op | |
}, function(a) { | |
var b = this.Op; | |
b.L(a) || (this.Op = a = a.Z(), this.S(), this.h("defaultAlignment", b, a)) | |
}); | |
u.defineProperty(B, { | |
Dd: "defaultStretch" | |
}, function() { | |
return this.ci | |
}, function(a) { | |
var b = this.ci; | |
b !== a && (u.rb(a, T, B, "defaultStretch"), this.ci = a, this.S(), this.h("defaultStretch", b, a)) | |
}); | |
u.defineProperty(B, { | |
vJ: "defaultSeparatorPadding" | |
}, function() { | |
return void 0 === this.Xi ? K.pp : this.Xi | |
}, function(a) { | |
if (void 0 !== this.Xi) { | |
"number" === typeof a && (a = new rb(a)); | |
var b = this.Xi; | |
b.L(a) || (this.Xi = a = a.Z(), this.h("defaultSeparatorPadding", b, a)) | |
} | |
}); | |
u.defineProperty(B, { | |
tJ: "defaultRowSeparatorStroke" | |
}, function() { | |
return void 0 === this.bi ? null : this.bi | |
}, function(a) { | |
var b = this.bi; | |
b !== a && (null === a || "string" === typeof a || a instanceof ga) && (a instanceof ga && a.freeze(), this.bi = a, this.h("defaultRowSeparatorStroke", b, a)) | |
}); | |
u.defineProperty(B, { | |
uJ: "defaultRowSeparatorStrokeWidth" | |
}, function() { | |
return void 0 === this.vh ? 1 : this.vh | |
}, function(a) { | |
if (void 0 !== this.vh) { | |
var b = this.vh; | |
b !== a && isFinite(a) && 0 <= a && (this.vh = a, this.h("defaultRowSeparatorStrokeWidth", b, a)) | |
} | |
}); | |
u.defineProperty(B, { | |
sJ: "defaultRowSeparatorDashArray" | |
}, function() { | |
return void 0 === this.Hl ? null : this.Hl | |
}, function(a) { | |
if (void 0 !== this.Hl) { | |
var b = this.Hl; | |
if (b !== a) { | |
null === a || Array.isArray(a) || u.Ld(a, "Array", B, "defaultRowSeparatorDashArray:value"); | |
if (null !== a) { | |
for (var c = a.length, d = 0, e = 0; e < c; e++) { | |
var f = a[e]; | |
"number" === typeof f && 0 <= f && isFinite(f) || u.k("defaultRowSeparatorDashArray:value " + f + " must be a positive number or zero."); | |
d += f | |
} | |
if (0 === d) { | |
if (null === b) { | |
return | |
} | |
a = null | |
} | |
} | |
this.Hl = a; | |
this.na(); | |
this.h("defaultRowSeparatorDashArray", b, a) | |
} | |
} | |
}); | |
u.defineProperty(B, { | |
nJ: "defaultColumnSeparatorStroke" | |
}, function() { | |
return void 0 === this.th ? null : this.th | |
}, function(a) { | |
if (void 0 !== this.th) { | |
var b = this.th; | |
b !== a && (null === a || "string" === typeof a || a instanceof ga) && (a instanceof ga && a.freeze(), this.th = a, this.h("defaultColumnSeparatorStroke", b, a)) | |
} | |
}); | |
u.defineProperty(B, { | |
oJ: "defaultColumnSeparatorStrokeWidth" | |
}, function() { | |
return void 0 === this.uh ? 1 : this.uh | |
}, function(a) { | |
if (void 0 !== this.uh) { | |
var b = this.uh; | |
b !== a && isFinite(a) && 0 <= a && (this.uh = a, this.h("defaultColumnSeparatorStrokeWidth", b, a)) | |
} | |
}); | |
u.defineProperty(B, { | |
mJ: "defaultColumnSeparatorDashArray" | |
}, function() { | |
return void 0 === this.Gl ? null : this.Gl | |
}, function(a) { | |
if (void 0 !== this.Gl) { | |
var b = this.Gl; | |
if (b !== a) { | |
null === a || Array.isArray(a) || u.Ld(a, "Array", B, "defaultColumnSeparatorDashArray:value"); | |
if (null !== a) { | |
for (var c = a.length, d = 0, e = 0; e < c; e++) { | |
var f = a[e]; | |
"number" === typeof f && 0 <= f && isFinite(f) || u.k("defaultColumnSeparatorDashArray:value " + f + " must be a positive number or zero."); | |
d += f | |
} | |
if (0 === d) { | |
if (null === b) { | |
return | |
} | |
a = null | |
} | |
} | |
this.Gl = a; | |
this.na(); | |
this.h("defaultColumnSeparatorDashArray", b, a) | |
} | |
} | |
}); | |
u.defineProperty(B, { | |
HK: "viewboxStretch" | |
}, function() { | |
return this.lo | |
}, function(a) { | |
var b = this.lo; | |
b !== a && (u.rb(a, T, B, "viewboxStretch"), this.lo = a, this.h("viewboxStretch", b, a)) | |
}); | |
u.defineProperty(B, { | |
aw: "gridCellSize" | |
}, function() { | |
return this.cq | |
}, function(a) { | |
var b = this.cq; | |
b.L(a) || (u.C(a, ia, B, "gridCellSize"), a.I() && 0 !== a.width && 0 !== a.height || u.k("Invalid Panel.gridCellSize: " + a), this.cq = a.Z(), null !== this.g && this === this.g.Hs && vj(this.g), this.na(), this.h("gridCellSize", b, a)) | |
}); | |
u.defineProperty(B, { | |
CD: "gridOrigin" | |
}, function() { | |
return this.dq | |
}, function(a) { | |
var b = this.dq; | |
b.L(a) || (u.C(a, w, B, "gridOrigin"), a.I() || u.k("Invalid Panel.gridOrigin: " + a), this.dq = a.Z(), null !== this.g && vj(this.g), this.na(), this.h("gridOrigin", b, a)) | |
}); | |
g = B.prototype; | |
g.Su = function(a) { | |
T.prototype.Su.call(this, a); | |
for (var b = this.Aa.n, c = b.length, d = 0; d < c; d++) { | |
b[d].Su(a) | |
} | |
}; | |
g.Mj = function(a, b) { | |
if (this.pa === bj) { | |
var c = this.Ii() * b.scale; | |
0 >= c && (c = 1); | |
var d = this.aw, | |
e = d.width, | |
d = d.height, | |
f = this.Ja, | |
h = f.width, | |
f = f.height, | |
k = Math.ceil(h / e), | |
l = Math.ceil(f / d), | |
m = this.CD; | |
a.save(); | |
a.beginPath(); | |
a.rect(0, 0, h, f); | |
a.clip(); | |
for (var n = [], p = this.Aa.n, q = p.length, r = 0; r < q; r++) { | |
var s = p[r], | |
t = []; | |
n.push(t); | |
if (s.visible) { | |
for (var s = hk(s.Fb), v = r + 1; v < q; v++) { | |
var x = p[v]; | |
x.visible && hk(x.Fb) === s && (x = x.interval, 2 <= x && t.push(x)) | |
} | |
} | |
} | |
p = this.Aa.n; | |
q = p.length; | |
for (r = 0; r < q; r++) { | |
var A = p[r]; | |
if (A.visible) { | |
var t = n[r], | |
s = A.interval, | |
v = !1, | |
y = !0, | |
C = A.hA; | |
null !== C && (v = !0, void 0 !== a.setLineDash ? (a.setLineDash(C), a.lineDashOffset = A.ed) : void 0 !== a.webkitLineDash ? (a.webkitLineDash = C, a.webkitLineDashOffset = A.ed) : void 0 !== a.mozDash ? (a.mozDash = C, a.mozDashOffset = A.ed) : y = !1); | |
if ("LineV" === A.Fb) { | |
a.lineWidth = A.jb; | |
yl(this, a, A.stroke, !1, !1); | |
a.beginPath(); | |
for (var I = x = Math.floor(-m.x / e); I <= x + k; I++) { | |
var H = I * e + m.x; | |
if (0 <= H && H < h && Hm(I, s, t) && (v && !y ? kl(a, H, 0, H, f, C, A.ed) : (a.moveTo(H, 0), a.lineTo(H, f)), 2 > e * s * c)) { | |
break | |
} | |
} | |
a.stroke() | |
} else { | |
if ("LineH" === A.Fb) { | |
a.lineWidth = A.jb; | |
yl(this, a, A.stroke, !1, !1); | |
a.beginPath(); | |
for (I = x = Math.floor(-m.y / d); I <= x + l && !(H = I * d + m.y, 0 <= H && H <= f && Hm(I, s, t) && (v && !y ? kl(a, 0, H, h, H, C, A.ed) : (a.moveTo(0, H), a.lineTo(h, H)), 2 > d * s * c)); I++) {} | |
a.stroke() | |
} else { | |
if ("BarV" === A.Fb) { | |
for (yl(this, a, A.fill, !0, !1), A = A.width, isNaN(A) && (A = e), I = x = Math.floor(-m.x / e); I <= x + k && !(H = I * e + m.x, 0 <= H && H < h && Hm(I, s, t) && (a.fillRect(H, 0, A, f), 2 > e * s * c)); I++) {} | |
} else { | |
if ("BarH" === A.Fb) { | |
for (yl(this, a, A.fill, !0, !1), A = A.height, isNaN(A) && (A = d), I = x = Math.floor(-m.y / d); I <= x + l && !(H = I * d + m.y, 0 <= H && H <= f && Hm(I, s, t) && (a.fillRect(0, H, h, A), 2 > d * s * c)); I++) {} | |
} | |
} | |
} | |
} | |
v && (void 0 !== a.setLineDash ? (a.setLineDash(u.nh), a.lineDashOffset = 0) : void 0 !== a.webkitLineDash ? (a.webkitLineDash = u.nh, a.webkitLineDashOffset = 0) : void 0 !== a.mozDash && (a.mozDash = null, a.mozDashOffset = 0)) | |
} | |
} | |
a.restore(); | |
$i(b, a, !1) | |
} else { | |
this.pa === Fl && (a.lineCap = "butt", Im(this, a, !0, this.Ad, !0), Im(this, a, !1, this.td, !0), Jm(this, a, !0, this.Ad), Jm(this, a, !1, this.td), Im(this, a, !0, this.Ad, !1), Im(this, a, !1, this.td, !1)); | |
(c = this.LD) && a.save(); | |
e = this.Jf(); | |
d = this.Aa.n; | |
h = d.length; | |
for (f = 0; f < h; f++) { | |
k = d[f], c && k === e && (a.Gt = !0), k.Xe(a, b), c && k === e && (a.Gt = !1) | |
} | |
c && (a.restore(), $i(b, a, !1)) | |
} | |
}; | |
function Jm(a, b, c, d) { | |
for (var e = d.length, f = a.ca, h = c ? a.hd(0) : a.gd(0), k = 0; k < e; k++) { | |
var l = d[k]; | |
if (void 0 !== l && l !== h && 0 !== l.Ra) { | |
var m = l.gp; | |
isNaN(m) && (m = c ? a.vh : a.uh); | |
var n = l.fp; | |
null === n && (n = c ? a.bi : a.th); | |
if (0 !== m && null !== n) { | |
yl(a, b, n, !1, !1); | |
var n = !1, | |
p = !0, | |
q = l.iI; | |
null !== q && (n = !0, void 0 !== b.setLineDash ? (b.setLineDash(q), b.lineDashOffset = a.ed) : void 0 !== b.webkitLineDash ? (b.webkitLineDash = q, b.webkitLineDashOffset = a.ed) : void 0 !== b.mozDash ? (b.mozDash = q, b.mozDashOffset = a.ed) : p = !1); | |
b.beginPath(); | |
var r = l.position + m; | |
c ? r > f.height && (m -= r - f.height) : r > f.width && (m -= r - f.width); | |
l = l.position + m / 2; | |
b.lineWidth = m; | |
r = a.padding; | |
c ? (l += r.top, m = r.left, r = f.width - r.right, n && !p ? kl(b, m, l, r, l, q, 0) : (b.moveTo(m, l), b.lineTo(r, l))) : (l += r.left, m = r.top, r = f.height - r.bottom, n && !p ? kl(b, l, m, l, r, q, 0) : (b.moveTo(l, m), b.lineTo(l, r))); | |
b.stroke(); | |
n && (void 0 !== b.setLineDash ? (b.setLineDash(u.nh), b.lineDashOffset = 0) : void 0 !== b.webkitLineDash ? (b.webkitLineDash = u.nh, b.webkitLineDashOffset = 0) : void 0 !== b.mozDash && (b.mozDash = null, b.mozDashOffset = 0)) | |
} | |
} | |
} | |
} | |
function Im(a, b, c, d, e) { | |
for (var f = d.length, h = a.ca, k = 0; k < f; k++) { | |
var l = d[k]; | |
if (void 0 !== l && null !== l.background && l.$y !== e && 0 !== l.Ra) { | |
var m = c ? h.height : h.width; | |
if (!(l.position > m)) { | |
var n = l.ng(), | |
p = l.gp; | |
isNaN(p) && (p = c ? a.vh : a.uh); | |
var q = l.fp; | |
null === q && (q = c ? a.bi : a.th); | |
null === q && (p = 0); | |
n -= p; | |
p = l.position + p; | |
n += l.Ra; | |
p + n > m && (n = m - p); | |
0 >= n || (m = a.padding, yl(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 Hm(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 hk(a) { | |
return "LineV" === a || "BarV" === a | |
} | |
g.Fo = function(a, b, c, d, e) { | |
var f = this.Uf(), | |
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.rm) { | |
return h = this.ca, K.bl(h.left, h.top, h.right, h.bottom, a, b, c, d, e) | |
} | |
if (null !== this.background) { | |
f = a * l + b * n + q, k = a * m + b * p + r, a = c * l + d * n + q, c = c * m + d * p + r, e.m(0, 0), d = this.Ja, c = K.bl(0, 0, d.width, d.height, f, k, a, c, e), e.transform(h) | |
} else { | |
f || (l = 1, n = m = 0, p = 1, r = q = 0); | |
k = a * l + b * n + q; | |
a = a * m + b * p + r; | |
l = c * l + d * n + q; | |
d = c * m + d * p + r; | |
e.m(l, d); | |
m = (l - k) * (l - k) + (d - a) * (d - a); | |
c = !1; | |
p = this.Aa.n; | |
r = p.length; | |
n = u.K(); | |
for (q = 0; q < r; q++) { | |
b = p[q], b.visible && b.Fo(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))) | |
} | |
u.v(n); | |
f && e.transform(h) | |
} | |
return c | |
}; | |
g.S = function(a) { | |
T.prototype.S.call(this, a); | |
this.pa === Yi && (a = this.Jf(), null !== a && a.S(!0)); | |
a = this.Aa.n; | |
for (var b = a.length, c = 0; c < b; c++) { | |
var d = a[c]; | |
!0 !== Aj(d) && (d.za.I() || (d instanceof ph || d instanceof B || d instanceof qa || pl(d, !1) !== qh) && d.S(!0)) | |
} | |
}; | |
g.Io = function() { | |
if (!1 === Aj(this)) { | |
uj(this, !0); | |
rl(this, !0); | |
for (var a = this.Aa.n, b = a.length, c = 0; c < b; c++) { | |
a[c].Io() | |
} | |
} | |
}; | |
g.Lg = function() { | |
if (0 !== (this.ea & 2048) === !1) { | |
Cl(this, !0); | |
Dl(this, !0); | |
for (var a = this.Aa.n, b = a.length, c = 0; c < b; c++) { | |
a[c].nz() | |
} | |
} | |
}; | |
g.nz = function() { | |
Dl(this, !0); | |
for (var a = this.Aa.n, b = a.length, c = 0; c < b; c++) { | |
a[c].nz() | |
} | |
}; | |
g.Qo = function(a, b, c, d) { | |
var e = this.wi; | |
e.width = 0; | |
e.height = 0; | |
var f = this.za, | |
h = this.xg; | |
void 0 === c && (c = h.width, d = h.height); | |
c = Math.max(c, h.width); | |
d = Math.max(d, h.height); | |
var k = this.cf; | |
isNaN(f.width) || (a = Math.min(f.width, k.width)); | |
isNaN(f.height) || (b = Math.min(f.height, k.height)); | |
a = Math.max(c, a); | |
b = Math.max(d, b); | |
var l = this.padding; | |
a = Math.max(a - l.left - l.right, 0); | |
b = Math.max(b - l.top - l.bottom, 0); | |
var m = this.Aa.n; | |
if (0 !== m.length) { | |
var n = this.pa.Vb; | |
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.fc) { | |
var A = x.margin, | |
y = A.right + A.left, | |
C = A.top + A.bottom; | |
Ph(x, p, q, r, s); | |
var I = x.Ca, | |
H = Math.max(I.width + y, 0), | |
R = Math.max(I.height + C, 0), | |
aa = x.position.x, | |
S = x.position.y; | |
isFinite(aa) || (aa = 0); | |
isFinite(S) || (S = 0); | |
if (x instanceof X) { | |
var N = x; | |
if (N.sz) { | |
var Z = N.jb / 2, | |
aa = aa - Z, | |
S = S - Z | |
} | |
} | |
kb(e, aa, S, H, R) | |
} | |
} | |
break; | |
case "Vertical": | |
for (var Ga = a, ua = c, Oa = m.length, na = u.hb(), Ba = 0; Ba < Oa; Ba++) { | |
var ra = m[Ba]; | |
if (ra.visible || ra === this.fc) { | |
var dc = pl(ra, !1); | |
if (dc !== qh && dc !== el) { | |
na.push(ra) | |
} else { | |
var ed = ra.margin, | |
Lf = ed.right + ed.left, | |
ec = ed.top + ed.bottom; | |
Ph(ra, Ga, Infinity, ua, 0); | |
var We = ra.Ca, | |
Mf = Math.max(We.width + Lf, 0), | |
Ta = Math.max(We.height + ec, 0); | |
e.width = Math.max(e.width, Mf); | |
e.height += Ta | |
} | |
} | |
} | |
var db = na.length; | |
if (0 !== db) { | |
this.za.width ? Ga = Math.min(this.za.width, this.cf.width) : 0 !== e.width && (Ga = Math.min(e.width, this.cf.width)); | |
for (Ba = 0; Ba < db; Ba++) { | |
if (ra = na[Ba], ra.visible || ra === this.fc) { | |
ed = ra.margin, Lf = ed.right + ed.left, ec = ed.top + ed.bottom, Ph(ra, Ga, Infinity, ua, 0), We = ra.Ca, Mf = Math.max(We.width + Lf, 0), Ta = Math.max(We.height + ec, 0), e.width = Math.max(e.width, Mf), e.height += Ta | |
} | |
} | |
u.sa(na) | |
} | |
break; | |
case "Horizontal": | |
for (var wa = b, za = d, lb = m.length, Eb = u.hb(), $a = 0; $a < lb; $a++) { | |
var jc = m[$a]; | |
if (jc.visible || jc === this.fc) { | |
var ge = pl(jc, !1); | |
if (ge !== qh && ge !== fl) { | |
Eb.push(jc) | |
} else { | |
var nc = jc.margin, | |
Pd = nc.right + nc.left, | |
he = nc.top + nc.bottom; | |
Ph(jc, Infinity, wa, 0, za); | |
var Xe = jc.Ca, | |
pf = Math.max(Xe.width + Pd, 0), | |
Qd = Math.max(Xe.height + he, 0); | |
e.width += pf; | |
e.height = Math.max(e.height, Qd) | |
} | |
} | |
} | |
var Fb = Eb.length; | |
if (0 !== Fb) { | |
this.za.height ? wa = Math.min(this.za.height, this.cf.height) : 0 !== e.height && (wa = Math.min(e.height, this.cf.height)); | |
for ($a = 0; $a < Fb; $a++) { | |
if (jc = Eb[$a], jc.visible || jc === this.fc) { | |
nc = jc.margin, Pd = nc.right + nc.left, he = nc.top + nc.bottom, Ph(jc, Infinity, wa, 0, za), Xe = jc.Ca, pf = Math.max(Xe.width + Pd, 0), Qd = Math.max(Xe.height + he, 0), e.width += pf, e.height = Math.max(e.height, Qd) | |
} | |
} | |
u.sa(Eb) | |
} | |
break; | |
case "Spot": | |
a: { | |
var Kb = a, | |
Fc = b, | |
Mg = c, | |
Lb = d, | |
yb = m.length, | |
fc = this.Jf(), | |
mb = fc.margin, | |
ye = 0, | |
Rd = 0, | |
og = mb.right + mb.left, | |
Nf = mb.top + mb.bottom;Ph(fc, Kb, Fc, Mg, Lb); | |
var zb = fc.Ca, | |
fd = zb.width, | |
oc = zb.height, | |
wb = Math.max(fd + og, 0), | |
Gc = Math.max(oc + Nf, 0);e.x = -mb.left;e.y = -mb.top;e.width = wb;e.height = Gc; | |
for (var Mb = 0; Mb < yb; Mb++) { | |
var Na = m[Mb]; | |
if (Na !== fc && (Na.visible || Na === this.fc)) { | |
mb = Na.margin; | |
ye = mb.right + mb.left; | |
Rd = mb.top + mb.bottom; | |
Ph(Na, Kb, Fc, 0, 0); | |
var zb = Na.Ca, | |
wb = Math.max(zb.width + ye, 0), | |
Gc = Math.max(zb.height + Rd, 0), | |
eb = Na.alignment; | |
eb.Kc() && (eb = this.Tk); | |
eb.Vc() || (eb = Ib); | |
var Ab = Na.Hj; | |
Ab.Kc() && (Ab = Ib); | |
kb(e, eb.x * fd + eb.offsetX - (Ab.x * zb.width - Ab.offsetX) - mb.left, eb.y * oc + eb.offsetY - (Ab.y * zb.height - Ab.offsetY) - mb.top, wb, Gc) | |
} | |
} | |
var gc = fc.stretch;gc === dl && (gc = pl(fc, !1)); | |
switch (gc) { | |
case qh: | |
break a; | |
case cd: | |
if (!isFinite(Kb) && !isFinite(Fc)) { | |
break a | |
} | |
break; | |
case fl: | |
if (!isFinite(Kb)) { | |
break a | |
} | |
break; | |
case el: | |
if (!isFinite(Fc)) { | |
break a | |
} | |
} | |
zb = fc.Ca;fd = zb.width;oc = zb.height;wb = Math.max(fd + og, 0);Gc = Math.max(oc + Nf, 0);mb = fc.margin;e.x = -mb.left;e.y = -mb.top;e.width = wb;e.height = Gc; | |
for (Mb = 0; Mb < yb; Mb++) { | |
Na = m[Mb], Na === fc || !Na.visible && Na !== this.fc || (mb = Na.margin, ye = mb.right + mb.left, Rd = mb.top + mb.bottom, zb = Na.Ca, wb = Math.max(zb.width + ye, 0), Gc = Math.max(zb.height + Rd, 0), eb = Na.alignment, eb.Kc() && (eb = this.Tk), eb.Vc() || (eb = Ib), Ab = Na.Hj, Ab.Kc() && (Ab = Ib), kb(e, eb.x * fd + eb.offsetX - (Ab.x * zb.width - Ab.offsetX) - mb.left, eb.y * oc + eb.offsetY - (Ab.y * zb.height - Ab.offsetY) - mb.top, wb, Gc)) | |
} | |
} | |
break; | |
case "Auto": | |
var Sd = a, | |
Td = b, | |
qf = c, | |
ze = d, | |
rf = m.length, | |
Rb = this.Jf(), | |
cb = Rb.margin, | |
pc = cb.right + cb.left, | |
Pc = cb.top + cb.bottom; | |
Ph(Rb, Sd, Td, qf, ze); | |
var gd = Rb.Ca, | |
ab = Math.max(gd.width + pc, 0), | |
ub = Math.max(gd.height + Pc, 0), | |
kc = Km(Rb), | |
hd = kc.x * ab + kc.offsetX, | |
Ng = kc.y * ub + kc.offsetY, | |
kc = Lm(Rb), | |
Og = kc.x * ab + kc.offsetX, | |
Pg = kc.y * ub + kc.offsetY, | |
Of = Sd, | |
Hc = Td; | |
isFinite(Sd) && (Of = Math.abs(hd - Og)); | |
isFinite(Td) && (Hc = Math.abs(Ng - Pg)); | |
var Qc = u.vl(); | |
Qc.m(0, 0); | |
for (var Ic = 0; Ic < rf; Ic++) { | |
var nb = m[Ic]; | |
if (nb !== Rb && (nb.visible || nb === this.fc)) { | |
var cb = nb.margin, | |
ie = cb.right + cb.left, | |
ob = cb.top + cb.bottom; | |
Ph(nb, Of, Hc, 0, 0); | |
gd = nb.Ca; | |
ab = Math.max(gd.width + ie, 0); | |
ub = Math.max(gd.height + ob, 0); | |
Qc.m(Math.max(ab, Qc.width), Math.max(ub, Qc.height)) | |
} | |
} | |
if (1 === rf) { | |
e.width = ab, e.height = ub, u.Oj(Qc) | |
} else { | |
var yc = Km(Rb), | |
Ae = Lm(Rb), | |
Bb = 0, | |
Cb = 0; | |
Ae.x !== yc.x && Ae.y !== yc.y && (Bb = Qc.width / Math.abs(Ae.x - yc.x), Cb = Qc.height / Math.abs(Ae.y - yc.y)); | |
u.Oj(Qc); | |
var id = 0; | |
if (Rb instanceof X) { | |
var Rc = Rb, | |
id = Rc.jb * Rc.scale; | |
rh(Rc) === sh && (Bb = Cb = Math.max(Bb, Cb)) | |
} | |
var Bb = Bb + (Math.abs(yc.offsetX) + Math.abs(Ae.offsetX) + id), | |
Cb = Cb + (Math.abs(yc.offsetY) + Math.abs(Ae.offsetY) + id), | |
Ud = Rb.stretch; | |
Ud === dl && (Ud = pl(Rb, !1)); | |
switch (Ud) { | |
case qh: | |
ze = qf = 0; | |
break; | |
case cd: | |
isFinite(Sd) && (Bb = Sd); | |
isFinite(Td) && (Cb = Td); | |
break; | |
case fl: | |
isFinite(Sd) && (Bb = Sd); | |
ze = 0; | |
break; | |
case el: | |
qf = 0, isFinite(Td) && (Cb = Td) | |
} | |
Rb instanceof X && !Rb.za.I() && (Rc = Rb, Rc.Tg ? Rc.jk = null : Rc.Qa = null); | |
Rb.Io(); | |
Ph(Rb, Bb, Cb, qf, ze); | |
e.width = Rb.Ca.width + pc; | |
e.height = Rb.Ca.height + Pc | |
} | |
break; | |
case "Table": | |
for (var Vd = a, Ye = b, qm = c, yi = d, Ea = m.length, Be = u.hb(), Wd = u.hb(), ca = 0; ca < Ea; ca++) { | |
var ha = m[ca], | |
pg = ha instanceof B ? ha : null; | |
if (null === pg || pg.type !== tl && pg.type !== ul || !ha.visible) { | |
Be.push(ha) | |
} else { | |
Wd.push(ha); | |
for (var Qg = pg.Aa.n, zh = Qg.length, Sc = 0; Sc < zh; Sc++) { | |
var Ah = Qg[Sc]; | |
pg.type === tl ? Ah.rc = ha.rc : pg.type === ul && (Ah.column = ha.column); | |
Be.push(Ah) | |
} | |
} | |
} | |
Ea = Be.length; | |
0 === Ea && (this.hd(0), this.gd(0)); | |
for (var Sb = [], ca = 0; ca < Ea; ca++) { | |
ha = Be[ca], uj(ha, !0), rl(ha, !0), Sb[ha.rc] || (Sb[ha.rc] = []), Sb[ha.rc][ha.column] || (Sb[ha.rc][ha.column] = []), Sb[ha.rc][ha.column].push(ha) | |
} | |
u.sa(Be); | |
for (var Rg = u.hb(), Tc = u.hb(), je = u.hb(), Jc = { | |
count: 0 | |
}, jd = { | |
count: 0 | |
}, zc = Vd, kd = Ye, Pf = this.Ad, Ea = Pf.length, ca = 0; ca < Ea; ca++) { | |
var ba = Pf[ca]; | |
void 0 !== ba && (ba.Ra = 0) | |
} | |
Pf = this.td; | |
Ea = Pf.length; | |
for (ca = 0; ca < Ea; ca++) { | |
ba = Pf[ca], void 0 !== ba && (ba.Ra = 0) | |
} | |
for (var ke = Sb.length, Ce = 0, ca = 0; ca < ke; ca++) { | |
Sb[ca] && (Ce = Math.max(Ce, Sb[ca].length)) | |
} | |
for (var Tj = Math.min(this.vi, ke - 1), Uj = Math.min(this.ii, Ce - 1), Ac = 0, ke = Sb.length, ca = Tj; ca < ke; ca++) { | |
if (Sb[ca]) { | |
var Ce = Sb[ca].length, | |
fb = this.hd(ca); | |
fb.Ra = 0; | |
for (Sc = Uj; Sc < Ce; Sc++) { | |
if (Sb[ca][Sc]) { | |
var gb = this.gd(Sc); | |
void 0 === Rg[Sc] && (gb.Ra = 0, Rg[Sc] = !0); | |
for (var Vj = Sb[ca][Sc], Qf = Vj.length, qg = 0; qg < Qf; qg++) { | |
if (ha = Vj[qg], ha.visible || ha === this.fc) { | |
var rg = 1 < ha.tj || 1 < ha.Wi; | |
rg && Tc.push(ha); | |
var Nb = ha.margin, | |
Rf = Nb.right + Nb.left, | |
Sf = Nb.top + Nb.bottom, | |
Xd = Gl(ha, fb, gb, !1), | |
le = ha.za, | |
rm = !isNaN(le.height), | |
Bh = !isNaN(le.width) && rm; | |
rg || Xd === qh || Bh || (void 0 === Jc[Sc] && (Jc[Sc] = -1, Jc.count++), void 0 === jd[ca] && (jd[ca] = -1, jd.count++), je.push(ha)); | |
Ph(ha, Infinity, Infinity, 0, 0); | |
var De = ha.Ca, | |
Ze = Math.max(De.width + Rf, 0), | |
Cd = Math.max(De.height + Sf, 0); | |
1 !== ha.tj || Xd !== qh && Xd !== fl || (ba = this.hd(ca), Ac = Math.max(Cd - ba.Ra, 0), Ac > kd && (Ac = kd), ba.Ra += Ac, kd = Math.max(kd - Ac, 0)); | |
1 !== ha.Wi || Xd !== qh && Xd !== el || (ba = this.gd(Sc), Ac = Math.max(Ze - ba.Ra, 0), Ac > zc && (Ac = zc), ba.Ra += Ac, zc = Math.max(zc - Ac, 0)); | |
rg && ha.Io() | |
} | |
} | |
} | |
} | |
} | |
} | |
u.sa(Rg); | |
for (var qc = 0, Yd = 0, Ea = this.rs, ca = 0; ca < Ea; ca++) { | |
void 0 !== this.td[ca] && (qc += this.gd(ca).yb) | |
} | |
Ea = this.lt; | |
for (ca = 0; ca < Ea; ca++) { | |
void 0 !== this.Ad[ca] && (Yd += this.hd(ca).yb) | |
} | |
for (var zc = Math.max(Vd - qc, 0), Wj = kd = Math.max(Ye - Yd, 0), Xj = zc, Ea = je.length, ca = 0; ca < Ea; ca++) { | |
var ha = je[ca], | |
fb = this.hd(ha.rc), | |
gb = this.gd(ha.column), | |
zi = ha.Ca, | |
Nb = ha.margin, | |
Rf = Nb.right + Nb.left, | |
Sf = Nb.top + Nb.bottom; | |
Jc[ha.column] = 0 === gb.Ra ? Math.max(zi.width + Rf, Jc[ha.column]) : null; | |
jd[ha.rc] = 0 === fb.Ra ? Math.max(zi.height + Sf, jd[ha.rc]) : null | |
} | |
var Sg = 0, | |
Bc = 0; | |
for (ca in jd) { | |
"count" !== ca && (Sg += jd[ca]) | |
} | |
for (ca in Jc) { | |
"count" !== ca && (Bc += Jc[ca]) | |
} | |
for (var pb = u.vl(), ca = 0; ca < Ea; ca++) { | |
if (ha = je[ca], ha.visible || ha === this.fc) { | |
var fb = this.hd(ha.rc), | |
gb = this.gd(ha.column), | |
me = 0; | |
isFinite(gb.width) ? me = gb.width : (me = isFinite(zc) && null !== Jc[ha.column] ? 0 === Bc ? gb.Ra + zc : Jc[ha.column] / Bc * Xj : null !== Jc[ha.column] ? zc : gb.Ra || zc, me = Math.max(0, me - gb.ng())); | |
var Kc = 0; | |
isFinite(fb.height) ? Kc = fb.height : (Kc = isFinite(kd) && null !== jd[ha.rc] ? 0 === Sg ? fb.Ra + kd : jd[ha.rc] / Sg * Wj : null !== jd[ha.rc] ? kd : fb.Ra || kd, Kc = Math.max(0, Kc - fb.ng())); | |
pb.m(Math.max(gb.Li, Math.min(me, gb.Lf)), Math.max(fb.Li, Math.min(Kc, fb.Lf))); | |
Xd = Gl(ha, fb, gb, !1); | |
switch (Xd) { | |
case fl: | |
pb.height = Infinity; | |
break; | |
case el: | |
pb.width = Infinity | |
} | |
Nb = ha.margin; | |
Rf = Nb.right + Nb.left; | |
Sf = Nb.top + Nb.bottom; | |
ha.Io(); | |
Ph(ha, pb.width, pb.height, gb.Li, fb.Li); | |
De = ha.Ca; | |
Ze = Math.max(De.width + Rf, 0); | |
Cd = Math.max(De.height + Sf, 0); | |
isFinite(zc) && (Ze = Math.min(Ze, pb.width)); | |
isFinite(kd) && (Cd = Math.min(Cd, pb.height)); | |
var Tg = 0, | |
Tg = fb.Ra; | |
fb.Ra = Math.max(fb.Ra, Cd); | |
Ac = fb.Ra - Tg; | |
kd = Math.max(kd - Ac, 0); | |
Tg = gb.Ra; | |
gb.Ra = Math.max(gb.Ra, Ze); | |
Ac = gb.Ra - Tg; | |
zc = Math.max(zc - Ac, 0) | |
} | |
} | |
u.sa(je); | |
for (var Ee = u.vl(), Ea = Tc.length, ca = 0; ca < Ea; ca++) { | |
if (ha = Tc[ca], ha.visible || ha === this.fc) { | |
fb = this.hd(ha.rc); | |
gb = this.gd(ha.column); | |
pb.m(Math.max(gb.Li, Math.min(Vd, gb.Lf)), Math.max(fb.Li, Math.min(Ye, fb.Lf))); | |
Xd = Gl(ha, fb, gb, !1); | |
switch (Xd) { | |
case cd: | |
0 !== gb.Ra && (pb.width = Math.min(pb.width, gb.Ra)); | |
0 !== fb.Ra && (pb.height = Math.min(pb.height, fb.Ra)); | |
break; | |
case fl: | |
0 !== gb.Ra && (pb.width = Math.min(pb.width, gb.Ra)); | |
break; | |
case el: | |
0 !== fb.Ra && (pb.height = Math.min(pb.height, fb.Ra)) | |
} | |
isFinite(gb.width) && (pb.width = gb.width); | |
isFinite(fb.height) && (pb.height = fb.height); | |
Ee.m(0, 0); | |
for (var Ob = 1; Ob < ha.tj && !(ha.rc + Ob >= this.lt); Ob++) { | |
ba = this.hd(ha.rc + Ob), Ee.height += Math.max(ba.Li, isNaN(ba.Re) ? ba.Lf : Math.min(ba.Re, ba.Lf)) | |
} | |
for (Ob = 1; Ob < ha.Wi && !(ha.column + Ob >= this.rs); Ob++) { | |
ba = this.gd(ha.column + Ob), Ee.width += Math.max(ba.Li, isNaN(ba.Re) ? ba.Lf : Math.min(ba.Re, ba.Lf)) | |
} | |
pb.width += Ee.width; | |
pb.height += Ee.height; | |
Nb = ha.margin; | |
Rf = Nb.right + Nb.left; | |
Sf = Nb.top + Nb.bottom; | |
Ph(ha, pb.width, pb.height, qm, yi); | |
for (var De = ha.Ca, Ze = Math.max(De.width + Rf, 0), Cd = Math.max(De.height + Sf, 0), Ch = 0, Ob = 0; Ob < ha.tj && !(ha.rc + Ob >= this.lt); Ob++) { | |
ba = this.hd(ha.rc + Ob), Ch += ba.total || 0 | |
} | |
if (Ch < Cd) { | |
for (var Dd = Cd - Ch; 0 < Dd;) { | |
var Ed = ba.yb || 0; | |
isNaN(ba.height) && ba.Lf > Ed && (ba.Ra = Math.min(ba.Lf, Ed + Dd), ba.yb !== Ed && (Dd -= ba.yb - Ed)); | |
if (-1 === ba.index - 1) { | |
break | |
} | |
ba = this.hd(ba.index - 1) | |
} | |
} | |
for (var Tf = 0, Ob = 0; Ob < ha.Wi && !(ha.column + Ob >= this.rs); Ob++) { | |
ba = this.gd(ha.column + Ob), Tf += ba.total || 0 | |
} | |
if (Tf < Ze) { | |
for (Dd = Ze - Tf; 0 < Dd;) { | |
Ed = ba.yb || 0; | |
isNaN(ba.width) && ba.Lf > Ed && (ba.Ra = Math.min(ba.Lf, Ed + Dd), ba.yb !== Ed && (Dd -= ba.yb - Ed)); | |
if (-1 === ba.index - 1) { | |
break | |
} | |
ba = this.gd(ba.index - 1) | |
} | |
} | |
} | |
} | |
u.sa(Tc); | |
u.Oj(Ee); | |
u.Oj(pb); | |
for (var Uf = 0, $e = 0, Xd = pl(this, !0), Fd = this.za, Vf = this.cf, ne = Yd = qc = 0, ld = 0, Ea = this.rs, ca = 0; ca < Ea; ca++) { | |
void 0 !== this.td[ca] && (ba = this.gd(ca), isFinite(ba.width) ? (ne += ba.width, ne += ba.ng()) : Mm(ba) === Nm ? (ne += ba.yb, ne += ba.ng()) : 0 !== ba.yb && (qc += ba.yb, qc += ba.ng())) | |
} | |
var Uf = isFinite(Fd.width) ? Math.min(Fd.width, Vf.width) : Xd !== qh && isFinite(Vd) ? Vd : qc, | |
Uf = Math.max(Uf, this.xg.width), | |
Uf = Math.max(Uf - ne, 0), | |
Dh = Math.max(Uf / qc, 1); | |
isFinite(Dh) || (Dh = 1); | |
for (ca = 0; ca < Ea; ca++) { | |
void 0 !== this.td[ca] && (ba = this.gd(ca), isFinite(ba.width) || Mm(ba) === Nm || (ba.Ra = ba.yb * Dh), ba.position = e.width, 0 !== ba.yb && (e.width += ba.yb, e.width += ba.ng())) | |
} | |
Ea = this.lt; | |
for (ca = 0; ca < Ea; ca++) { | |
void 0 !== this.Ad[ca] && (ba = this.hd(ca), isFinite(ba.height) ? (ld += ba.height, ld += ba.ng()) : Mm(ba) === Nm ? (ld += ba.yb, ld += ba.ng()) : 0 !== ba.yb && (Yd += ba.yb, Yd += ba.ng())) | |
} | |
var $e = isFinite(Fd.height) ? Math.min(Fd.height, Vf.height) : Xd !== qh && isFinite(Ye) ? Ye : Yd, | |
$e = Math.max($e, this.xg.height), | |
$e = Math.max($e - ld, 0), | |
Wf = Math.max($e / Yd, 1); | |
isFinite(Wf) || (Wf = 1); | |
for (ca = 0; ca < Ea; ca++) { | |
void 0 !== this.Ad[ca] && (ba = this.hd(ca), isFinite(ba.height) || Mm(ba) === Nm || (ba.Ra = ba.yb * Wf), ba.position = e.height, 0 !== ba.yb && (e.height += ba.yb, e.height += ba.ng())) | |
} | |
Ea = Wd.length; | |
for (ca = 0; ca < Ea; ca++) { | |
var Tb = Wd[ca]; | |
Tb.type === tl ? (me = e.width, ba = this.hd(Tb.rc), Kc = ba.Ra) : (ba = this.gd(Tb.column), me = ba.Ra, Kc = e.height); | |
Tb.Pc.m(0, 0, me, Kc); | |
uj(Tb, !1); | |
Sb[Tb.rc] || (Sb[Tb.rc] = []); | |
Sb[Tb.rc][Tb.column] || (Sb[Tb.rc][Tb.column] = []); | |
Sb[Tb.rc][Tb.column].push(Tb) | |
} | |
u.sa(Wd); | |
this.zr = Sb; | |
break; | |
case "Viewbox": | |
var sg = a, | |
tg = b, | |
sf = c, | |
Ai = d; | |
1 < m.length && u.k("Viewbox Panel cannot contain more than one GraphObject."); | |
var Fe = m[0]; | |
Fe.ac = 1; | |
Fe.Io(); | |
Ph(Fe, Infinity, Infinity, sf, Ai); | |
var Bi = Fe.Ca, | |
Zj = Fe.margin, | |
Jp = Zj.right + Zj.left, | |
Kp = Zj.top + Zj.bottom; | |
if (isFinite(sg) || isFinite(tg)) { | |
var Rr = Fe.scale, | |
ak = Bi.width, | |
bk = Bi.height, | |
Lp = Math.max(sg - Jp, 0), | |
Mp = Math.max(tg - Kp, 0), | |
Ci = 1; | |
this.lo === sh ? 0 !== ak && 0 !== bk && (Ci = Math.min(Lp / ak, Mp / bk)) : 0 !== ak && 0 !== bk && (Ci = Math.max(Lp / ak, Mp / bk)); | |
0 === Ci && (Ci = 0.0001); | |
Fe.ac *= Ci; | |
Rr !== Fe.scale && (uj(Fe, !0), Ph(Fe, Infinity, Infinity, sf, Ai)) | |
} | |
Bi = Fe.Ca; | |
e.width = isFinite(sg) ? sg : Math.max(Bi.width + Jp, 0); | |
e.height = isFinite(tg) ? tg : Math.max(Bi.height + Kp, 0); | |
break; | |
case "Link": | |
var Np = m.length, | |
ug = this instanceof lf ? this.Mh : this; | |
if (ug instanceof W) { | |
if (0 === Np) { | |
var ck = this.Gc; | |
bb(ck, 0, 0); | |
var Zd = this.Ca; | |
Zd.m(0, 0, 0, 0) | |
} else { | |
var dk = this instanceof lf ? null : ug.path, | |
af = ug.Qm, | |
Ge = this.wi; | |
Ge.assign(af); | |
Ge.x = 0; | |
var Eh = Ge.y = 0, | |
Di = ug.points, | |
Eh = void 0 !== this.ka ? this.ka : Di.count; | |
this.Og.m(af.x, af.y); | |
this.Vi.clear(); | |
null !== dk && (Om(dk, af.width, af.height), Zd = dk.Ca, Ge.Uh(Zd), this.Vi.add(Zd)); | |
for (var Fh = u.lh(), Ei = u.K(), Xf = u.K(), sm = 0; sm < Np; sm++) { | |
var Pb = m[sm]; | |
if (Pb !== dk) { | |
if (Pb.vg && Pb instanceof X) { | |
Om(Pb, af.width, af.height), Zd = Pb.Ca, Ge.Uh(Zd), this.Vi.add(Zd) | |
} else { | |
if (2 > Eh) { | |
Ph(Pb, Infinity, Infinity), Zd = Pb.Ca, Ge.Uh(Zd), this.Vi.add(Zd) | |
} else { | |
var Yf = Pb.Qf, | |
Pp = Pb.Dw, | |
tm = Pb.Hj; | |
tm.oe() && (tm = Ib); | |
var Fi = Pb.Ew, | |
Sr = Pb.CE, | |
Gi = 0, | |
Hi = 0, | |
ek = 0; | |
if (Yf < -Eh || Yf >= Eh) { | |
var Qp = ug.YD, | |
Ii = ug.XD; | |
Fi !== dh && (ek = ug.computeAngle(Pb, Fi, Ii), Pb.Al = ek); | |
Gi = Qp.x - af.x; | |
Hi = Qp.y - af.y | |
} else { | |
var tf, Gh; | |
if (0 <= Yf) { | |
tf = Di.ja(Yf), Gh = Yf < Eh - 1 ? Di.ja(Yf + 1) : tf | |
} else { | |
var um = Eh + Yf; | |
tf = Di.ja(um); | |
Gh = 0 < um ? Di.ja(um - 1) : tf | |
} | |
Ii = 0 <= Yf ? tf.Gi(Gh) : Gh.Gi(tf); | |
Fi !== dh && (ek = ug.computeAngle(Pb, Fi, Ii), Pb.Al = ek); | |
Gi = tf.x + (Gh.x - tf.x) * Pp - af.x; | |
Hi = tf.y + (Gh.y - tf.y) * Pp - af.y | |
} | |
Ph(Pb, Infinity, Infinity); | |
var Zd = Pb.Ca, | |
ck = Pb.Ja, | |
Ji = 0; | |
Pb instanceof X && (Ji = Pb.jb); | |
var fk = ck.width + Ji, | |
vm = ck.height + Ji; | |
Fh.reset(); | |
Fh.translate(-Zd.x, -Zd.y); | |
Fh.scale(Pb.scale, Pb.scale); | |
Fh.rotate(Fi === dh ? Pb.angle : Ii, fk / 2, vm / 2); | |
var Hh = new z(0, 0, fk, vm); | |
Ei.qt(Hh, tm); | |
Fh.bb(Ei); | |
var Tr = -Ei.x + Ji / 2, | |
Ur = -Ei.y + Ji / 2; | |
Xf.assign(Sr); | |
isNaN(Xf.x) && (Xf.x = 0 <= Yf ? fk / 2 + 3 : -(fk / 2 + 3)); | |
isNaN(Xf.y) && (Xf.y = -(vm / 2 + 3)); | |
Xf.rotate(Ii); | |
Gi += Xf.x; | |
Hi += Xf.y; | |
Hh.set(Zd); | |
Hh.x = Gi + Tr; | |
Hh.y = Hi + Ur; | |
this.Vi.add(Hh); | |
Ge.Uh(Hh) | |
} | |
} | |
} | |
} | |
if (this.we) { | |
for (var Rp = this.wg; Rp.next();) { | |
Ph(Rp.value, Infinity, Infinity) | |
} | |
} | |
this.wi = Ge; | |
var wm = this.Og; | |
wm.m(wm.x + Ge.x, wm.y + Ge.y); | |
bb(e, Ge.width || 0, Ge.height || 0); | |
u.Ze(Fh); | |
u.v(Ei); | |
u.v(Xf) | |
} | |
} | |
break; | |
case "Grid": | |
break; | |
case "TableRow": | |
case "TableColumn": | |
u.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: | |
u.k("Unknown panel type: " + n) | |
} | |
} | |
var He = e.width, | |
Ie = e.height, | |
gk = this.padding, | |
Vr = gk.top + gk.bottom, | |
He = He + (gk.left + gk.right), | |
Ie = Ie + Vr; | |
isFinite(f.width) && (He = f.width); | |
isFinite(f.height) && (Ie = f.height); | |
He = Math.min(k.width, He); | |
Ie = Math.min(k.height, Ie); | |
He = Math.max(h.width, He); | |
Ie = Math.max(h.height, Ie); | |
He = Math.max(c, He); | |
Ie = Math.max(d, Ie); | |
e.width = He; | |
e.height = Ie; | |
bb(this.Gc, He, Ie); | |
ml(this, 0, 0, He, Ie) | |
}; | |
B.prototype.findMainElement = B.prototype.Jf = function() { | |
if (null === this.lm) { | |
var a = this.Aa.n, | |
b = a.length; | |
if (0 === b) { | |
return null | |
} | |
for (var c = 0; c < b; c++) { | |
var d = a[c]; | |
if (!0 === d.vg) { | |
return this.lm = d | |
} | |
} | |
this.lm = a[0] | |
} | |
return this.lm | |
}; | |
B.prototype.yi = function(a, b, c, d) { | |
var e = this.wi, | |
f = this.Aa.n, | |
h = u.Vj(0, 0, 0, 0); | |
if (0 === f.length) { | |
var k = this.ca; | |
k.x = a; | |
k.y = b; | |
k.width = c; | |
k.height = d | |
} else { | |
if (!this.za.I()) { | |
var l = pl(this, !0), | |
m = this.Pc, | |
n = m.width, | |
p = m.height, | |
q = this.margin, | |
r = q.left + q.right, | |
s = q.top + q.bottom; | |
n === c && p === d && (l = qh); | |
switch (l) { | |
case qh: | |
if (n > c || p > d) { | |
this.S(), Ph(this, n > c ? c : n, p > d ? d : p) | |
} | |
break; | |
case cd: | |
this.S(!0); | |
Ph(this, c + r, d + s, 0, 0); | |
break; | |
case fl: | |
this.S(!0); | |
Ph(this, c + r, p + s, 0, 0); | |
break; | |
case el: | |
this.S(!0), Ph(this, n + r, d + s, 0, 0) | |
} | |
} | |
k = this.ca; | |
k.x = a; | |
k.y = b; | |
k.width = c; | |
k.height = d; | |
var t = this.pa.Vb; | |
switch (t) { | |
case "Position": | |
for (var v = f.length, x = e.x - this.padding.left, A = e.y - this.padding.top, y = 0; y < v; y++) { | |
var C = f[y], | |
I = C.Ca, | |
H = C.margin, | |
R = C.position.x, | |
aa = C.position.y; | |
h.x = isNaN(R) ? -x : R - x; | |
h.y = isNaN(aa) ? -A : aa - A; | |
if (C instanceof X) { | |
var S = C; | |
if (S.sz) { | |
var N = S.jb / 2; | |
h.x -= N; | |
h.y -= N | |
} | |
} | |
h.x += H.left; | |
h.y += H.top; | |
h.width = I.width; | |
h.height = I.height; | |
C.visible && C.yc(h.x, h.y, h.width, h.height) | |
} | |
break; | |
case "Vertical": | |
for (var Z = f.length, Ga = this.padding.left, ua = this.padding.top, Oa = 0; Oa < Z; Oa++) { | |
var na = Ga, | |
Ba = f[Oa]; | |
if (Ba.visible) { | |
var ra = Ba.Ca, | |
dc = Ba.margin, | |
ed = dc.left + dc.right, | |
Lf = Ga + this.padding.right, | |
ec = ra.width, | |
We = pl(Ba, !1); | |
if (isNaN(Ba.za.width) && We === cd || We === fl) { | |
ec = Math.max(e.width - ed - Lf, 0) | |
} | |
var Mf = ec + ed + Lf, | |
Ta = Ba.alignment; | |
Ta.Kc() && (Ta = this.Tk); | |
Ta.Vc() || (Ta = Ib); | |
Ba.yc(na + Ta.offsetX + dc.left + (e.width * Ta.x - Mf * Ta.x), ua + Ta.offsetY + dc.top, ec, ra.height); | |
ua += ra.height + dc.bottom + dc.top | |
} | |
} | |
break; | |
case "Horizontal": | |
for (var db = f.length, wa = this.padding.top, za = this.padding.left, lb = 0; lb < db; lb++) { | |
var Eb = wa, | |
$a = f[lb]; | |
if ($a.visible) { | |
var jc = $a.Ca, | |
ge = $a.margin, | |
nc = ge.top + ge.bottom, | |
Pd = wa + this.padding.bottom, | |
he = jc.height, | |
Xe = pl($a, !1); | |
if (isNaN($a.za.height) && Xe === cd || Xe === el) { | |
he = Math.max(e.height - nc - Pd, 0) | |
} | |
var pf = he + nc + Pd, | |
Qd = $a.alignment; | |
Qd.Kc() && (Qd = this.Tk); | |
Qd.Vc() || (Qd = Ib); | |
$a.yc(za + Qd.offsetX + ge.left, Eb + Qd.offsetY + ge.top + (e.height * Qd.y - pf * Qd.y), jc.width, he); | |
za += jc.width + ge.left + ge.right | |
} | |
} | |
break; | |
case "Spot": | |
var Fb = f.length, | |
Kb = this.Jf(), | |
Fc = Kb.Ca, | |
Mg = Fc.width, | |
Lb = Fc.height, | |
yb = this.padding, | |
fc = yb.left, | |
mb = yb.top; | |
h.x = fc - e.x; | |
h.y = mb - e.y; | |
Kb.yc(h.x, h.y, Mg, Lb); | |
for (var ye = 0; ye < Fb; ye++) { | |
var Rd = f[ye]; | |
if (Rd !== Kb) { | |
var og = Rd.Ca, | |
Nf = og.width, | |
zb = og.height, | |
fd = Rd.alignment; | |
fd.Kc() && (fd = this.Tk); | |
fd.Vc() || (fd = Ib); | |
var oc = Rd.Hj; | |
oc.Kc() && (oc = Ib); | |
h.x = fd.x * Mg + fd.offsetX - (oc.x * Nf - oc.offsetX); | |
h.y = fd.y * Lb + fd.offsetY - (oc.y * zb - oc.offsetY); | |
h.x -= e.x; | |
h.y -= e.y; | |
Rd.visible && Rd.yc(fc + h.x, mb + h.y, Nf, zb) | |
} | |
} | |
break; | |
case "Auto": | |
var wb = f.length, | |
Gc = this.Jf(), | |
Mb = Gc.Ca, | |
Na = u.Tf(); | |
Na.m(0, 0, 1, 1); | |
var eb = Gc.margin, | |
Ab = eb.left, | |
gc = eb.top, | |
Sd = this.padding, | |
Td = Sd.left, | |
qf = Sd.top; | |
h.x = Ab; | |
h.y = gc; | |
h.width = Mb.width; | |
h.height = Mb.height; | |
Gc.yc(Td + h.x, qf + h.y, h.width, h.height); | |
var ze = Km(Gc), | |
rf = Lm(Gc), | |
Rb = 0 + ze.y * Mb.height + ze.offsetY, | |
cb = 0 + rf.x * Mb.width + rf.offsetX, | |
pc = 0 + rf.y * Mb.height + rf.offsetY; | |
Na.x = 0 + ze.x * Mb.width + ze.offsetX; | |
Na.y = Rb; | |
kb(Na, cb, pc, 0, 0); | |
Na.x += Ab + Td; | |
Na.y += gc + qf; | |
for (var Pc = 0; Pc < wb; Pc++) { | |
var gd = f[Pc]; | |
if (gd !== Gc) { | |
var ab = gd.Ca, | |
eb = gd.margin, | |
ub = Math.max(ab.width + eb.right + eb.left, 0), | |
kc = Math.max(ab.height + eb.top + eb.bottom, 0), | |
hd = gd.alignment; | |
hd.Kc() && (hd = this.Tk); | |
hd.Vc() || (hd = Ib); | |
h.x = Na.width * hd.x + hd.offsetX - ub * hd.x + eb.left + Na.x; | |
h.y = Na.height * hd.y + hd.offsetY - kc * hd.y + eb.top + Na.y; | |
h.width = Na.width; | |
h.height = Na.height; | |
gd.visible && (qb(Na.x, Na.y, Na.width, Na.height, h.x, h.y, ab.width, ab.height) ? gd.yc(h.x, h.y, ab.width, ab.height) : gd.yc(h.x, h.y, ab.width, ab.height, new z(Na.x, Na.y, Na.width, Na.height))) | |
} | |
} | |
u.ic(Na); | |
break; | |
case "Table": | |
for (var Ng = f.length, Og = this.padding, Pg = Og.left, Of = Og.top, Hc = this.zr, Qc = 0, Ic = 0, nb = Hc.length, ie = 0, ob = 0; ob < nb; ob++) { | |
Hc[ob] && (ie = Math.max(ie, Hc[ob].length)) | |
} | |
for (var yc = Math.min(this.vi, nb - 1); yc !== nb && (void 0 === this.Ad[yc] || 0 === this.Ad[yc].yb);) { | |
yc++ | |
} | |
for (var yc = Math.min(yc, nb - 1), Ae = -this.Ad[yc].Na, Bb = Math.min(this.ii, ie - 1); Bb !== ie && (void 0 === this.td[Bb] || 0 === this.td[Bb].yb);) { | |
Bb++ | |
} | |
for (var Bb = Math.min(Bb, ie - 1), Cb = -this.td[Bb].Na, id = u.vl(), ob = 0; ob < nb; ob++) { | |
if (Hc[ob]) { | |
for (var ie = Hc[ob].length, Rc = this.hd(ob), Ic = Rc.Na + Ae + Of + Rc.$C(), Ud = 0; Ud < ie; Ud++) { | |
if (Hc[ob][Ud]) { | |
for (var Vd = this.gd(Ud), Qc = Vd.Na + Cb + Pg + Vd.$C(), Ye = Hc[ob][Ud], qm = Ye.length, yi = 0; yi < qm; yi++) { | |
var Ea = Ye[yi], | |
Be = Ea.Ca, | |
Wd = Ea instanceof B ? Ea : null; | |
if (null === Wd || Wd.type !== tl && Wd.type !== ul) { | |
id.m(0, 0); | |
for (var ca = 1; ca < Ea.rowSpan && !(ob + ca >= this.lt); ca++) { | |
var ha = this.hd(ob + ca); | |
id.height += ha.total | |
} | |
for (ca = 1; ca < Ea.aG && !(Ud + ca >= this.rs); ca++) { | |
var pg = this.gd(Ud + ca); | |
id.width += pg.total | |
} | |
var Qg = Vd.yb + id.width, | |
zh = Rc.yb + id.height; | |
h.x = Qc; | |
h.y = Ic; | |
h.width = Qg; | |
h.height = zh; | |
var Sc = Qc, | |
Ah = Ic, | |
Sb = Qg, | |
Rg = zh; | |
Qc + Qg > e.width && (Sb = Math.max(e.width - Qc, 0)); | |
Ic + zh > e.height && (Rg = Math.max(e.height - Ic, 0)); | |
var Tc = Ea.alignment, | |
je = 0, | |
Jc = 0, | |
jd = 0, | |
zc = 0; | |
if (Tc.Kc()) { | |
Tc = this.Tk; | |
Tc.Vc() || (Tc = Ib); | |
var je = Tc.x, | |
Jc = Tc.y, | |
jd = Tc.offsetX, | |
zc = Tc.offsetY, | |
kd = Vd.alignment, | |
Pf = Rc.alignment; | |
kd.Vc() && (je = kd.x, jd = kd.offsetX); | |
Pf.Vc() && (Jc = Pf.y, zc = Pf.offsetY) | |
} else { | |
je = Tc.x, Jc = Tc.y, jd = Tc.offsetX, zc = Tc.offsetY | |
} | |
if (isNaN(je) || isNaN(Jc)) { | |
Jc = je = 0.5, zc = jd = 0 | |
} | |
var ba = Be.width, | |
ke = Be.height, | |
Ce = Ea.margin, | |
Tj = Ce.left + Ce.right, | |
Uj = Ce.top + Ce.bottom, | |
Ac = Gl(Ea, Rc, Vd, !1); | |
!isNaN(Ea.za.width) || Ac !== cd && Ac !== fl || (ba = Math.max(Qg - Tj, 0)); | |
!isNaN(Ea.za.height) || Ac !== cd && Ac !== el || (ke = Math.max(zh - Uj, 0)); | |
var fb = Ea.cf, | |
gb = Ea.xg, | |
ba = Math.min(fb.width, ba), | |
ke = Math.min(fb.height, ke), | |
ba = Math.max(gb.width, ba), | |
ke = Math.max(gb.height, ke), | |
Vj = ke + Uj; | |
h.x += h.width * je - (ba + Tj) * je + jd + Ce.left; | |
h.y += h.height * Jc - Vj * Jc + zc + Ce.top; | |
Ea.visible && (qb(Sc, Ah, Sb, Rg, h.x, h.y, Be.width, Be.height) ? Ea.yc(h.x, h.y, ba, ke) : Ea.yc(h.x, h.y, ba, ke, new z(Sc, Ah, Sb, Rg))) | |
} else { | |
Ea.Lg(); | |
Ea.Zb.Ma(); | |
var Qf = Ea.Zb; | |
Qf.x = Wd.type === tl ? Pg : Qc; | |
Qf.y = Wd.type === ul ? Of : Ic; | |
Qf.width = Be.width; | |
Qf.height = Be.height; | |
Ea.Zb.freeze(); | |
rl(Ea, !1) | |
} | |
} | |
} | |
} | |
} | |
} | |
u.Oj(id); | |
for (ob = 0; ob < Ng; ob++) { | |
Ea = f[ob], Wd = Ea instanceof B ? Ea : null, null === Wd || Wd.type !== tl && Wd.type !== ul || (Qf = Ea.Zb, Ea.Gc.Ma(), Ea.Gc.m(0, 0, Qf.width, Qf.height), Ea.Gc.freeze()) | |
} | |
break; | |
case "Viewbox": | |
var qg = f[0], | |
rg = qg.Ca, | |
Nb = qg.margin, | |
Rf = Nb.top + Nb.bottom, | |
Sf = Math.max(rg.width + (Nb.right + Nb.left), 0), | |
Xd = Math.max(rg.height + Rf, 0), | |
le = qg.alignment; | |
le.Kc() && (le = this.Tk); | |
le.Vc() || (le = Ib); | |
h.x = e.width * le.x - Sf * le.x + le.offsetX; | |
h.y = e.height * le.y - Xd * le.y + le.offsetY; | |
h.width = rg.width; | |
h.height = rg.height; | |
qg.yc(h.x, h.y, h.width, h.height); | |
break; | |
case "Link": | |
var rm = f.length, | |
Bh = this instanceof lf ? this.Mh : this; | |
if (Bh instanceof W) { | |
var De = this instanceof lf ? null : Bh.path, | |
Ze = this.Vi.n, | |
Cd = 0; | |
if (null !== De && Cd < this.Vi.count) { | |
var qc = Ze[Cd]; | |
Cd++; | |
De.yc(qc.x - this.wi.x, qc.y - this.wi.y, qc.width, qc.height) | |
} | |
for (var Yd = 0; Yd < rm; Yd++) { | |
var Wj = f[Yd]; | |
Wj !== De && Cd < this.Vi.count && (qc = Ze[Cd], Cd++, Wj.yc(qc.x - this.wi.x, qc.y - this.wi.y, qc.width, qc.height)) | |
} | |
var Xj = Bh.points, | |
zi = Xj.count; | |
if (2 <= zi && this.we) { | |
for (var Sg = this.wg; Sg.next();) { | |
var Bc = Sg.value, | |
pb = zi, | |
me = Xj, | |
Kc = Bc.Qf, | |
Tg = Bc.Dw, | |
Ee = Bc.Hj; | |
Ee.oe() && (Ee = Ib); | |
var Ob = Bc.Ew, | |
Ch = Bc.CE, | |
Dd = 0, | |
Ed = 0, | |
Tf = 0; | |
if (Kc < -pb || Kc >= pb) { | |
var Uf = this.YD, | |
$e = this.XD; | |
Ob !== dh && (Tf = this.computeAngle(Bc, Ob, $e), Bc.angle = Tf); | |
Dd = Uf.x; | |
Ed = Uf.y | |
} else { | |
var Fd = void 0, | |
Vf = void 0; | |
if (0 <= Kc) { | |
Fd = me.n[Kc], Vf = Kc < pb - 1 ? me.n[Kc + 1] : Fd | |
} else { | |
var ne = pb + Kc, | |
Fd = me.n[ne], | |
Vf = 0 < ne ? me.n[ne - 1] : Fd | |
} | |
$e = 0 <= Kc ? Fd.Gi(Vf) : Vf.Gi(Fd); | |
Ob !== dh && (Tf = this.computeAngle(Bc, Ob, $e), Bc.angle = Tf); | |
Dd = Fd.x + (Vf.x - Fd.x) * Tg; | |
Ed = Fd.y + (Vf.y - Fd.y) * Tg | |
} | |
var ld = u.lh(); | |
ld.reset(); | |
ld.scale(Bc.scale, Bc.scale); | |
ld.rotate(Bc.angle, 0, 0); | |
var Dh = Bc.Ja, | |
Wf = u.Vj(0, 0, Dh.width, Dh.height), | |
Tb = u.K(); | |
Tb.qt(Wf, Ee); | |
ld.bb(Tb); | |
var sg = -Tb.x, | |
tg = -Tb.y, | |
sf = Ch.copy(); | |
isNaN(sf.x) && (sf.x = 0 <= Kc ? Tb.x + 3 : -(Tb.x + 3)); | |
isNaN(sf.y) && (sf.y = -(Tb.y + 3)); | |
sf.rotate($e); | |
Dd += sf.x; | |
Ed += sf.y; | |
ld.WE(Wf); | |
var sg = sg + Wf.x, | |
tg = tg + Wf.y, | |
Ai = u.Yb(Dd + sg, Ed + tg); | |
Bc.move(Ai); | |
u.v(Ai); | |
u.v(Tb); | |
u.ic(Wf); | |
u.Ze(ld) | |
} | |
} | |
this instanceof lf ? this.Ys() : Bh.Ys() | |
} | |
break; | |
case "Grid": | |
break; | |
case "TableRow": | |
case "TableColumn": | |
u.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: | |
u.k("Unknown panel type: " + t) | |
} | |
u.ic(h) | |
} | |
}; | |
B.prototype.Jj = function(a) { | |
var b = this.Ja; | |
if (qb(0, 0, b.width, b.height, a.x, a.y)) { | |
for (var b = this.Aa.n, c = b.length, d = u.Yb(0, 0); c--;) { | |
var e = b[c]; | |
if (e.visible || e === this.fc) { | |
if (Wa(d.set(a), e.transform), e.Da(d)) { | |
return u.v(d), !0 | |
} | |
} | |
} | |
u.v(d); | |
return null === this.Jb && null === this.lc ? !1 : !0 | |
} | |
return !1 | |
}; | |
B.prototype.Vv = function(a) { | |
if (this.bn === a) { | |
return this | |
} | |
for (var b = this.Aa.n, c = b.length, d = 0; d < c; d++) { | |
var e = b[d].Vv(a); | |
if (null !== e) { | |
return e | |
} | |
} | |
return null | |
}; | |
function Pm(a, b, c) { | |
c(a, b); | |
if (b instanceof B) { | |
b = b.Aa.n; | |
for (var d = b.length, e = 0; e < d; e++) { | |
Pm(a, b[e], c) | |
} | |
} | |
} | |
function Kj(a, b) { | |
Qm(a, a, b) | |
} | |
function Qm(a, b, c) { | |
c(b); | |
b = b.Aa.n; | |
for (var d = b.length, e = 0; e < d; e++) { | |
var f = b[e]; | |
f instanceof B && Qm(a, f, c) | |
} | |
} | |
B.prototype.walkVisualTree = function(a) { | |
Rm(this, this, a) | |
}; | |
function Rm(a, b, c) { | |
c(b); | |
if (b instanceof B) { | |
b = b.Aa.n; | |
for (var d = b.length, e = 0; e < d; e++) { | |
Rm(a, b[e], c) | |
} | |
} | |
} | |
B.prototype.findInVisualTree = B.prototype.ws = function(a) { | |
return Sm(this, this, a) | |
}; | |
function Sm(a, b, c) { | |
if (c(b)) { | |
return b | |
} | |
if (b instanceof B) { | |
b = b.Aa.n; | |
for (var d = b.length, e = 0; e < d; e++) { | |
var f = Sm(a, b[e], c); | |
if (null !== f) { | |
return f | |
} | |
} | |
} | |
return null | |
} | |
B.prototype.findObject = B.prototype.ke = function(a) { | |
if (this.name === a) { | |
return this | |
} | |
for (var b = this.Aa.n, c = b.length, d = 0; d < c; d++) { | |
var e = b[d]; | |
if (e.name === a) { | |
return e | |
} | |
if (e instanceof B) { | |
if (null === e.hi && null === e.ag) { | |
if (e = e.ke(a), null !== e) { | |
return e | |
} | |
} else { | |
if (sk(e) && (e = e.Aa.first(), null !== e && (e = e.ke(a), null !== e))) { | |
return e | |
} | |
} | |
} | |
} | |
return null | |
}; | |
function Tm(a) { | |
a = a.Aa.n; | |
for (var b = a.length, c = 0, d = 0; d < b; d++) { | |
var e = a[d]; | |
if (e instanceof B) { | |
c = Math.max(c, Tm(e)) | |
} else { | |
if (e instanceof X) { | |
a: { | |
if (!e.Tg) { | |
switch (e.vn) { | |
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.Ug / 2 * e.km * e.Ii() | |
} | |
c = Math.max(c, e) | |
} | |
} | |
} | |
return c | |
} | |
g = B.prototype; | |
g.Uf = function() { | |
return !(this.type === tl || this.type === ul) | |
}; | |
g.le = function(a, b, c) { | |
if (!1 === this.Cg) { | |
return null | |
} | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
if (Bj(this)) { | |
return null | |
} | |
var d = this.Ja, | |
e = 1 / this.Ii(), | |
f = this.Uf(), | |
h = f ? a : Wa(u.Yb(a.x, a.y), this.transform), | |
k = this.g, | |
l = 10, | |
m = 5; | |
null !== k && (l = k.hz("extraTouchArea"), m = l / 2); | |
if (qb(-(m * e), -(m * e), d.width + l * e, d.height + l * e, h.x, h.y)) { | |
if (!this.Mg) { | |
var e = this.Aa.n, | |
n = e.length, | |
k = u.K(), | |
m = (l = this.LD) ? this.Jf() : null; | |
if (l && (m.Uf() ? Wa(k.set(a), m.transform) : k.set(a), !m.Da(k))) { | |
return u.v(k), f || u.v(h), null | |
} | |
for (; n--;) { | |
var p = e[n]; | |
if (p.visible || p === this.fc) { | |
if (p.Uf() ? Wa(k.set(a), p.transform) : k.set(a), !l || p !== m) { | |
var q = null; | |
p instanceof B ? q = p.le(k, b, c) : !0 === p.Cg && p.Da(k) && (q = p); | |
if (null !== q && (null !== b && (q = b(q)), null !== q && (null === c || c(q)))) { | |
return u.v(k), f || u.v(h), q | |
} | |
} | |
} | |
} | |
u.v(k) | |
} | |
if (null === this.background && null === this.rm) { | |
return f || u.v(h), null | |
} | |
a = qb(0, 0, d.width, d.height, h.x, h.y) ? this : null; | |
f || u.v(h); | |
return a | |
} | |
f || u.v(h); | |
return null | |
}; | |
g.zs = function(a, b, c, d) { | |
if (!1 === this.Cg) { | |
return !1 | |
} | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
d instanceof E || d instanceof F || (d = new E(T)); | |
var e = this.Ja, | |
f = this.Uf(), | |
h = f ? a : Wa(u.Yb(a.x, a.y), this.transform); | |
if (qb(0, 0, e.width, e.height, h.x, h.y)) { | |
if (!this.Mg) { | |
for (var e = this.Aa.n, k = e.length, l = u.K(); k--;) { | |
var m = e[k]; | |
if (m.visible || m === this.fc) { | |
m.Uf() ? Wa(l.set(a), m.transform) : l.set(a); | |
var n = m, | |
m = m instanceof B ? m : null; | |
(null !== m ? m.zs(l, b, c, d) : n.Da(l)) && !1 !== n.Cg && (null !== b && (n = b(n)), null === n || null !== c && !c(n) || d.add(n)) | |
} | |
} | |
u.v(l) | |
} | |
f || u.v(h); | |
return null !== this.background || null !== this.rm | |
} | |
f || u.v(h); | |
return !1 | |
}; | |
g.Nj = function(a, b, c, d, e, f) { | |
if (!1 === this.Cg) { | |
return !1 | |
} | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
var h = f; | |
void 0 === f && (h = u.lh(), h.reset()); | |
h.multiply(this.transform); | |
if (this.wm(a, h)) { | |
return Um(this, b, c, e), void 0 === f && u.Ze(h), !0 | |
} | |
if (this.ug(a, h)) { | |
if (!this.Mg) { | |
for (var k = this.Aa.n, l = k.length; l--;) { | |
var m = k[l]; | |
if (m.visible || m === this.fc) { | |
var n = m.ca, | |
p = this.Ja; | |
if (!(n.x > p.width || n.y > p.height || 0 > n.x + n.width || 0 > n.y + n.height)) { | |
n = m; | |
m = m instanceof B ? m : null; | |
p = u.lh(); | |
p.set(h); | |
if (null !== m ? m.Nj(a, b, c, d, e, p) : ol(n, a, d, p)) { | |
null !== b && (n = b(n)), null === n || null !== c && !c(n) || e.add(n) | |
} | |
u.Ze(p) | |
} | |
} | |
} | |
} | |
void 0 === f && u.Ze(h); | |
return d | |
} | |
void 0 === f && u.Ze(h); | |
return !1 | |
}; | |
function Um(a, b, c, d) { | |
for (var e = a.Aa.n, f = e.length; f--;) { | |
var h = e[f]; | |
if (h.visible) { | |
var k = h.ca, | |
l = a.Ja; | |
k.x > l.width || k.y > l.height || 0 > k.x + k.width || 0 > k.y + k.height || (h instanceof B && Um(h, b, c, d), null !== b && (h = b(h)), null === h || null !== c && !c(h) || d.add(h)) | |
} | |
} | |
} | |
g.Cm = function(a, b, c, d, e, f) { | |
if (!1 === this.Cg) { | |
return !1 | |
} | |
void 0 === c && (c = null); | |
void 0 === d && (d = null); | |
var h = this.Ja, | |
k = this.Uf(), | |
l = k ? a : Wa(u.Yb(a.x, a.y), this.transform), | |
m = k ? b : Wa(u.Yb(b.x, b.y), this.transform), | |
n = l.Lj(m), | |
p = 0 < l.x && l.x < h.width && 0 < l.y && l.y < h.height || Xa(l.x, l.y, 0, 0, 0, h.height) < n || Xa(l.x, l.y, 0, h.height, h.width, h.height) < n || Xa(l.x, l.y, h.width, h.height, h.width, 0) < n || Xa(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 && Xa(l.x, l.y, 0, 0, 0, h.height) < n && Xa(l.x, l.y, 0, h.height, h.width, h.height) < n && Xa(l.x, l.y, h.width, h.height, h.width, 0) < n && Xa(l.x, l.y, h.width, 0, 0, 0) < n; | |
k || (u.v(l), u.v(m)); | |
if (p) { | |
if (!this.Mg) { | |
k = u.K(); | |
l = u.K(); | |
m = this.Aa.n; | |
for (n = m.length; n--;) { | |
var q = m[n]; | |
if (q.visible || q === this.fc) { | |
var r = q.ca, | |
s = this.Ja; | |
r.x > s.width || r.y > s.height || 0 > r.x + r.width || 0 > r.y + r.height || (q.Uf() ? (r = q.transform, Wa(k.set(a), r), Wa(l.set(b), r)) : (k.set(a), l.set(b)), r = q, q = q instanceof B ? q : null, null !== q ? !q.Cm(k, l, c, d, e, f) : !r.tD(k, l, e)) || (null !== c && (r = c(r)), null === r || null !== d && !d(r) || f.add(r)) | |
} | |
} | |
u.v(k); | |
u.v(l) | |
} | |
return e ? p : h | |
} | |
return !1 | |
}; | |
function Km(a) { | |
var b = a.A; | |
if (void 0 === b || b === uc) { | |
b = null | |
} | |
null === b && a instanceof X && (a = a.Qa, null !== a && (b = a.A)); | |
null === b && (b = xb); | |
return b | |
} | |
function Lm(a) { | |
var b = a.B; | |
if (void 0 === b || b === uc) { | |
b = null | |
} | |
null === b && a instanceof X && (a = a.Qa, null !== a && (b = a.B)); | |
null === b && (b = Vb); | |
return b | |
} | |
B.prototype.add = B.prototype.add = function(a) { | |
u.C(a, T, B, "add:element"); | |
this.Zd(this.Aa.count, a) | |
}; | |
B.prototype.elt = B.prototype.ja = function(a) { | |
return this.Aa.ja(a) | |
}; | |
B.prototype.insertAt = B.prototype.Zd = function(a, b) { | |
b instanceof G && u.k("Cannot add a Part to a Panel: " + b); | |
if (this === b || this.gl(b)) { | |
this === b && u.k("Cannot make a Panel contain itself: " + this.toString()), u.k("Cannot make a Panel indirectly contain itself: " + this.toString() + " already contains " + b.toString()) | |
} | |
var c = b.P; | |
null !== c && c !== this && u.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.pa !== bj || b instanceof X || u.k("Can only add Shapes to a Grid Panel, not: " + b); | |
b.rl(this); | |
b.$l = null; | |
if (null !== this.RD) { | |
var d = b.data; | |
null !== d && "object" === typeof d && (null === this.$f && (this.$f = new la(Object, B)), this.$f.add(d, b)) | |
} | |
var e = this.Aa, | |
d = -1; | |
if (c === this) { | |
for (var f = -1, h = this.Aa.n, k = h.length, l = 0; l < k; l++) { | |
if (h[l] === b) { | |
f = l; | |
break | |
} | |
} | |
if (-1 !== f) { | |
if (f === a || f + 1 >= e.count && a >= e.count) { | |
return | |
} | |
e.kd(f); | |
d = f | |
} else { | |
u.k("element " + b.toString() + " has panel " + c.toString() + " but is not contained by it.") | |
} | |
} | |
if (0 > a || a > e.count) { | |
a = e.count | |
} | |
e.Zd(a, b); | |
this.S(); | |
b.S(); | |
null !== b.Kd ? this.zh = !0 : b instanceof B && !0 === b.zh && (this.zh = !0); | |
c = this.W; | |
null !== c && (c.Bk = null, c.kj = NaN, this.zh && c instanceof U && (c.zh = !0), c.zh && (c.Rd = null), e = this.g, null !== e && e.ga.fb || (-1 !== d && c.Cc(ce, "elements", this, b, null, d, null), c.Cc(be, "elements", this, null, b, null, a))) | |
}; | |
B.prototype.remove = B.prototype.remove = function(a) { | |
u.C(a, T, B, "remove:element"); | |
for (var b = this.Aa.n, c = b.length, d = -1, e = 0; e < c; e++) { | |
if (b[e] === a) { | |
d = e; | |
break | |
} | |
} - 1 !== d && this.Ge(d) | |
}; | |
B.prototype.removeAt = B.prototype.kd = function(a) { | |
0 <= a && this.Ge(a) | |
}; | |
B.prototype.Ge = function(a) { | |
var b = this.Aa, | |
c = b.ja(a); | |
c.$l = null; | |
c.rl(null); | |
if (null !== this.$f) { | |
var d = c.data; | |
"object" === typeof d && this.$f.remove(d) | |
} | |
b.kd(a); | |
uj(this, !1); | |
this.S(); | |
this.lm === c && (this.lm = null); | |
b = this.W; | |
null !== b && (b.Bk = null, b.kj = NaN, d = this.g, null !== d && d.ga.fb || b.Cc(ce, "elements", this, c, null, a, null)) | |
}; | |
u.u(B, { | |
lt: "rowCount" | |
}, function() { | |
return void 0 === this.Ad ? 0 : this.Ad.length | |
}); | |
B.prototype.getRowDefinition = B.prototype.hd = function(a) { | |
0 > a && u.xa(a, ">= 0", B, "getRowDefinition:idx"); | |
a = Math.round(a); | |
var b = this.Ad; | |
if (void 0 === b[a]) { | |
var c = new Se; | |
c.rl(this); | |
c.be = !0; | |
c.index = a; | |
b[a] = c | |
} | |
return b[a] | |
}; | |
B.prototype.removeRowDefinition = B.prototype.pE = function(a) { | |
0 > a && u.xa(a, ">= 0", B, "removeRowDefinition:idx"); | |
a = Math.round(a); | |
var b = this.Ad; | |
this.Cc(ce, "coldefs", this, b[a], null, a, null); | |
b[a] && delete b[a]; | |
this.S() | |
}; | |
u.u(B, { | |
rs: "columnCount" | |
}, function() { | |
return void 0 === this.td ? 0 : this.td.length | |
}); | |
B.prototype.getColumnDefinition = B.prototype.gd = function(a) { | |
0 > a && u.xa(a, ">= 0", B, "getColumnDefinition:idx"); | |
a = Math.round(a); | |
var b = this.td; | |
if (void 0 === b[a]) { | |
var c = new Se; | |
c.rl(this); | |
c.be = !1; | |
c.index = a; | |
b[a] = c | |
} | |
return b[a] | |
}; | |
B.prototype.removeColumnDefinition = B.prototype.lE = function(a) { | |
0 > a && u.xa(a, ">= 0", B, "removeColumnDefinition:idx"); | |
a = Math.round(a); | |
var b = this.td; | |
this.Cc(ce, "coldefs", this, b[a], null, a, null); | |
b[a] && delete b[a]; | |
this.S() | |
}; | |
u.defineProperty(B, { | |
dI: "rowSizing" | |
}, function() { | |
return void 0 === this.em ? Gm : this.em | |
}, function(a) { | |
if (void 0 !== this.em) { | |
var b = this.em; | |
b !== a && (a !== Gm && a !== Nm && u.k("rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None"), this.em = a, this.S(), this.h("rowSizing", b, a)) | |
} | |
}); | |
u.defineProperty(B, { | |
$F: "columnSizing" | |
}, function() { | |
return void 0 === this.El ? Gm : this.El | |
}, function(a) { | |
if (void 0 !== this.El) { | |
var b = this.El; | |
b !== a && (a !== Gm && a !== Nm && u.k("columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None"), this.El = a, this.S(), this.h("columnSizing", b, a)) | |
} | |
}); | |
u.defineProperty(B, { | |
EK: "topIndex" | |
}, function() { | |
return void 0 === this.vi ? 0 : this.vi | |
}, function(a) { | |
if (void 0 !== this.vi) { | |
var b = this.vi; | |
b !== a && ((!isFinite(a) || 0 > a) && u.k("topIndex must be greater than zero and a real number. Was " + a), this.vi = a, this.S(), this.h("topIndex", b, a)) | |
} | |
}); | |
u.defineProperty(B, { | |
SJ: "leftIndex" | |
}, function() { | |
return void 0 === this.ii ? 0 : this.ii | |
}, function(a) { | |
if (void 0 !== this.ii) { | |
var b = this.ii; | |
b !== a && ((!isFinite(a) || 0 > a) && u.k("leftIndex must be greater than zero and a real number. Was " + a), this.ii = a, this.S(), this.h("leftIndex", b, a)) | |
} | |
}); | |
B.prototype.findRowForLocalY = function(a) { | |
if (0 > a) { | |
return -1 | |
} | |
if (this.type !== Fl) { | |
return NaN | |
} | |
for (var b = 0, c = this.Ad, d = c.length, e = this.vi; e < d; e++) { | |
var f = c[e]; | |
if (void 0 !== f && (b += f.total, a < b)) { | |
return e | |
} | |
} | |
return -1 | |
}; | |
B.prototype.findColumnForLocalX = function(a) { | |
if (0 > a) { | |
return -1 | |
} | |
if (this.type !== Fl) { | |
return NaN | |
} | |
for (var b = 0, c = this.td, d = c.length, e = this.ii; e < d; e++) { | |
var f = c[e]; | |
if (void 0 !== f && (b += f.total, a < b)) { | |
return e | |
} | |
} | |
return -1 | |
}; | |
u.defineProperty(B, { | |
data: "data" | |
}, function() { | |
return this.sh | |
}, function(a) { | |
var b = this.sh; | |
if (b !== a) { | |
var c = this instanceof G && !(this instanceof lf); | |
c && u.j(a, "object", B, "data"); | |
nf(this); | |
this.sh = a; | |
var d = this.g; | |
null !== d && (c ? this instanceof W ? (null !== b && d.lk.remove(b), null !== a && d.lk.add(a, this)) : (null !== b && d.ai.remove(b), null !== a && d.ai.add(a, this)) : (c = this.P, null !== c && null !== c.$f && (null !== b && c.$f.remove(b), null !== a && c.$f.add(a, this)))); | |
this.h("data", b, a); | |
null !== d && d.ga.fb || null !== a && this.Ob() | |
} | |
}); | |
u.defineProperty(B, { | |
jH: "itemIndex" | |
}, function() { | |
return this.wq | |
}, function(a) { | |
var b = this.wq; | |
b !== a && (this.wq = a, this.h("itemIndex", b, a)) | |
}); | |
function Pl(a) { | |
a = a.Cl; | |
return null !== a && a.Ea | |
} | |
function nf(a) { | |
var b = a.Cl; | |
if (null === b) { | |
null !== a.data && u.k("Template cannot have .data be non-null: " + a), a.Cl = b = new E(bf) | |
} else { | |
if (b.Ea) { | |
return | |
} | |
} | |
var c = new E(T); | |
Pm(a, a, function(a, d) { | |
var e = d.Fc; | |
if (null !== e) { | |
for (Jl(d, !1), e = e.i; e.next();) { | |
var f = e.value; | |
f.mode === df && Jl(d, !0); | |
if (null !== f.Rm) { | |
var h = ef(f, a, d); | |
null !== h && (c.add(h), null === h.bo && (h.bo = new E(bf)), h.bo.add(f)) | |
} | |
b.add(f) | |
} | |
} | |
if (d instanceof B && d.type === Fl) { | |
if (0 < d.Ad.length) { | |
for (e = d.Ad, f = e.length, h = 0; h < f; h++) { | |
var k = e[h]; | |
if (void 0 !== k && null !== k.Fc) { | |
for (var l = k.Fc.i; l.next();) { | |
var v = l.value; | |
v.hg = k; | |
v.By = 2; | |
v.ov = k.index; | |
b.add(v) | |
} | |
} | |
} | |
} | |
if (0 < d.td.length) { | |
for (e = d.td, f = e.length, h = 0; h < f; h++) { | |
if (k = e[h], void 0 !== k && null !== k.Fc) { | |
for (l = k.Fc.i; l.next();) { | |
v = l.value, v.hg = k, v.By = 1, v.ov = k.index, b.add(v) | |
} | |
} | |
} | |
} | |
} | |
}); | |
for (var d = c.i; d.next();) { | |
var e = d.value; | |
if (null !== e.bo) { | |
Jl(e, !0); | |
for (var f = e.bo.i; f.next();) { | |
var h = f.value; | |
null === e.Fc && (e.Fc = new E(bf)); | |
e.Fc.add(h) | |
} | |
} | |
e.bo = null | |
} | |
for (d = b.i; d.next();) { | |
if (e = d.value, f = e.hg, null !== f) { | |
e.hg = null; | |
var k = e.Nw, | |
l = k.indexOf("."); | |
0 < l && f instanceof B && (h = k.substring(0, l), k = k.substr(l + 1), l = f.ke(h), null !== l ? (f = l, e.Nw = k) : u.trace('Warning: unable to find GraphObject named "' + h + '" for Binding: ' + e.toString())); | |
f instanceof Se ? (e.ul = u.Uc(f.P), f.P.bn = e.ul) : (e.ul = u.Uc(f), f.bn = e.ul) | |
} | |
} | |
b.freeze(); | |
a instanceof G && a.Hd() && (Ph(a, Infinity, Infinity), a.yc()) | |
} | |
B.prototype.updateTargetBindings = B.prototype.Ob = function(a) { | |
var b = this.Cl; | |
if (null !== b) { | |
for (void 0 === a && (a = ""), b = b.i; b.next();) { | |
var c = b.value, | |
d = c.LE; | |
if ("" === a || "" === d || d === a) { | |
if (d = c.Nw, null !== c.fG || "" !== d) { | |
var d = this.data, | |
e = c.Rm; | |
if (null !== e) { | |
d = "" === e ? this : "." === e ? this : ".." === e ? this : this.ke(e) | |
} else { | |
var f = this.g; | |
null !== f && c.yt && (d = f.ha.$s) | |
} | |
if (null !== d) { | |
var f = this, | |
h = c.ul; | |
if (-1 !== h) { | |
if (f = this.Vv(h), null === f) { | |
continue | |
} | |
} else { | |
null !== c.hg && (f = c.hg) | |
} | |
"." === e ? d = f : ".." === e && (d = f.P); | |
e = c.By; | |
if (0 !== e) { | |
if (!(f instanceof B)) { | |
continue | |
} | |
h = f; | |
1 === e ? f = h.gd(c.ov) : 2 === e && (f = h.hd(c.ov)) | |
} | |
void 0 !== f && c.ZE(f, d) | |
} | |
} | |
} | |
} | |
} | |
}; | |
u.defineProperty(B, { | |
RD: "itemArray" | |
}, function() { | |
return this.hi | |
}, function(a) { | |
var b = this.hi; | |
if (b !== a) { | |
var c = this.g; | |
null !== c && null !== b && Qj(c, this); | |
this.hi = a; | |
null !== c && null !== a && Mj(c, this); | |
this.h("itemArray", b, a); | |
null !== c && c.ga.fb || this.Sz() | |
} | |
}); | |
function sk(a) { | |
return a.type === oh || a.type === Yi || a.type === ah || a.type === Fl && 0 < a.Aa.length && (a = a.Aa.ja(0), a.vg && a instanceof B && (a.type === tl || a.type === ul)) ? !0 : !1 | |
} | |
B.prototype.rebuildItemElements = B.prototype.Sz = function() { | |
var a = 0; | |
for (sk(this) && (a = 1); this.Aa.length > a;) { | |
this.Ge(a) | |
} | |
a = this.RD; | |
if (null !== a) { | |
for (var b = u.qb(a), c = 0; c < b; c++) { | |
rk(this, u.ib(a, c), c) | |
} | |
} | |
}; | |
function rk(a, b, c) { | |
if (!(void 0 === b || null === b || 0 > c)) { | |
var d = a.getCategoryForItemData(b, c), | |
d = a.findTemplateForItemData(b, c, d); | |
if (null !== d) { | |
nf(d); | |
d = d.copy(); | |
"object" === typeof b && (null === a.$f && (a.$f = new la(Object, B)), a.$f.add(b, d)); | |
var e = c; | |
sk(a) && e++; | |
a.Zd(e, d); | |
tk(a, e, c); | |
d.data = b | |
} | |
} | |
} | |
function tk(a, b, c) { | |
for (a = a.Aa; b < a.length;) { | |
var d = a.ja(b); | |
if (d instanceof B) { | |
var e = b, | |
f = c; | |
d.type === tl ? d.rc = e : d.type === ul && (d.column = e); | |
d.jH = f | |
} | |
b++; | |
c++ | |
} | |
} | |
function vi(a) { | |
a = a.Aa.n; | |
for (var b = a.length, c = 0; c < b; c++) { | |
var d = a[c]; | |
if (d instanceof Vm || d instanceof B && vi(d)) { | |
return !0 | |
} | |
} | |
return !1 | |
} | |
u.defineProperty(B, { | |
PJ: "itemTemplate" | |
}, function() { | |
return null === this.ag ? null : this.ag.ua("") | |
}, function(a) { | |
if (null === this.ag) { | |
if (null === a) { | |
return | |
} | |
this.ag = new la("string", B) | |
} | |
var b = this.ag.ua(""); | |
b !== a && (u.C(a, B, B, "itemTemplate"), (a instanceof G || a.vg) && u.k("itemTemplate must not be a Part or be Panel.isPanelMain: " + a), this.ag.add("", a), this.h("itemTemplate", b, a), a = this.g, null !== a && a.ga.fb || this.Sz()) | |
}); | |
u.defineProperty(B, { | |
kH: "itemTemplateMap" | |
}, function() { | |
return this.ag | |
}, function(a) { | |
var b = this.ag; | |
if (b !== a) { | |
u.C(a, la, B, "itemTemplateMap"); | |
for (var c = a.i; c.next();) { | |
var d = c.value; | |
(d instanceof G || d.vg) && u.k("Template in itemTemplateMap must not be a Part or be Panel.isPanelMain: " + d) | |
} | |
this.ag = a; | |
this.h("itemTemplateMap", b, a); | |
a = this.g; | |
null !== a && a.ga.fb || this.Sz() | |
} | |
}); | |
u.defineProperty(B, { | |
OJ: "itemCategoryProperty" | |
}, function() { | |
return this.Jn | |
}, function(a) { | |
var b = this.Jn; | |
b !== a && ("string" !== typeof a && "function" !== typeof a && u.Ld(a, "string or function", B, "itemCategoryProperty"), this.Jn = a, this.h("itemCategoryProperty", b, a)) | |
}); | |
B.prototype.getCategoryForItemData = function(a) { | |
if (null === a) { | |
return "" | |
} | |
var b = this.Jn, | |
c = ""; | |
if ("function" === typeof b) { | |
c = b(a) | |
} else { | |
if ("string" === typeof b && "object" === typeof a) { | |
if ("" === b) { | |
return "" | |
} | |
c = u.sb(a, b) | |
} else { | |
return "" | |
} | |
} | |
if (void 0 === c) { | |
return "" | |
} | |
if ("string" === typeof c) { | |
return c | |
} | |
u.k("Panel.getCategoryForItemData found a non-string category for " + a + ": " + c); | |
return "" | |
}; | |
var Wm = !1, | |
Xm = null; | |
B.prototype.findTemplateForItemData = function(a, b, c) { | |
a = this.kH; | |
b = null; | |
null !== a && (b = a.ua(c)); | |
null === b && (Wm || (Wm = !0, u.trace('No item template Panel found for category "' + c + '" on ' + this), u.trace(" Using default item template."), c = new B, a = new qa, a.bind(new bf("text", "", de)), c.add(a), Xm = c), b = Xm); | |
return b | |
}; | |
u.defineProperty(B, { | |
HJ: "isAtomic" | |
}, function() { | |
return this.Mg | |
}, function(a) { | |
var b = this.Mg; | |
b !== a && (u.j(a, "boolean", B, "isAtomic"), this.Mg = a, this.h("isAtomic", b, a)) | |
}); | |
u.defineProperty(B, { | |
LD: "isClipping" | |
}, function() { | |
return this.iq | |
}, function(a) { | |
var b = this.iq; | |
b !== a && (u.j(a, "boolean", B, "isClipping"), this.iq = a, this.h("isClipping", b, a)) | |
}); | |
function Se() { | |
u.gc(this); | |
this.Rg = null; | |
this.yu = !0; | |
this.wd = 0; | |
this.Re = NaN; | |
this.oj = 0; | |
this.mj = Infinity; | |
this.ue = uc; | |
this.Na = this.yb = 0; | |
this.Fc = null; | |
this.Lr = Ym; | |
this.Jh = dl; | |
this.Ir = this.wj = null; | |
this.Jr = NaN; | |
this.Jb = this.Fh = null; | |
this.Kp = !1 | |
} | |
u.fa("RowColumnDefinition", Se); | |
Se.prototype.copy = function() { | |
var a = new Se; | |
a.yu = this.yu; | |
a.wd = this.wd; | |
a.Re = this.Re; | |
a.oj = this.oj; | |
a.mj = this.mj; | |
a.ue = this.ue; | |
a.yb = this.yb; | |
a.Na = this.Na; | |
a.Jh = this.Jh; | |
a.Lr = this.Lr; | |
a.wj = null === this.wj ? null : this.wj.Z(); | |
a.Ir = this.Ir; | |
a.Jr = this.Jr; | |
a.Fh = null; | |
null !== this.Fh && (a.Fh = u.Pk(this.Fh)); | |
a.Jb = this.Jb; | |
a.Kp = this.Kp; | |
a.Fc = this.Fc; | |
return a | |
}; | |
Se.prototype.ss = function(a) { | |
u.C(a, Se, Se, "copyFrom:pd"); | |
a.be ? this.height = a.height : this.width = a.width; | |
this.Li = a.Li; | |
this.Lf = a.Lf; | |
this.alignment = a.alignment; | |
this.stretch = a.stretch; | |
this.tt = a.tt; | |
this.wj = null === a.wj ? null : a.wj.Z(); | |
this.fp = a.fp; | |
this.gp = a.gp; | |
this.Fh = null; | |
a.Fh && (this.Fh = u.Pk(a.Fh)); | |
this.background = a.background; | |
this.$y = a.$y; | |
this.Fc = a.Fc | |
}; | |
Se.prototype.toString = function() { | |
return "RowColumnDefinition " + (this.be ? "(Row " : "(Column ") + this.index + ") #" + u.Uc(this) | |
}; | |
var Ym; | |
Se.Default = Ym = u.s(Se, "Default", 0); | |
var Nm; | |
Se.None = Nm = u.s(Se, "None", 1); | |
var Gm; | |
Se.ProportionalExtra = Gm = u.s(Se, "ProportionalExtra", 2); | |
Se.prototype.rl = function(a) { | |
this.Rg = a | |
}; | |
Se.prototype.computeEffectiveSpacingTop = Se.prototype.$C = function() { | |
var a = 0; | |
if (0 !== this.index) { | |
var b = this.Rg, | |
c = this.fp; | |
null === c && null !== b && (c = this.be ? b.bi : b.th); | |
null !== c && (a = this.gp, isNaN(a) && (a = null !== b ? this.be ? b.vh : b.uh : 0)) | |
} | |
b = this.EE; | |
if (null === b) { | |
if (b = this.Rg, null !== b) { | |
b = b.Xi | |
} else { | |
return a | |
} | |
} | |
return a + (this.be ? b.top : b.left) | |
}; | |
Se.prototype.computeEffectiveSpacing = Se.prototype.ng = function() { | |
var a = 0; | |
if (0 !== this.index) { | |
var b = this.Rg, | |
c = this.fp; | |
null === c && null !== b && (c = this.be ? b.bi : b.th); | |
null !== c && (a = this.gp, isNaN(a) && (a = null !== b ? this.be ? b.vh : b.uh : 0)) | |
} | |
b = this.EE; | |
if (null === b) { | |
if (b = this.Rg, null !== b) { | |
b = b.Xi | |
} else { | |
return a | |
} | |
} | |
return a + (this.be ? b.top + b.bottom : b.left + b.right) | |
}; | |
Se.prototype.Rc = function(a, b, c, d, e) { | |
var f = this.Rg; | |
if (null !== f && (f.Cc($d, a, this, b, c, d, e), null !== this.Fc && (b = f.Co(), null !== b && (b = b.data, null !== b)))) { | |
for (c = this.Fc.i; c.next();) { | |
c.value.Ow(this, b, a, null) | |
} | |
} | |
}; | |
u.u(Se, { | |
P: "panel" | |
}, function() { | |
return this.Rg | |
}); | |
u.defineProperty(Se, { | |
be: "isRow" | |
}, function() { | |
return this.yu | |
}, function(a) { | |
this.yu = a | |
}); | |
u.defineProperty(Se, { | |
index: "index" | |
}, function() { | |
return this.wd | |
}, function(a) { | |
this.wd = a | |
}); | |
u.defineProperty(Se, { | |
height: "height" | |
}, function() { | |
return this.Re | |
}, function(a) { | |
var b = this.Re; | |
b !== a && (0 > a && u.xa(a, ">= 0", Se, "height"), this.Re = a, this.Ra = this.yb, null !== this.P && this.P.S(), this.Rc("height", b, a)) | |
}); | |
u.defineProperty(Se, { | |
width: "width" | |
}, function() { | |
return this.Re | |
}, function(a) { | |
var b = this.Re; | |
b !== a && (0 > a && u.xa(a, ">= 0", Se, "width"), this.Re = a, this.Ra = this.yb, null !== this.P && this.P.S(), this.Rc("width", b, a)) | |
}); | |
u.defineProperty(Se, { | |
Li: "minimum" | |
}, function() { | |
return this.oj | |
}, function(a) { | |
var b = this.oj; | |
b !== a && ((0 > a || !isFinite(a)) && u.xa(a, ">= 0", Se, "minimum"), this.oj = a, this.Ra = this.yb, null !== this.P && this.P.S(), this.Rc("minimum", b, a)) | |
}); | |
u.defineProperty(Se, { | |
Lf: "maximum" | |
}, function() { | |
return this.mj | |
}, function(a) { | |
var b = this.mj; | |
b !== a && (0 > a && u.xa(a, ">= 0", Se, "maximum"), this.mj = a, this.Ra = this.yb, null !== this.P && this.P.S(), this.Rc("maximum", b, a)) | |
}); | |
u.defineProperty(Se, { | |
alignment: "alignment" | |
}, function() { | |
return this.ue | |
}, function(a) { | |
var b = this.ue; | |
b.L(a) || (this.ue = a.Z(), null !== this.P && this.P.S(), this.Rc("alignment", b, a)) | |
}); | |
u.defineProperty(Se, { | |
stretch: "stretch" | |
}, function() { | |
return this.Jh | |
}, function(a) { | |
var b = this.Jh; | |
b !== a && (this.Jh = a, null !== this.P && this.P.S(), this.Rc("stretch", b, a)) | |
}); | |
u.defineProperty(Se, { | |
EE: "separatorPadding" | |
}, function() { | |
return this.wj | |
}, function(a) { | |
"number" === typeof a && (a = new rb(a)); | |
var b = this.wj; | |
null !== a && null !== b && b.L(a) || (null !== a && (a = a.Z()), this.wj = a, null !== this.P && this.P.S(), this.Rc("separatorPadding", b, a)) | |
}); | |
u.defineProperty(Se, { | |
fp: "separatorStroke" | |
}, function() { | |
return this.Ir | |
}, function(a) { | |
var b = this.Ir; | |
b !== a && (null === a || "string" === typeof a || a instanceof ga) && (a instanceof ga && a.freeze(), this.Ir = a, null !== this.P && this.P.S(), this.Rc("separatorStroke", b, a)) | |
}); | |
u.defineProperty(Se, { | |
gp: "separatorStrokeWidth" | |
}, function() { | |
return this.Jr | |
}, function(a) { | |
var b = this.Jr; | |
b !== a && (this.Jr = a, null !== this.P && this.P.S(), this.Rc("separatorStrokeWidth", b, a)) | |
}); | |
u.defineProperty(Se, { | |
iI: "separatorDashArray" | |
}, function() { | |
return this.Fh | |
}, function(a) { | |
var b = this.Fh; | |
if (b !== a) { | |
null === a || Array.isArray(a) || u.Ld(a, "Array", Se, "separatorDashArray:value"); | |
if (null !== a) { | |
for (var c = a.length, d = 0, e = 0; e < c; e++) { | |
var f = a[e]; | |
"number" === typeof f && 0 <= f && isFinite(f) || u.k("separatorDashArray:value " + f + " must be a positive number or zero."); | |
d += f | |
} | |
if (0 === d) { | |
if (null === b) { | |
return | |
} | |
a = null | |
} | |
} | |
this.Fh = a; | |
null !== this.P && this.P.na(); | |
this.Rc("separatorDashArray", b, a) | |
} | |
}); | |
u.defineProperty(Se, { | |
background: "background" | |
}, function() { | |
return this.Jb | |
}, function(a) { | |
var b = this.Jb; | |
b !== a && (null === a || "string" === typeof a || a instanceof ga) && (a instanceof ga && a.freeze(), this.Jb = a, null !== this.P && this.P.na(), this.Rc("background", b, a)) | |
}); | |
u.defineProperty(Se, { | |
$y: "coversSeparators" | |
}, function() { | |
return this.Kp | |
}, function(a) { | |
var b = this.Kp; | |
b !== a && (u.j(a, "boolean", Se, "coversSeparators"), this.Kp = a, null !== this.P && this.P.na(), this.Rc("coversSeparators", b, a)) | |
}); | |
u.defineProperty(Se, { | |
tt: "sizing" | |
}, function() { | |
return this.Lr | |
}, function(a) { | |
var b = this.Lr; | |
b !== a && (this.Lr = a, null !== this.P && this.P.S(), this.Rc("sizing", b, a)) | |
}); | |
function Mm(a) { | |
if (a.tt === Ym) { | |
var b = a.Rg; | |
return a.be ? b.dI : b.$F | |
} | |
return a.tt | |
} | |
u.defineProperty(Se, { | |
Ra: "actual" | |
}, function() { | |
return this.yb | |
}, function(a) { | |
this.yb = isNaN(this.Re) ? Math.max(Math.min(this.mj, a), this.oj) : Math.max(Math.min(this.mj, this.Re), this.oj) | |
}); | |
u.defineProperty(Se, { | |
total: "total" | |
}, function() { | |
return this.yb + this.ng() | |
}, function(a) { | |
this.yb = isNaN(this.Re) ? Math.max(Math.min(this.mj, a), this.oj) : Math.max(Math.min(this.mj, this.Re), this.oj); | |
this.yb = Math.max(0, this.yb - this.ng()) | |
}); | |
u.defineProperty(Se, { | |
position: "position" | |
}, function() { | |
return this.Na | |
}, function(a) { | |
this.Na = a | |
}); | |
Se.prototype.bind = Se.prototype.bind = function(a) { | |
a.hg = this; | |
var b = this.P; | |
null !== b && (b = b.Co(), null !== b && Pl(b) && u.k("Cannot add a Binding to a RowColumnDefinition that is already frozen: " + a)); | |
null === this.Fc && (this.Fc = new E(bf)); | |
this.Fc.add(a) | |
}; | |
function X() { | |
T.call(this); | |
this.Qa = null; | |
this.vn = "None"; | |
this.Tg = !1; | |
this.aq = dl; | |
this.jk = null; | |
this.wc = this.ld = "black"; | |
this.Ug = 1; | |
this.fo = "butt"; | |
this.ho = "miter"; | |
this.km = 10; | |
this.jm = null; | |
this.ed = 0; | |
this.ti = this.si = uc; | |
this.fr = this.er = NaN; | |
this.jq = !1; | |
this.pq = !0; | |
this.ir = null; | |
this.yn = this.io = "None"; | |
this.gq = 1 | |
} | |
u.Ha(X, T); | |
u.fa("Shape", X); | |
X.prototype.cloneProtected = function(a) { | |
T.prototype.cloneProtected.call(this, a); | |
a.Qa = this.Qa; | |
a.vn = this.vn; | |
a.Tg = this.Tg; | |
a.aq = this.aq; | |
a.jk = this.jk; | |
a.ld = this.ld; | |
a.wc = this.wc; | |
a.Ug = this.Ug; | |
a.fo = this.fo; | |
a.ho = this.ho; | |
a.km = this.km; | |
a.jm = null; | |
null !== this.jm && (a.jm = u.Pk(this.jm)); | |
a.ed = this.ed; | |
a.si = this.si.Z(); | |
a.ti = this.ti.Z(); | |
a.er = this.er; | |
a.fr = this.fr; | |
a.jq = this.jq; | |
a.pq = this.pq; | |
a.ir = this.ir; | |
a.io = this.io; | |
a.yn = this.yn; | |
a.gq = this.gq | |
}; | |
X.prototype.toString = function() { | |
return "Shape(" + ("None" !== this.Fb ? this.Fb : "None" !== this.lp ? this.lp : this.fz) + ")#" + u.Uc(this) | |
}; | |
function Zm(a, b, c, d) { | |
var e = 0.001, | |
f = d.Ca, | |
h = f.width, | |
f = f.height, | |
k = 0, | |
l = 0, | |
m = 0, | |
n = 0, | |
e = c.length; | |
if (!(4 > e)) { | |
for (var k = c[0], l = c[1], p = 0, q = 0, r = 0, s = m = 0, t = q = 0, v = u.hb(), x = 2; x < e; x += 2) { | |
m = c[x], n = c[x + 1], p = m - k, q = n - l, 0 === p && (p = 0.001), r = q / p, s = Math.atan2(q, p), q = Math.sqrt(p * p + q * q), k = [], k[0] = p, k[1] = s, k[2] = r, k[3] = q, v.push(k), t += q, k = m, l = n | |
} | |
k = c[0]; | |
l = c[1]; | |
c = 0; | |
for (var e = h, n = h / 2, x = 0 === n ? !1 : !0, q = 0, m = v[q], p = m[0], s = m[1], r = m[2], m = m[3], A = 0; 0.1 <= t;) { | |
0 === A && (x ? (e = h, c++, e -= n, t -= n, x = !1) : (e = h, c++), 0 === e && (e = 1)); | |
if (e > t) { | |
u.sa(v); | |
return | |
} | |
e > m ? (A = e - m, e = m) : A = 0; | |
var y = Math.sqrt(e * e / (1 + r * r)); | |
0 > p && (y = -y); | |
k += y; | |
l += r * y; | |
a.translate(k, l); | |
a.rotate(s); | |
a.translate(-(h / 2), -(f / 2)); | |
0 === A && d.Mj(a, b); | |
a.translate(h / 2, f / 2); | |
a.rotate(-s); | |
a.translate(-k, -l); | |
t -= e; | |
m -= e; | |
if (0 !== A) { | |
q++; | |
if (q === v.length) { | |
u.sa(v); | |
return | |
} | |
m = v[q]; | |
p = m[0]; | |
s = m[1]; | |
r = m[2]; | |
m = m[3]; | |
e = A | |
} | |
} | |
u.sa(v) | |
} | |
} | |
X.prototype.Mj = function(a, b) { | |
if (null !== this.wc || null !== this.ld) { | |
null !== this.ld && yl(this, a, this.ld, !0, !1); | |
null !== this.wc && yl(this, a, this.wc, !1, !1); | |
var c = this.Ug; | |
if (0 === c) { | |
var d = this.W; | |
d instanceof lf && d.type === ah && d.xc instanceof X && (c = d.xc.jb) | |
} | |
a.lineWidth = c; | |
a.lineJoin = this.ho; | |
a.lineCap = this.fo; | |
a.miterLimit = this.km; | |
var e = !1; | |
this.W && b.Sg.drawShadows && (e = this.W.il); | |
var f = !0; | |
null !== this.wc && null === this.ld && (f = !1); | |
var d = !1, | |
h = !0, | |
k = this.hA; | |
null !== k && (d = !0, void 0 !== a.setLineDash ? (a.setLineDash(k), a.lineDashOffset = this.ed) : void 0 !== a.webkitLineDash ? (a.webkitLineDash = k, a.webkitLineDashOffset = this.ed) : void 0 !== a.mozDash ? (a.mozDash = k, a.mozDashOffset = this.ed) : h = !1); | |
var l = this.Qa; | |
if (null !== l) { | |
if (l.pa === dd) { | |
a.beginPath(), d && !h ? kl(a, l.nc, l.tc, l.pb, l.Bb, k, this.ed) : (a.moveTo(l.nc, l.tc), a.lineTo(l.pb, l.Bb)), null !== this.ld && zl(a, this.ld), 0 !== c && null !== this.wc && Bl(a) | |
} else { | |
if (l.pa === md) { | |
var m = l.nc, | |
n = l.tc, | |
p = l.pb, | |
q = l.Bb, | |
l = Math.min(m, p), | |
r = Math.min(n, q), | |
m = Math.abs(p - m), | |
n = Math.abs(q - n); | |
null !== this.ld && (a.beginPath(), a.rect(l, r, m, n), zl(a, this.ld)); | |
if (null !== this.wc) { | |
var s = p = 0, | |
t = 0; | |
f && e && (p = a.shadowOffsetX, s = a.shadowOffsetY, t = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0); | |
d && !h ? (h = u.hb(), 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(), $m(a, h, k, this.ed), Bl(a), u.sa(h)) : 0 !== c && (a.beginPath(), a.rect(l, r, m, n), Bl(a)); | |
f && e && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = t) | |
} | |
} else { | |
if (l.pa === nd) { | |
m = l.nc, n = l.tc, p = l.pb, q = l.Bb, 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 + K.ta * l, n - r, m + l, n - K.ta * r, m + l, n), a.bezierCurveTo(m + l, n + K.ta * r, m + K.ta * l, n + r, m, n + r), a.bezierCurveTo(m - K.ta * l, n + r, m - l, n + K.ta * r, m - l, n), a.bezierCurveTo(m - l, n - K.ta * r, m - K.ta * l, n - r, m, n - r), a.closePath(), null !== this.ld && zl(a, this.ld), d && !h && (h = u.hb(), K.Ae(m, n - r, m + K.ta * l, n - r, m + l, n - K.ta * r, m + l, n, 0.5, h), K.Ae(m + l, n, m + l, n + K.ta * r, m + K.ta * l, n + r, m, n + r, 0.5, h), K.Ae(m, n + r, m - K.ta * l, n + r, m - l, n + K.ta * r, m - l, n, 0.5, h), K.Ae(m - l, n, m - l, n - K.ta * r, m - K.ta * l, n - r, m, n - r, 0.5, h), a.beginPath(), $m(a, h, k, this.ed), u.sa(h)), 0 !== c && null !== this.wc && (t = s = p = 0, f && e && (p = a.shadowOffsetX, s = a.shadowOffsetY, t = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), Bl(a), f && e && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = t)) | |
} else { | |
if (l.pa === ad) { | |
r = l.Zi; | |
n = r.length; | |
for (q = 0; q < n; q++) { | |
m = r.n[q]; | |
a.beginPath(); | |
a.moveTo(m.va, m.wa); | |
for (var p = m.Ga.n, s = p.length, v = null, t = 0; t < s; t++) { | |
var x = p[t]; | |
switch (x.pa) { | |
case yd: | |
a.moveTo(x.F, x.G); | |
break; | |
case pd: | |
a.lineTo(x.F, x.G); | |
break; | |
case zd: | |
a.bezierCurveTo(x.dd, x.ze, x.fg, x.gg, x.pb, x.Bb); | |
break; | |
case Ad: | |
a.quadraticCurveTo(x.dd, x.ze, x.pb, x.Bb); | |
break; | |
case Bd: | |
if (x.radiusX === x.radiusY) { | |
v = Math.PI / 180, a.arc(x.dd, x.ze, x.radiusX, x.Ke * v, (x.Ke + x.Rf) * v, 0 > x.Rf) | |
} else { | |
var v = Hd(x, m), | |
A = v.length; | |
if (0 === A) { | |
a.lineTo(x.ma, x.ya); | |
break | |
} | |
for (var y = 0; y < A; y++) { | |
var C = v[y]; | |
0 === y && a.lineTo(C[0], C[1]); | |
a.bezierCurveTo(C[2], C[3], C[4], C[5], C[6], C[7]) | |
} | |
} | |
break; | |
case Gd: | |
y = A = 0; | |
if (null !== v && v.type === Bd) { | |
v = Hd(v, m); | |
C = v.length; | |
if (0 === C) { | |
a.lineTo(x.ma, x.ya); | |
break | |
} | |
v = v[C - 1] || null; | |
null !== v && (A = v[6], y = v[7]) | |
} else { | |
A = null !== v ? v.F : m.va, y = null !== v ? v.G : m.wa | |
} | |
v = Id(x, m, A, y); | |
A = v.length; | |
if (0 === A) { | |
a.lineTo(x.ma, x.ya); | |
break | |
} | |
for (y = 0; y < A; y++) { | |
C = v[y], a.bezierCurveTo(C[2], C[3], C[4], C[5], C[6], C[7]) | |
} | |
break; | |
default: | |
u.k("Segment not of valid type") | |
} | |
x.Bh && a.closePath(); | |
v = x | |
} | |
e ? (t = s = p = 0, m.Gn ? (!0 === m.Ml && null !== this.ld ? (zl(a, this.ld), f = !0) : f = !1, 0 !== c && null !== this.wc && (f && (p = a.shadowOffsetX, s = a.shadowOffsetY, t = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), d && !h || Bl(a), f && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = t))) : (f && (p = a.shadowOffsetX, s = a.shadowOffsetY, t = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), !0 === m.Ml && null !== this.ld && zl(a, this.ld), 0 !== c && null !== this.wc && (d && !h || Bl(a)), f && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = t))) : (!0 === m.Ml && null !== this.ld && zl(a, this.ld), 0 === c || null === this.wc || d && !h || Bl(a)) | |
} | |
if (d && !h) { | |
for (c = f, f = l.Zi, h = f.length, l = 0; l < h; l++) { | |
r = f.n[l]; | |
a.beginPath(); | |
n = u.hb(); | |
n.push(r.va); | |
n.push(r.wa); | |
q = r.va; | |
m = r.wa; | |
p = q; | |
s = m; | |
t = r.Ga.n; | |
x = t.length; | |
for (v = 0; v < x; v++) { | |
A = t[v]; | |
switch (A.pa) { | |
case yd: | |
$m(a, n, k, this.ed); | |
n.length = 0; | |
n.push(A.F); | |
n.push(A.G); | |
q = A.F; | |
m = A.G; | |
p = q; | |
s = m; | |
break; | |
case pd: | |
n.push(A.F); | |
n.push(A.G); | |
q = A.F; | |
m = A.G; | |
break; | |
case zd: | |
K.Ae(q, m, A.dd, A.ze, A.fg, A.gg, A.pb, A.Bb, 0.5, n); | |
q = A.F; | |
m = A.G; | |
break; | |
case Ad: | |
K.Zo(q, m, A.dd, A.ze, A.pb, A.Bb, 0.5, n); | |
q = A.F; | |
m = A.G; | |
break; | |
case Bd: | |
y = Hd(A, r); | |
C = y.length; | |
if (0 === C) { | |
n.push(A.ma); | |
n.push(A.ya); | |
q = A.ma; | |
m = A.ya; | |
break | |
} | |
for (var I = 0; I < C; I++) { | |
var H = y[I]; | |
K.Ae(q, m, H[2], H[3], H[4], H[5], H[6], H[7], 0.5, n); | |
q = H[6]; | |
m = H[7] | |
} | |
break; | |
case Gd: | |
y = Id(A, r, q, m); | |
C = y.length; | |
if (0 === C) { | |
n.push(A.ma); | |
n.push(A.ya); | |
q = A.ma; | |
m = A.ya; | |
break | |
} | |
for (I = 0; I < C; I++) { | |
H = y[I], K.Ae(q, m, H[2], H[3], H[4], H[5], H[6], H[7], 0.5, n), q = H[6], m = H[7] | |
} | |
break; | |
default: | |
u.k("Segment not of valid type") | |
} | |
A.Bh && (n.push(p), n.push(s), $m(a, n, k, this.ed)) | |
} | |
$m(a, n, k, this.ed); | |
u.sa(n); | |
null !== this.wc && (q = n = r = 0, c && e && (r = a.shadowOffsetX, n = a.shadowOffsetY, q = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), Bl(a), c && e && (a.shadowOffsetX = r, a.shadowOffsetY = n, a.shadowBlur = q)) | |
} | |
} | |
} | |
} | |
} | |
} | |
d && (void 0 !== a.setLineDash ? (a.setLineDash(u.nh), a.lineDashOffset = 0) : void 0 !== a.webkitLineDash ? (a.webkitLineDash = u.nh, a.webkitLineDashOffset = 0) : void 0 !== a.mozDash && (a.mozDash = null, a.mozDashOffset = 0)); | |
if (null !== this.fE) { | |
d = this.fE; | |
Ph(d, Infinity, Infinity); | |
k = d.Ca; | |
d.yc(0, 0, k.width, k.height); | |
a.save(); | |
k = this.fd.ub.first(); | |
a.beginPath(); | |
c = u.hb(); | |
c.push(k.va); | |
c.push(k.wa); | |
e = k.va; | |
f = k.wa; | |
h = e; | |
l = f; | |
r = k.Ga.n; | |
n = r.length; | |
for (q = 0; q < n; q++) { | |
m = r[q]; | |
switch (m.pa) { | |
case yd: | |
Zm(a, b, c, d); | |
c.length = 0; | |
c.push(m.F); | |
c.push(m.G); | |
e = m.F; | |
f = m.G; | |
h = e; | |
l = f; | |
break; | |
case pd: | |
c.push(m.F); | |
c.push(m.G); | |
e = m.F; | |
f = m.G; | |
break; | |
case zd: | |
K.Ae(e, f, m.dd, m.ze, m.fg, m.gg, m.pb, m.Bb, 0.5, c); | |
e = m.F; | |
f = m.G; | |
break; | |
case Ad: | |
K.Zo(e, f, m.dd, m.ze, m.pb, m.Bb, 0.5, c); | |
e = m.F; | |
f = m.G; | |
break; | |
case Bd: | |
p = Hd(m, k); | |
s = p.length; | |
if (0 === s) { | |
c.push(m.ma); | |
c.push(m.ya); | |
e = m.ma; | |
f = m.ya; | |
break | |
} | |
for (t = 0; t < s; t++) { | |
x = p[t], K.Ae(e, f, x[2], x[3], x[4], x[5], x[6], x[7], 0.5, c), e = x[6], f = x[7] | |
} | |
break; | |
case Gd: | |
p = Id(m, k, e, f); | |
s = p.length; | |
if (0 === s) { | |
c.push(m.ma); | |
c.push(m.ya); | |
e = m.ma; | |
f = m.ya; | |
break | |
} | |
for (t = 0; t < s; t++) { | |
x = p[t], K.Ae(e, f, x[2], x[3], x[4], x[5], x[6], x[7], 0.5, c), e = x[6], f = x[7] | |
} | |
break; | |
default: | |
u.k("Segment not of valid type") | |
} | |
m.Bh && (c.push(h), c.push(l), Zm(a, b, c, d)) | |
} | |
Zm(a, b, c, d); | |
u.sa(c); | |
a.restore() | |
} | |
} | |
} | |
}; | |
function $m(a, b, c, d) { | |
var e = 0.001, | |
f = c.length, | |
h = 0, | |
k = 0, | |
l = 0, | |
m = 0, | |
e = b.length; | |
if (!(4 > e)) { | |
if (h = b[0], k = b[1], 4 === e) { | |
kl(a, h, k, b[2], b[3], c, d) | |
} else { | |
a.moveTo(h, k); | |
for (var n = 0, p = 0, q = 0, r = p = l = 0, s = u.hb(), t = 2; t < e; t += 2) { | |
l = b[t], m = b[t + 1], n = l - h, p = m - k, 0 === n && (n = 0.001), q = p / n, p = Math.sqrt(n * n + p * p), h = [], h[0] = n, h[1] = q, h[2] = p, s.push(h), r += p, h = l, k = m | |
} | |
h = b[0]; | |
k = b[1]; | |
b = 0; | |
for (var m = !0, e = c[b % f], t = 0 !== d, p = 0, l = s[p], n = l[0], q = l[1], l = l[2], v = 0; 0.1 <= r;) { | |
0 === v && (e = c[b % f], b++, t && (d %= e, e -= d, t = !1)); | |
e > r && (e = r); | |
e > l ? (v = e - l, e = l) : v = 0; | |
var x = Math.sqrt(e * e / (1 + q * q)); | |
0 > n && (x = -x); | |
h += x; | |
k += q * x; | |
m ? a.lineTo(h, k) : a.moveTo(h, k); | |
r -= e; | |
l -= e; | |
if (0 !== v) { | |
p++; | |
if (p === s.length) { | |
u.sa(s); | |
return | |
} | |
l = s[p]; | |
n = l[0]; | |
q = l[1]; | |
l = l[2]; | |
e = v | |
} else { | |
m = !m | |
} | |
} | |
u.sa(s) | |
} | |
} | |
} | |
X.prototype.getDocumentPoint = X.prototype.eb = function(a, b) { | |
void 0 === b && (b = new w); | |
a.oe() && u.k("getDocumentPoint:s Spot must be real: " + a.toString()); | |
var c = this.Ja, | |
d = this.jb; | |
b.m(a.x * (c.width + d) - d / 2 + c.x + a.offsetX, a.y * (c.height + d) - d / 2 + c.y + a.offsetY); | |
this.Gf.bb(b); | |
return b | |
}; | |
X.prototype.Jj = function(a, b) { | |
var c = this.Qa; | |
if (null === c || null === this.fill && null === this.stroke) { | |
return !1 | |
} | |
var d = c.mb, | |
e = this.jb / 2; | |
c.type !== dd || b || (e += 2); | |
var f = u.Tf(); | |
f.assign(d); | |
f.Kf(e + 2, e + 2); | |
if (!f.Da(a)) { | |
return u.ic(f), !1 | |
} | |
d = e + 0.0001; | |
if (c.type === dd) { | |
if (null === this.stroke) { | |
return !1 | |
} | |
d = (c.F - c.va) * (a.x - c.va) + (c.G - c.wa) * (a.y - c.wa); | |
if (0 > (c.va - c.F) * (a.x - c.F) + (c.wa - c.G) * (a.y - c.G) || 0 > d) { | |
return !1 | |
} | |
u.ic(f); | |
return K.sd(c.va, c.wa, c.F, c.G, e, a.x, a.y) | |
} | |
if (c.type === md) { | |
var h = c.va, | |
k = c.wa, | |
l = c.F, | |
m = c.G, | |
c = Math.min(h, l), | |
n = Math.min(k, m), | |
h = Math.abs(l - h), | |
k = Math.abs(m - k); | |
f.x = c; | |
f.y = n; | |
f.width = h; | |
f.height = k; | |
if (null === this.fill) { | |
f.Kf(-d, -d); | |
if (f.Da(a)) { | |
return u.ic(f), !1 | |
} | |
f.Kf(d, d) | |
} | |
null !== this.stroke && f.Kf(e, e); | |
e = f.Da(a); | |
u.ic(f); | |
return e | |
} | |
if (c.type === nd) { | |
h = c.va; | |
k = c.wa; | |
l = c.F; | |
m = c.G; | |
c = Math.min(h, l); | |
n = Math.min(k, m); | |
h = Math.abs(l - h); | |
k = Math.abs(m - k); | |
h /= 2; | |
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 u.ic(f), !1 | |
} | |
h += d; | |
k += d | |
} | |
null !== this.stroke && (h += e, k += e); | |
u.ic(f); | |
return 0 >= h || 0 >= k ? !1 : 1 >= c * c / (h * h) + n * n / (k * k) | |
} | |
if (c.type === ad) { | |
return u.ic(f), null === this.fill ? Ld(c, a.x, a.y, e) : c.Da(a, e, 1 < this.jb, b) | |
} | |
u.k("Unknown Geometry type"); | |
return !1 | |
}; | |
X.prototype.Qo = function(a, b, c, d) { | |
var e = this.za, | |
f = this.Ug; | |
a = Math.max(a, 0); | |
b = Math.max(b, 0); | |
var h; | |
if (this.Tg) { | |
h = this.Qa.mb | |
} else { | |
var k = this.Fb, | |
l = K.Ww[k]; | |
if (void 0 === l) { | |
var m = K.sg[k]; | |
"string" === typeof m && (m = K.sg[m]); | |
"function" === typeof m ? (l = m(null, 100, 100), K.Ww[k] = l) : u.k("Unsupported Figure:" + k) | |
} | |
h = l.mb | |
} | |
var k = h.width, | |
l = h.height, | |
m = h.width, | |
n = h.height; | |
switch (pl(this, !0)) { | |
case qh: | |
d = c = 0; | |
break; | |
case cd: | |
m = Math.max(a - f, 0); | |
n = Math.max(b - f, 0); | |
break; | |
case fl: | |
m = Math.max(a - f, 0); | |
d = 0; | |
break; | |
case el: | |
c = 0, n = Math.max(b - f, 0) | |
} | |
isFinite(e.width) && (m = e.width); | |
isFinite(e.height) && (n = e.height); | |
e = this.cf; | |
h = this.xg; | |
c = Math.max(c, h.width) - f; | |
d = Math.max(d, h.height) - f; | |
m = Math.min(e.width, m); | |
n = Math.min(e.height, n); | |
m = isFinite(m) ? Math.max(c, m) : Math.max(k, c); | |
n = isFinite(n) ? Math.max(d, n) : Math.max(l, d); | |
c = rh(this); | |
switch (c) { | |
case qh: | |
break; | |
case cd: | |
k = m; | |
l = n; | |
break; | |
case sh: | |
c = Math.min(m / k, n / l); | |
isFinite(c) || (c = 1); | |
k *= c; | |
l *= c; | |
break; | |
default: | |
u.k(c + " is not a valid geometryStretch.") | |
} | |
if (this.Tg) { | |
h = this.fd, e = k, d = l, c = h.copy(), h = h.mb, e /= h.width, d /= h.height, isFinite(e) || (e = 1), isFinite(d) || (d = 1), 1 === e && 1 === d || c.scale(e, d), this.Qa = c | |
} else { | |
if (null === this.Qa || this.Qa.Fn !== a - f || this.Qa.En !== b - f) { | |
this.Qa = K.makeGeometry(this, k, l) | |
} | |
} | |
h = this.Qa.mb; | |
Infinity === a || Infinity === b ? ml(this, h.x - f / 2, h.y - f / 2, 0 === a && 0 === k ? 0 : h.width + f, 0 === b && 0 === l ? 0 : h.height + f) : ml(this, -(f / 2), -(f / 2), m + f, n + f) | |
}; | |
function Om(a, b, c) { | |
if (!1 !== Aj(a)) { | |
a.Pc.Ma(); | |
var d = a.Ug; | |
if (0 === d) { | |
var e = a.W; | |
e instanceof lf && e.type === ah && e.xc instanceof X && (d = e.xc.jb) | |
} | |
d *= a.ac; | |
ml(a, -(d / 2), -(d / 2), b + d, c + d); | |
b = a.Pc; | |
c = a.cf; | |
d = a.xg; | |
b.width = Math.min(c.width, b.width); | |
b.height = Math.min(c.height, b.height); | |
b.width = Math.max(d.width, b.width); | |
b.height = Math.max(d.height, b.height); | |
a.Pc.freeze(); | |
a.Pc.I() || u.k("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.Pc.toString()); | |
uj(a, !1) | |
} | |
} | |
function rh(a) { | |
var b = a.zD; | |
return a.Tg ? b === dl ? cd : b : b === dl ? K.Ww[a.Fb].Dd : b | |
} | |
X.prototype.yi = function(a, b, c, d) { | |
ql(this, a, b, c, d) | |
}; | |
X.prototype.getNearestIntersectionPoint = X.prototype.bl = function(a, b, c) { | |
return this.Fo(a.x, a.y, b.x, b.y, c) | |
}; | |
X.prototype.Fo = function(a, b, c, d, e) { | |
var f = this.transform, | |
h = 1 / (f.m11 * f.m22 - f.m12 * f.m21), | |
k = f.m22 * h, | |
l = -f.m12 * h, | |
m = -f.m21 * h, | |
n = f.m11 * h, | |
p = h * (f.m21 * f.dy - f.m22 * f.dx), | |
q = h * (f.m12 * f.dx - f.m11 * f.dy), | |
f = a * k + b * m + p, | |
h = a * l + b * n + q, | |
k = c * k + d * m + p, | |
l = c * l + d * n + q, | |
m = this.jb / 2, | |
p = this.Qa; | |
null === p && (Ph(this, Infinity, Infinity), p = this.Qa); | |
q = p.mb; | |
n = !1; | |
if (p.type === dd) { | |
if (1.5 >= this.jb) { | |
n = K.bh(p.nc, p.tc, p.pb, p.Bb, f, h, k, l, e) | |
} else { | |
var r = 0, | |
s = 0; | |
p.nc === p.pb ? (r = m, s = 0) : (b = (p.Bb - p.tc) / (p.pb - p.nc), s = m / Math.sqrt(1 + b * b), r = s * b); | |
d = u.hb(); | |
b = new w; | |
K.bh(p.nc + r, p.tc + s, p.pb + r, p.Bb + s, f, h, k, l, b) && d.push(b); | |
b = new w; | |
K.bh(p.nc - r, p.tc - s, p.pb - r, p.Bb - s, f, h, k, l, b) && d.push(b); | |
b = new w; | |
K.bh(p.nc + r, p.tc + s, p.nc - r, p.tc - s, f, h, k, l, b) && d.push(b); | |
b = new w; | |
K.bh(p.pb + r, p.Bb + s, p.pb - r, p.Bb - s, f, h, k, l, b) && d.push(b); | |
b = d.length; | |
if (0 === b) { | |
return u.sa(d), !1 | |
} | |
n = !0; | |
s = Infinity; | |
for (r = 0; r < b; r++) { | |
var k = d[r], | |
t = (k.x - f) * (k.x - f) + (k.y - h) * (k.y - h); | |
t < s && (s = t, e.x = k.x, e.y = k.y) | |
} | |
u.sa(d) | |
} | |
} else { | |
if (p.type === md) { | |
b = q.x - m, n = K.bl(b, q.y - m, q.x + q.width + m, q.y + q.height + m, f, h, k, l, e) | |
} else { | |
if (p.type === nd) { | |
a: if (b = q.copy().Kf(m, m), 0 === b.width) { | |
n = K.bh(b.x, b.y, b.x, b.y + b.height, f, h, k, l, e) | |
} else { | |
if (0 === b.height) { | |
n = K.bh(b.x, b.y, b.x + b.width, b.y, f, h, k, l, e) | |
} else { | |
a = b.width / 2; | |
var v = b.height / 2; | |
d = b.x + a; | |
b = b.y + v; | |
c = 9999; | |
f !== k && (c = (h - l) / (f - k)); | |
if (9999 > Math.abs(c)) { | |
n = h - b - c * (f - d); | |
if (0 > a * a * c * c + 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((f - k) * (f - k)) + Math.abs((h - l) * (h - l)); | |
h = Math.abs((f - a) * (f - a)) + Math.abs((h - b) * (h - b)); | |
d < h ? (e.x = k, e.y = l) : (e.x = a, e.y = b) | |
} else { | |
k = v * v; | |
l = f - d; | |
k -= k / (a * a) * l * l; | |
if (0 > k) { | |
e.x = NaN; | |
e.y = NaN; | |
n = !1; | |
break a | |
} | |
m = Math.sqrt(k); | |
l = b + m; | |
b -= m; | |
d = Math.abs(l - h); | |
h = Math.abs(b - h); | |
d < h ? (e.x = f, e.y = l) : (e.x = f, e.y = b) | |
} | |
n = !0 | |
} | |
} | |
} | |
else { | |
if (p.type === ad) { | |
var x = 0, | |
A = 0, | |
y = t = 0, | |
q = u.K(), | |
r = k - f, | |
s = l - h, | |
s = r * r + s * s; | |
e.x = k; | |
e.y = l; | |
for (r = 0; r < p.ub.count; r++) { | |
for (var C = p.ub.n[r], I = C.Ga, x = C.va, A = C.wa, H = x, R = A, aa = 0; aa < I.count; aa++) { | |
var S = I.n[aa], | |
N = S.type, | |
t = S.F, | |
y = S.G, | |
Z = !1; | |
switch (N) { | |
case yd: | |
H = t; | |
R = y; | |
break; | |
case pd: | |
Z = an(x, A, t, y, f, h, k, l, q); | |
break; | |
case zd: | |
var Z = S.Rb, | |
N = S.jc, | |
Ga = S.ff, | |
ua = S.gf, | |
Z = K.ls(x, A, Z, N, Ga, ua, t, y, f, h, k, l, 0.5, q); | |
break; | |
case Ad: | |
Z = (x + 2 * S.Rb) / 3; | |
N = (A + 2 * S.jc) / 3; | |
Ga = (2 * S.Rb + t) / 3; | |
ua = (2 * S.Rb + t) / 3; | |
Z = K.ls(x, A, Z, N, Ga, ua, t, y, f, h, k, l, 0.5, q); | |
break; | |
case Bd: | |
case Gd: | |
N = S.type === Bd ? Hd(S, C) : Id(S, C, x, A); | |
Ga = N.length; | |
if (0 === Ga) { | |
Z = an(x, A, S.ma, S.ya, f, h, k, l, q); | |
break | |
} | |
for (y = 0; y < Ga; y++) { | |
v = N[y], 0 === y && an(x, A, v[0], v[1], f, h, k, l, q) && (t = bn(f, h, q, s, e), t < s && (s = t, n = !0)), K.ls(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7], f, h, k, l, 0.5, q) && (t = bn(f, h, q, s, e), t < s && (s = t, n = !0)) | |
} | |
t = v[6]; | |
y = v[7]; | |
break; | |
default: | |
u.k("Unknown Segment type: " + S.type) | |
} | |
x = t; | |
A = y; | |
Z && (t = bn(f, h, q, s, e), t < s && (s = t, n = !0)); | |
S.fw && (t = H, y = R, an(x, A, t, y, f, h, k, l, q) && (t = bn(f, h, q, s, e), t < s && (s = t, n = !0))) | |
} | |
} | |
f = c - a; | |
h = d - b; | |
b = Math.sqrt(f * f + h * h); | |
0 !== b && (f /= b, h /= b); | |
e.x -= f * m; | |
e.y -= h * m; | |
u.v(q) | |
} else { | |
u.k("Invalid Geometry type") | |
} | |
} | |
} | |
} | |
if (!n) { | |
return !1 | |
} | |
this.transform.bb(e); | |
return !0 | |
}; | |
function bn(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 an(a, b, c, d, e, f, h, k, l) { | |
var m = !1, | |
n = (e - h) * (b - d) - (f - k) * (a - c); | |
if (0 === n) { | |
return !1 | |
} | |
l.x = ((e * k - f * h) * (a - c) - (e - h) * (a * d - b * c)) / n; | |
l.y = ((e * k - f * h) * (b - d) - (f - k) * (a * d - b * c)) / n; | |
(a > c ? a - c : c - a) < (b > d ? b - d : d - b) ? (e = b < d ? b : d, a = b < d ? d : b, (l.y > e || K.Wa(l.y, e)) && (l.y < a || K.Wa(l.y, a)) && (m = !0)) : (e = a < c ? a : c, a = a < c ? c : a, (l.x > e || K.Wa(l.x, e)) && (l.x < a || K.Wa(l.x, a)) && (m = !0)); | |
return m | |
} | |
X.prototype.containedInRect = X.prototype.wm = function(a, b) { | |
if (void 0 === b) { | |
return a.Kj(this.ca) | |
} | |
var c = this.Qa; | |
null === c && (Ph(this, Infinity, Infinity), c = this.Qa); | |
var c = c.mb, | |
d = this.jb / 2, | |
e = !1, | |
f = u.K(); | |
f.m(c.x - d, c.y - d); | |
a.Da(b.bb(f)) && (f.m(c.x - d, c.bottom + d), a.Da(b.bb(f)) && (f.m(c.right + d, c.bottom + d), a.Da(b.bb(f)) && (f.m(c.right + d, c.y - d), a.Da(b.bb(f)) && (e = !0)))); | |
u.v(f); | |
return e | |
}; | |
X.prototype.intersectsRect = X.prototype.ug = function(a, b) { | |
if (this.wm(a, b) || void 0 === b && (b = this.transform, a.Kj(this.ca))) { | |
return !0 | |
} | |
var c = u.lh(); | |
c.set(b); | |
c.pz(); | |
var d = a.left, | |
e = a.right, | |
f = a.top, | |
h = a.bottom, | |
k = u.K(); | |
k.m(d, f); | |
c.bb(k); | |
if (this.Jj(k, !0)) { | |
return u.v(k), !0 | |
} | |
k.m(e, f); | |
c.bb(k); | |
if (this.Jj(k, !0)) { | |
return u.v(k), !0 | |
} | |
k.m(d, h); | |
c.bb(k); | |
if (this.Jj(k, !0)) { | |
return u.v(k), !0 | |
} | |
k.m(e, h); | |
c.bb(k); | |
if (this.Jj(k, !0)) { | |
return u.v(k), !0 | |
} | |
var l = u.K(), | |
m = u.K(); | |
c.set(b); | |
c.bE(this.transform); | |
c.pz(); | |
l.x = e; | |
l.y = f; | |
l.transform(c); | |
k.x = d; | |
k.y = f; | |
k.transform(c); | |
var n = !1; | |
cn(this, k, l, m) ? n = !0 : (k.x = e, k.y = h, k.transform(c), cn(this, k, l, m) ? n = !0 : (l.x = d, l.y = h, l.transform(c), cn(this, k, l, m) ? n = !0 : (k.x = d, k.y = f, k.transform(c), cn(this, k, l, m) && (n = !0)))); | |
u.v(k); | |
u.Ze(c); | |
u.v(l); | |
u.v(m); | |
return n | |
}; | |
function cn(a, b, c, d) { | |
if (!a.bl(b, c, d)) { | |
return !1 | |
} | |
a = b.x; | |
b = b.y; | |
var e = c.x; | |
c = c.y; | |
var f = d.x; | |
d = d.y; | |
if (a === e) { | |
var h = 0; | |
a = 0; | |
b < c ? (h = b, a = c) : (h = c, a = b); | |
return d >= h && d <= a | |
} | |
a < e ? (h = a, a = e) : h = e; | |
return f >= h && f <= a | |
} | |
X.prototype.tD = function(a, b, c) { | |
function d(a, b) { | |
for (var c = a.length, d = 0; d < c; d += 2) { | |
if (b.zo(a[d], a[d + 1]) > e) { | |
return !0 | |
} | |
} | |
return !1 | |
} | |
if (c && null !== this.fill && this.Jj(a, !0)) { | |
return !0 | |
} | |
var e = a.Lj(b); | |
b = e; | |
1.5 < this.jb && (e = this.jb / 2 + Math.sqrt(e), e *= e); | |
var f = this.Qa; | |
null === f && (Ph(this, Infinity, Infinity), f = this.Qa); | |
if (!c) { | |
var h = f.mb, | |
k = h.x, | |
l = h.y, | |
m = h.x + h.width, | |
h = h.y + h.height; | |
if (Ya(a.x, a.y, k, l) <= e && Ya(a.x, a.y, m, l) <= e && Ya(a.x, a.y, k, h) <= e && Ya(a.x, a.y, m, h) <= e) { | |
return !0 | |
} | |
} | |
k = f.nc; | |
l = f.tc; | |
m = f.pb; | |
h = f.Bb; | |
if (f.type === dd) { | |
if (c = Xa(a.x, a.y, k, l, m, h), f = (k - m) * (a.x - m) + (l - h) * (a.y - h), c <= (0 <= (m - k) * (a.x - k) + (h - l) * (a.y - l) && 0 <= f ? e : b)) { | |
return !0 | |
} | |
} else { | |
if (f.type === md) { | |
return b = !1, c && (b = Xa(a.x, a.y, k, l, k, h) <= e || Xa(a.x, a.y, k, l, m, l) <= e || Xa(a.x, a.y, m, l, m, h) <= e || Xa(a.x, a.y, k, h, m, h) <= e), b | |
} | |
if (f.type === nd) { | |
b = a.x - (k + m) / 2; | |
var f = a.y - (l + h) / 2, | |
n = Math.abs(m - k) / 2, | |
p = Math.abs(h - l) / 2; | |
if (0 === n || 0 === p) { | |
return c = Xa(a.x, a.y, k, l, m, h), c <= e ? !0 : !1 | |
} | |
if (c) { | |
if (a = K.tG(n, p, b, f), a * a <= e) { | |
return !0 | |
} | |
} else { | |
return Ya(b, f, -n, 0) >= e || Ya(b, f, 0, -p) >= e || Ya(b, f, 0, p) >= e || Ya(b, f, n, 0) >= e ? !1 : !0 | |
} | |
} else { | |
if (f.type === ad) { | |
h = f.mb; | |
k = h.x; | |
l = h.y; | |
m = h.x + h.width; | |
h = h.y + h.height; | |
if (a.x > m && a.x < k && a.y > h && a.y < l && Xa(a.x, a.y, k, l, k, h) > e && Xa(a.x, a.y, k, l, m, l) > e && Xa(a.x, a.y, m, h, k, h) > e && Xa(a.x, a.y, m, h, m, l) > e) { | |
return !1 | |
} | |
b = Math.sqrt(e); | |
if (c) { | |
if (null === this.fill ? Ld(f, a.x, a.y, b) : f.Da(a, b, !0)) { | |
return !0 | |
} | |
} else { | |
c = f.ub; | |
for (b = 0; b < c.count; b++) { | |
k = c.n[b]; | |
n = k.va; | |
p = k.wa; | |
if (a.zo(n, p) > e) { | |
return !1 | |
} | |
l = k.Ga.n; | |
m = l.length; | |
for (h = 0; h < m; h++) { | |
var q = l[h]; | |
switch (q.type) { | |
case yd: | |
case pd: | |
n = q.F; | |
p = q.G; | |
if (a.zo(n, p) > e) { | |
return !1 | |
} | |
break; | |
case zd: | |
f = u.hb(); | |
K.Ae(n, p, q.Rb, q.jc, q.ff, q.gf, q.F, q.G, 0.8, f); | |
n = d(f, a); | |
u.sa(f); | |
if (n) { | |
return !1 | |
} | |
n = q.F; | |
p = q.G; | |
if (a.zo(n, p) > e) { | |
return !1 | |
} | |
break; | |
case Ad: | |
f = u.hb(); | |
K.Zo(n, p, q.Rb, q.jc, q.F, q.G, 0.8, f); | |
n = d(f, a); | |
u.sa(f); | |
if (n) { | |
return !1 | |
} | |
n = q.F; | |
p = q.G; | |
if (a.zo(n, p) > e) { | |
return !1 | |
} | |
break; | |
case Bd: | |
case Gd: | |
var r = q.type === Bd ? Hd(q, k) : Id(q, k, n, p), | |
s = r.length; | |
if (0 === s) { | |
n = q.ma; | |
p = q.ya; | |
if (a.zo(n, p) > e) { | |
return !1 | |
} | |
break | |
} | |
q = null; | |
f = u.hb(); | |
for (b = 0; b < s; b++) { | |
if (q = r[b], f.length = 0, K.Ae(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7], 0.8, f), d(f, a)) { | |
return u.sa(f), !1 | |
} | |
} | |
u.sa(f); | |
null !== q && (n = q[6], p = q[7]); | |
break; | |
default: | |
u.k("Unknown Segment type: " + q.type) | |
} | |
} | |
} | |
return !0 | |
} | |
} | |
} | |
} | |
return !1 | |
}; | |
u.defineProperty(X, { | |
fd: "geometry" | |
}, function() { | |
return this.jk ? this.jk : this.Qa | |
}, function(a) { | |
var b = this.Qa; | |
if (b !== a) { | |
this.jk = null !== a ? this.Qa = a.freeze() : this.Qa = null; | |
var c = this.W; | |
null !== c && (c.kj = NaN); | |
this.Tg = !0; | |
this.S(); | |
this.h("geometry", b, a); | |
a = this.W; | |
null !== a && 0 !== (this.ea & 1024) && ll(this, a, "geometryString") | |
} | |
}); | |
u.defineProperty(X, { | |
FG: "geometryString" | |
}, function() { | |
return null === this.fd ? "" : this.fd.toString() | |
}, function(a) { | |
var b = sd(a); | |
a = b.normalize(); | |
this.fd = b; | |
var b = u.K(), | |
c = this.position; | |
c.I() ? b.m(c.x - a.x, c.y - a.y) : b.m(-a.x, -a.y); | |
this.position = b; | |
u.v(b) | |
}); | |
u.defineProperty(X, { | |
sz: "isGeometryPositioned" | |
}, function() { | |
return this.jq | |
}, function(a) { | |
var b = this.jq; | |
b !== a && (this.jq = a, this.S(), this.h("isGeometryPositioned", b, a)) | |
}); | |
X.prototype.me = function() { | |
this.Tg ? this.jk = null : this.Qa = null; | |
this.S() | |
}; | |
u.defineProperty(X, { | |
fill: "fill" | |
}, function() { | |
return this.ld | |
}, function(a) { | |
var b = this.ld; | |
b !== a && (a instanceof ga && a.freeze(), this.ld = a, this.na(), this.h("fill", b, a)) | |
}); | |
u.defineProperty(X, { | |
stroke: "stroke" | |
}, function() { | |
return this.wc | |
}, function(a) { | |
var b = this.wc; | |
b !== a && (a instanceof ga && a.freeze(), this.wc = a, this.na(), this.h("stroke", b, a)) | |
}); | |
u.defineProperty(X, { | |
jb: "strokeWidth" | |
}, function() { | |
return this.Ug | |
}, function(a) { | |
var b = this.Ug; | |
if (b !== a) { | |
if (0 <= a) { | |
this.Ug = a; | |
this.S(); | |
var c = this.W; | |
null !== c && (c.kj = NaN); | |
this.h("strokeWidth", b, a) | |
} else { | |
u.xa(a, "value >= 0", X, "strokeWidth:value") | |
} | |
} | |
}); | |
u.defineProperty(X, { | |
sI: "strokeCap" | |
}, function() { | |
return this.fo | |
}, function(a) { | |
var b = this.fo; | |
b !== a && ("string" !== typeof a || "butt" !== a && "round" !== a && "square" !== a ? u.xa(a, '"butt", "round", or "square"', X, "strokeCap") : (this.fo = a, this.na(), this.h("strokeCap", b, a))) | |
}); | |
u.defineProperty(X, { | |
zK: "strokeJoin" | |
}, function() { | |
return this.ho | |
}, function(a) { | |
var b = this.ho; | |
b !== a && ("string" !== typeof a || "miter" !== a && "bevel" !== a && "round" !== a ? u.xa(a, '"miter", "bevel", or "round"', X, "strokeJoin") : (this.ho = a, this.na(), this.h("strokeJoin", b, a))) | |
}); | |
u.defineProperty(X, { | |
AK: "strokeMiterLimit" | |
}, function() { | |
return this.km | |
}, function(a) { | |
var b = this.km; | |
if (b !== a) { | |
if (0 < a) { | |
this.km = a; | |
this.na(); | |
var c = this.W; | |
null !== c && (c.kj = NaN); | |
this.h("strokeMiterLimit", b, a) | |
} else { | |
u.xa(a, "value > 0", X, "strokeWidth:value") | |
} | |
} | |
}); | |
u.defineProperty(X, { | |
hA: "strokeDashArray" | |
}, function() { | |
return this.jm | |
}, function(a) { | |
var b = this.jm; | |
if (b !== a) { | |
null === a || Array.isArray(a) || u.Ld(a, "Array", X, "strokeDashArray:value"); | |
if (null !== a) { | |
for (var c = a.length, d = 0, e = 0; e < c; e++) { | |
var f = a[e]; | |
"number" === typeof f && 0 <= f && isFinite(f) || u.k("strokeDashArray:value " + f + " must be a positive number or zero."); | |
d += f | |
} | |
if (0 === d) { | |
if (null === b) { | |
return | |
} | |
a = null | |
} | |
} | |
this.jm = a; | |
this.na(); | |
this.h("strokeDashArray", b, a) | |
} | |
}); | |
u.defineProperty(X, { | |
tI: "strokeDashOffset" | |
}, function() { | |
return this.ed | |
}, function(a) { | |
var b = this.ed; | |
b !== a && 0 <= a && (this.ed = a, this.na(), this.h("strokeDashOffset", b, a)) | |
}); | |
u.defineProperty(X, { | |
Fb: "figure" | |
}, function() { | |
return this.vn | |
}, function(a) { | |
var b = this.vn; | |
if (b !== a) { | |
var c = K.sg[a]; | |
"function" === typeof c ? c = a : (c = K.sg[a.toLowerCase()]) || u.k("Unknown Shape.figure: " + a); | |
b !== c && (a = this.W, null !== a && (a.kj = NaN), this.vn = c, this.Tg = !1, this.me(), this.h("figure", b, c)) | |
} | |
}); | |
u.defineProperty(X, { | |
lp: "toArrow" | |
}, function() { | |
return this.io | |
}, function(a) { | |
var b = this.io; | |
!0 === a ? a = "Standard" : !1 === a && (a = ""); | |
if (b !== a) { | |
var c = K.UC(a); | |
null === c ? u.k("Unknown Shape.toArrow: " + a) : b !== c && (this.io = c, this.Tg = !1, this.me(), dn(this), this.h("toArrow", b, c)) | |
} | |
}); | |
u.defineProperty(X, { | |
fz: "fromArrow" | |
}, function() { | |
return this.yn | |
}, function(a) { | |
var b = this.yn; | |
!0 === a ? a = "Standard" : !1 === a && (a = ""); | |
if (b !== a) { | |
var c = K.UC(a); | |
null === c ? u.k("Unknown Shape.fromArrow: " + a) : b !== c && (this.yn = c, this.Tg = !1, this.me(), dn(this), this.h("fromArrow", b, c)) | |
} | |
}); | |
function dn(a) { | |
var b = a.g; | |
null !== b && b.ga.fb || (a.Ew = en, "None" !== a.io ? (a.Qf = -1, a.Hj = xc) : "None" !== a.yn && (a.Qf = 0, a.Hj = new L(1 - xc.x, xc.y))) | |
} | |
u.defineProperty(X, { | |
A: "spot1" | |
}, function() { | |
return this.si | |
}, function(a) { | |
u.C(a, L, X, "spot1"); | |
var b = this.si; | |
b.L(a) || (this.si = a = a.Z(), this.S(), this.h("spot1", b, a)) | |
}); | |
u.defineProperty(X, { | |
B: "spot2" | |
}, function() { | |
return this.ti | |
}, function(a) { | |
u.C(a, L, X, "spot2"); | |
var b = this.ti; | |
b.L(a) || (this.ti = a = a.Z(), this.S(), this.h("spot2", b, a)) | |
}); | |
u.defineProperty(X, { | |
vc: "parameter1" | |
}, function() { | |
return this.er | |
}, function(a) { | |
var b = this.er; | |
b !== a && (this.er = a, this.me(), this.h("parameter1", b, a)) | |
}); | |
u.defineProperty(X, { | |
ft: "parameter2" | |
}, function() { | |
return this.fr | |
}, function(a) { | |
var b = this.fr; | |
b !== a && (this.fr = a, this.me(), this.h("parameter2", b, a)) | |
}); | |
u.u(X, { | |
Ja: "naturalBounds" | |
}, function() { | |
if (null !== this.Qa) { | |
return this.Gc.assign(this.Qa.mb), this.Gc | |
} | |
var a = this.za; | |
return new z(0, 0, a.width, a.height) | |
}); | |
u.defineProperty(X, { | |
KJ: "isRectangular" | |
}, function() { | |
return this.pq | |
}, function(a) { | |
var b = this.pq; | |
b !== a && (this.pq = a, this.S(), this.h("isRectangular", b, a)) | |
}); | |
u.defineProperty(X, { | |
fE: "pathObject" | |
}, function() { | |
return this.ir | |
}, function(a) { | |
var b = this.ir; | |
b !== a && (this.ir = a, this.na(), this.h("pathObject", b, a)) | |
}); | |
u.defineProperty(X, { | |
zD: "geometryStretch" | |
}, function() { | |
return this.aq | |
}, function(a) { | |
var b = this.aq; | |
b !== a && (u.rb(a, T, X, "geometryStretch"), this.aq = a, this.h("geometryStretch", b, a)) | |
}); | |
u.defineProperty(X, { | |
interval: "interval" | |
}, function() { | |
return this.gq | |
}, function(a) { | |
var b = this.gq; | |
a = Math.floor(a); | |
b !== a && 0 <= a && (this.gq = a, null !== this.g && vj(this.g), this.S(), this.h("interval", b, a)) | |
}); | |
X.getFigureGenerators = function() { | |
var a = new la("string", "function"), | |
b; | |
for (b in K.sg) { | |
if (b !== b.toLowerCase()) { | |
var c = K.sg[b]; | |
"function" === typeof c && a.add(b, c) | |
} | |
} | |
a.freeze(); | |
return a | |
}; | |
X.defineFigureGenerator = function(a, b) { | |
u.j(a, "string", X, "defineFigureGenerator:name"); | |
"string" === typeof b ? "" !== b && K.sg[b] || u.k("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: " + b) : u.j(b, "function", X, "defineFigureGenerator:func"); | |
var c = a.toLowerCase(); | |
"" !== a && "none" !== c && a !== c || u.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: " + a); | |
var d = K.sg; | |
d[a] = b; | |
d[c] = a | |
}; | |
X.getArrowheadGeometries = function() { | |
var a = new la("string", $c), | |
b; | |
for (b in K.Ri) { | |
if (b !== b.toLowerCase()) { | |
var c = K.Ri[b]; | |
c instanceof $c && a.add(b, c) | |
} | |
} | |
a.freeze(); | |
return a | |
}; | |
X.defineArrowheadGeometry = function(a, b) { | |
u.j(a, "string", X, "defineArrowheadGeometry:name"); | |
var c = null; | |
"string" === typeof b ? (u.j(b, "string", X, "defineArrowheadGeometry:pathstr"), c = sd(b, !1)) : (u.C(b, $c, X, "defineArrowheadGeometry:pathstr"), c = b); | |
var d = a.toLowerCase(); | |
"" !== a && "none" !== d && a !== d || u.k("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: " + a); | |
var e = K.Ri; | |
e[a] = c; | |
e[d] = a | |
}; | |
function qa() { | |
T.call(this); | |
this.je = ""; | |
this.wc = "black"; | |
this.Jg = "13px sans-serif"; | |
this.Sd = "start"; | |
this.mq = !0; | |
this.Ol = this.Pl = !1; | |
this.Ek = fn; | |
this.nm = gn; | |
this.Iu = this.xe = 0; | |
this.xn = this.by = this.ey = null; | |
this.ej = new hn; | |
this.Vp = !1; | |
this.mf = this.Hk = this.Tr = null; | |
this.zj = this.yj = 0; | |
this.ji = Infinity; | |
this.Cu = 0 | |
} | |
u.Ha(qa, T); | |
u.fa("TextBlock", qa); | |
var jn = new pa, | |
kn = 0, | |
ln = new pa, | |
mn = 0, | |
nn = "...", | |
on = "", | |
pn = u.createElement("canvas").getContext("2d"); | |
qa.getEllipsis = function() { | |
return nn | |
}; | |
qa.setEllipsis = function(a) { | |
nn = a; | |
ln = new pa; | |
mn = 0 | |
}; | |
qa.prototype.cloneProtected = function(a) { | |
T.prototype.cloneProtected.call(this, a); | |
a.je = this.je; | |
a.wc = this.wc; | |
a.Jg = this.Jg; | |
a.Sd = this.Sd; | |
a.mq = this.mq; | |
a.Pl = this.Pl; | |
a.Ol = this.Ol; | |
a.nm = this.nm; | |
a.Ek = this.Ek; | |
a.xe = this.xe; | |
a.Iu = this.Iu; | |
a.ey = this.ey; | |
a.by = this.by; | |
a.xn = this.xn; | |
a.ej.ss(this.ej); | |
a.Vp = this.Vp; | |
a.Tr = this.Tr; | |
a.Hk = this.Hk; | |
a.mf = this.mf; | |
a.yj = this.yj; | |
a.zj = this.zj; | |
a.ji = this.ji; | |
a.Cu = this.Cu | |
}; | |
qa.prototype.toString = function() { | |
return 22 < this.je.length ? 'TextBlock("' + this.je.substring(0, 20) + '"...)' : 'TextBlock("' + this.je + '")' | |
}; | |
var qn; | |
qa.None = qn = u.s(qa, "None", 0); | |
var rn; | |
qa.WrapFit = rn = u.s(qa, "WrapFit", 1); | |
var gn; | |
qa.WrapDesiredSize = gn = u.s(qa, "WrapDesiredSize", 2); | |
var fn; | |
qa.OverflowClip = fn = u.s(qa, "OverflowClip", 0); | |
var sn; | |
qa.OverflowEllipsis = sn = u.s(qa, "OverflowEllipsis", 1); | |
qa.prototype.S = function() { | |
T.prototype.S.call(this); | |
this.by = this.ey = null | |
}; | |
u.defineProperty(qa, { | |
font: "font" | |
}, function() { | |
return this.Jg | |
}, function(a) { | |
var b = this.Jg; | |
b !== a && (this.Jg = a, this.xn = null, this.S(), this.h("font", b, a)) | |
}); | |
qa.isValidFont = function(a) { | |
var b = pn.font; | |
if (a === b || "10px sans-serif" === a) { | |
return !0 | |
} | |
pn.font = "10px sans-serif"; | |
var c; | |
pn.font = a; | |
var d = pn.font; | |
if ("10px sans-serif" !== d) { | |
return pn.font = b, !0 | |
} | |
pn.font = "19px serif"; | |
c = pn.font; | |
pn.font = a; | |
d = pn.font; | |
pn.font = b; | |
return d !== c | |
}; | |
u.defineProperty(qa, { | |
text: "text" | |
}, function() { | |
return this.je | |
}, function(a) { | |
var b = this.je; | |
a = null !== a && void 0 !== a ? a.toString() : ""; | |
b !== a && (this.je = a, this.S(), this.h("text", b, a)) | |
}); | |
u.defineProperty(qa, { | |
textAlign: "textAlign" | |
}, function() { | |
return this.Sd | |
}, function(a) { | |
var b = this.Sd; | |
b !== a && ("start" === a || "end" === a || "left" === a || "right" === a || "center" === a ? (this.Sd = a, this.na(), this.h("textAlign", b, a)) : u.xa(a, '"start", "end", "left", "right", or "center"', qa, "textAlign")) | |
}); | |
u.u(qa, { | |
Ja: "naturalBounds" | |
}, function() { | |
if (!this.Gc.I()) { | |
var a = tn(this, this.je, this.ej, 999999).width, | |
b = un(this, a, this.ej), | |
c = this.za; | |
isNaN(c.width) || (a = c.width); | |
isNaN(c.height) || (b = c.height); | |
bb(this.Gc, a, b) | |
} | |
return this.Gc | |
}); | |
u.defineProperty(qa, { | |
jw: "isMultiline" | |
}, function() { | |
return this.mq | |
}, function(a) { | |
var b = this.mq; | |
b !== a && (this.mq = a, this.S(), this.h("isMultiline", b, a)) | |
}); | |
u.defineProperty(qa, { | |
NJ: "isUnderline" | |
}, function() { | |
return this.Pl | |
}, function(a) { | |
var b = this.Pl; | |
b !== a && (this.Pl = a, this.na(), this.h("isUnderline", b, a)) | |
}); | |
u.defineProperty(qa, { | |
LJ: "isStrikethrough" | |
}, function() { | |
return this.Ol | |
}, function(a) { | |
var b = this.Ol; | |
b !== a && (this.Ol = a, this.na(), this.h("isStrikethrough", b, a)) | |
}); | |
u.defineProperty(qa, { | |
bF: "wrap" | |
}, function() { | |
return this.nm | |
}, function(a) { | |
var b = this.nm; | |
b !== a && (this.nm = a, this.S(), this.h("wrap", b, a)) | |
}); | |
u.defineProperty(qa, { | |
overflow: "overflow" | |
}, function() { | |
return this.Ek | |
}, function(a) { | |
var b = this.Ek; | |
b !== a && (this.Ek = a, this.S(), this.h("overflow", b, a)) | |
}); | |
u.defineProperty(qa, { | |
stroke: "stroke" | |
}, function() { | |
return this.wc | |
}, function(a) { | |
var b = this.wc; | |
b !== a && (a instanceof ga && a.freeze(), this.wc = a, this.na(), this.h("stroke", b, a)) | |
}); | |
u.u(qa, { | |
pH: "lineCount" | |
}, function() { | |
return this.xe | |
}); | |
u.defineProperty(qa, { | |
cz: "editable" | |
}, function() { | |
return this.Vp | |
}, function(a) { | |
var b = this.Vp; | |
b !== a && (this.Vp = a, this.h("editable", b, a)) | |
}); | |
u.defineProperty(qa, { | |
NE: "textEditor" | |
}, function() { | |
return this.Tr | |
}, function(a) { | |
var b = this.Tr; | |
b !== a && (a instanceof HTMLElement || u.k("textEditor must be an HTMLElement"), this.Tr = a, this.h("textEditor", b, a)) | |
}); | |
u.defineProperty(qa, { | |
dz: "errorFunction" | |
}, function() { | |
return this.mf | |
}, function(a) { | |
var b = this.mf; | |
b !== a && (null !== a && u.j(a, "function", qa, "errorFunction"), this.mf = a, this.h("errorFunction", b, a)) | |
}); | |
function xl(a, b) { | |
var c = a.Jg; | |
null !== c && b.Ft !== c && (b.font = c, b.Ft = c) | |
} | |
qa.prototype.Mj = function(a, b) { | |
if (null !== this.wc && 0 !== this.je.length && null !== this.Jg) { | |
var c = this.Ja.width, | |
d = vn(this); | |
a.textAlign = this.Sd; | |
yl(this, a, this.wc, !0, !1); | |
(this.Pl || this.Ol) && yl(this, a, this.wc, !1, !1); | |
var e = this.ej, | |
f = 0, | |
h = !1, | |
k = u.Yb(0, 0); | |
this.Gf.bb(k); | |
var l = u.Yb(0, d); | |
this.Gf.bb(l); | |
var m = k.Lj(l); | |
u.v(k); | |
u.v(l); | |
k = b.scale; | |
8 > m * k * k && (h = !0); | |
b.Ig !== a && (h = !1); | |
!1 === b.$v("textGreeking") && (h = !1); | |
for (var m = this.yj, k = this.zj, l = this.xe, n = 0; n < l; n++) { | |
var p = e.jf[n], | |
q = e.ve[n]; | |
p > c && (p = c); | |
var f = f + m, | |
r = q, | |
q = a, | |
s = f, | |
t = c, | |
v = d, | |
x = 0; | |
h ? ("start" === this.Sd || "left" === this.Sd ? x = 0 : "end" === this.Sd || "right" === this.Sd ? x = t - p : "center" === this.Sd ? x = (t - p) / 2 : u.k("textAlign must be start, end, left, right, or center"), q.fillRect(0 + x, s + 0.25 * v, p, 1)) : ("start" === this.Sd || "left" === this.Sd ? x = 0 : "end" === this.Sd || "right" === this.Sd ? x = t : "center" === this.Sd ? x = t / 2 : u.k("textAlign must be start, end, left, right, or center"), q.fillText(r, 0 + x, s + v - 0.25 * v), r = v / 20 | 0, 0 === r && (r = 1), "end" === this.Sd || "right" === this.Sd ? x -= p : "center" === this.Sd && (x -= p / 2), this.Pl && (q.beginPath(), q.lineWidth = r, q.moveTo(0 + x, s + v - 0.2 * v), q.lineTo(0 + x + p, s + v - 0.2 * v), q.stroke()), this.Ol && (q.beginPath(), q.lineWidth = r, s = s + v - v / 2.2 | 0, 0 !== r % 2 && (s += 0.5), q.moveTo(0 + x, s), q.lineTo(0 + x + p, s), q.stroke())); | |
f += d + k | |
} | |
} | |
}; | |
qa.prototype.Qo = function(a, b, c, d) { | |
this.Cu = a; | |
var e = this.ej; | |
e.reset(); | |
var f = 0, | |
h = 0; | |
if (isNaN(this.za.width)) { | |
f = this.je.replace(/\r\n/g, "\n").replace(/\r/g, "\n"); | |
if (0 === f.length) { | |
f = 0 | |
} else { | |
if (this.jw) { | |
for (var k = h = 0, l = !1; !l;) { | |
var m = f.indexOf("\n", k); - 1 === m && (m = f.length, l = !0); | |
k = wn(f.substr(k, m - k).replace(/^\s+|\s+$/g, ""), this.Jg); | |
k > h && (h = k); | |
k = m + 1 | |
} | |
f = h | |
} else { | |
h = f.indexOf("\n", 0), 0 <= h && (f = f.substr(0, h)), f = k = wn(f, this.Jg) | |
} | |
} | |
f = Math.min(f, a / this.scale); | |
f = Math.max(8, f) | |
} else { | |
f = this.za.width | |
} | |
null !== this.P && (f = Math.min(f, this.P.cf.width), f = Math.max(f, this.P.xg.width)); | |
h = un(this, f, e); | |
m = h = isNaN(this.za.height) ? Math.min(h, b / this.scale) : this.za.height; | |
if (0 !== e.Pe && 1 !== e.ve.length && this.Ek === sn && (b = this.Jg, l = this.Ek === sn ? xn(b) : 0, k = this.yj + this.zj, k = Math.max(0, vn(this) + k), m = Math.min(this.wH - 1, Math.max(Math.floor(m / k) - 1, 0)), !(m + 1 >= e.ve.length))) { | |
k = e.ve[m]; | |
for (a = Math.max(1, a - l); wn(k, b) > a && 1 < k.length;) { | |
k = k.substr(0, k.length - 1) | |
} | |
k += nn; | |
a = wn(k, b); | |
e.ve[m] = k; | |
e.ve = e.ve.slice(0, m + 1); | |
e.jf[m] = a; | |
e.jf = e.jf.slice(0, m + 1); | |
e.xi = e.ve.length; | |
e.Pe = Math.max(e.Pe, a); | |
this.xe = e.xi | |
} | |
if (this.bF === rn || isNaN(this.za.width)) { | |
f = e.Pe, isNaN(this.za.width) && (f = Math.max(8, f)) | |
} | |
f = Math.max(c, f); | |
h = Math.max(d, h); | |
bb(this.Gc, f, h); | |
ml(this, 0, 0, f, h) | |
}; | |
qa.prototype.yi = function(a, b, c, d) { | |
ql(this, a, b, c, d) | |
}; | |
function tn(a, b, c, d) { | |
b = b.replace(/^\s+|\s+$/g, ""); | |
var e = 0, | |
f = 0, | |
h = 0, | |
k = a.Jg, | |
f = a.yj + a.zj, | |
l = Math.max(0, vn(a) + f), | |
h = a.Ek === sn ? xn(k) : 0; | |
if (a.xe >= a.ji) { | |
return new ia(0, l) | |
} | |
if (a.nm === qn) { | |
c.xi = 1; | |
f = wn(b, k); | |
if (0 === h || f <= d) { | |
return c.Pe = f, c.jf.push(c.Pe), c.ve.push(b), new ia(f, l) | |
} | |
var m = yn(b); | |
b = b.substr(m.length); | |
for (var n = yn(b), f = wn(m + n, k); 0 < n.length && f <= d;) { | |
m += n, b = b.substr(n.length), n = yn(b), f = wn((m + n).replace(/^\s+|\s+$/g, ""), k) | |
} | |
m += n.replace(/^\s+|\s+$/g, ""); | |
for (d = Math.max(1, d - h); wn(m, k) > d && 1 < m.length;) { | |
m = m.substr(0, m.length - 1) | |
} | |
m += nn; | |
h = wn(m, k); | |
c.jf.push(h); | |
c.Pe = h; | |
c.ve.push(m); | |
return new ia(h, l) | |
} | |
var p = 0; | |
0 === b.length && (p = 1, c.jf.push(0), c.ve.push(b)); | |
for (; 0 < b.length;) { | |
m = yn(b); | |
for (b = b.substr(m.length); wn(m, k) > d;) { | |
n = 1; | |
f = wn(m.substr(0, n), k); | |
for (h = 0; f <= d;) { | |
n++, h = f, f = wn(m.substr(0, n), k) | |
} | |
1 === n ? (c.jf[a.xe + p] = f, e = Math.max(e, f)) : (c.jf[a.xe + p] = h, e = Math.max(e, h)); | |
n--; | |
1 > n && (n = 1); | |
c.ve[a.xe + p] = m.substr(0, n); | |
p++; | |
m = m.substr(n); | |
if (a.xe + p > a.ji) { | |
break | |
} | |
} | |
n = yn(b); | |
for (f = wn(m + n, k); 0 < n.length && f <= d;) { | |
m += n, b = b.substr(n.length), n = yn(b), f = wn((m + n).replace(/^\s+|\s+$/g, ""), k) | |
} | |
m = m.replace(/^\s+|\s+$/g, ""); | |
if ("" !== m && (0 === n.length ? (c.jf.push(f), e = Math.max(e, f)) : (h = wn(m, k), c.jf.push(h), e = Math.max(e, h)), c.ve.push(m), p++, a.xe + p > a.ji)) { | |
break | |
} | |
} | |
c.xi = Math.min(a.ji, p); | |
c.Pe = Math.max(c.Pe, e); | |
return new ia(c.Pe, l * c.xi) | |
} | |
function yn(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 wn(a, b) { | |
on !== b && (on = pn.font = b); | |
return pn.measureText(a).width | |
} | |
function vn(a) { | |
if (null !== a.xn) { | |
return a.xn | |
} | |
var b = a.Jg; | |
on !== b && (on = pn.font = b); | |
var c = 0; | |
void 0 !== jn[b] && 5000 > kn ? c = jn[b] : (c = 1.3 * pn.measureText("M").width, jn[b] = c, kn++); | |
return a.xn = c | |
} | |
function xn(a) { | |
on !== a && (on = pn.font = a); | |
var b = 0; | |
void 0 !== ln[a] && 5000 > mn ? b = ln[a] : (b = pn.measureText(nn).width, ln[a] = b, mn++); | |
return b | |
} | |
function un(a, b, c) { | |
var d = a.je.replace(/\r\n/g, "\n").replace(/\r/g, "\n"), | |
e = a.yj + a.zj, | |
e = Math.max(0, vn(a) + e); | |
if (0 === d.length) { | |
return c.Pe = 0, a.xe = 1, e | |
} | |
if (!a.jw) { | |
var f = d.indexOf("\n", 0); | |
0 <= f && (d = d.substr(0, f)) | |
} | |
for (var f = 0, h = a.xe = 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.nm !== qn ? (c.xi = 0, h = tn(a, h, c, b), f += h.height, a.xe += c.xi) : (tn(a, h, c, b), f += e, a.xe++), a.xe === a.ji && (l = !0)), h = k + 1 | |
} | |
return a.Iu = f | |
} | |
u.defineProperty(qa, { | |
kA: "textValidation" | |
}, function() { | |
return this.Hk | |
}, function(a) { | |
var b = this.Hk; | |
b !== a && (null !== a && u.j(a, "function", qa, "textValidation"), this.Hk = a, this.h("textValidation", b, a)) | |
}); | |
u.defineProperty(qa, { | |
wK: "spacingAbove" | |
}, function() { | |
return this.yj | |
}, function(a) { | |
var b = this.yj; | |
b !== a && (this.yj = a, this.h("spacingAbove", b, a)) | |
}); | |
u.defineProperty(qa, { | |
xK: "spacingBelow" | |
View raw
(Sorry about that, but we can’t show files that are this big right now.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment