Go JS 1.7 去水印
在go.js官网下载了js文件,在使用的过程中发现免费版的js自带水印╮(╯▽╰)╭ 简直不能忍。
于是查看源js文件,直接将水印的代码删除,之后拿了几个官网的demo代码实验,没发现什么毛病。
版本 GoJS version 1.7 。新建一个go.js文件将下面js代码Copy即可使用。
(function (window) { var g, ca = {}; if (!window.document || void 0 === window.document.createElement("canvas").getContext) throw window.console && window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."), Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."); if (!Object.defineProperty) throw Error("GoJS requires a newer version of JavaScript"); Function.prototype.bind || (Function.prototype.bind = function (a) { function b() { return f.apply(a, e.concat(d.call(arguments))) } function c() { } var d = Array.prototype.slice, e = d.call(arguments, 1), f = this; c.prototype = this.prototype; b.prototype = new c; return b }); (function () { for (var a = 0, b = ["ms", "moz", "webkit", "o"], c = 0; c < b.length && !window.requestAnimationFrame; ++c)window.requestAnimationFrame = window[b[c] + "RequestAnimationFrame"], window.cancelAnimationFrame = window[b[c] + "CancelAnimationFrame"] || window[b[c] + "CancelRequestAnimationFrame"]; window.requestAnimationFrame || (window.requestAnimationFrame = function (b) { var c = (new Date).getTime(), f = Math.max(8, 16 - (c - a)), h = window.setTimeout(function () { b(c + f) }, f); a = c + f; return h }); window.cancelAnimationFrame || (window.cancelAnimationFrame = function (a) { window.clearTimeout(a) }) })(); ca.Debug = null; var w = { ld: 1, Sc: 2, bd: 4, ad: 8, Fn: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("534.30") && 0 < window.navigator.userAgent.indexOf("Android"), wI: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("MSIE 9.0"), oF: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("MSIE 10.0"), pF: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("Trident/7"), cL: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("Edge/"), Gk: void 0 !== window.navigator && void 0 !== window.navigator.platform && 0 <= window.navigator.platform.toUpperCase().indexOf("MAC"), qF: void 0 !== window.navigator && void 0 !== window.navigator.platform && null !== window.navigator.platform.match(/(iPhone|iPod|iPad)/i), AE: function (a, b, c) { var d = -1; return function () { var e = this, f = arguments; -1 !== d && w.clearTimeout(d); d = w.setTimeout(function () { d = -1; c || a.apply(e, f) }, b); c && !d && a.apply(e, f) } }, setTimeout: function (a, b) { return window.setTimeout(a, b) }, clearTimeout: function (a) { window.clearTimeout(a) }, createElement: function (a) { return window.document.createElement(a) }, k: function (a) { throw Error(a); }, la: function (a, b) { var c = "The object is frozen, so its properties cannot be set: " + a.toString(); void 0 !== b && (c += " to value: " + b); w.k(c) }, G: function (a, b, c, d) { a instanceof b || (c = w.getTypeName(c), void 0 !== d && (c += "." + d), w.Bd(a, b, c)) }, j: function (a, b, c, d) { typeof a !== b && (c = w.getTypeName(c), void 0 !== d && (c += "." + d), w.Bd(a, b, c)) }, vd: function (a, b, c) { "number" === typeof a && isFinite(a) || (b = w.getTypeName(b), void 0 !== c && (b += "." + c), w.k(b + " must be a real number type, and not NaN or Infinity: " + a)) }, mb: function (a, b, c, d) { a instanceof ea && a.Ee === b || (c = w.getTypeName(c), void 0 !== d && (c += "." + d), w.Bd(a, "a constant of class " + w.kf(b), c)) }, BK: function (a, b) { "string" === typeof a ? fa(a) || w.k('Color "' + a + '" is not a valid color string for ' + b) : a instanceof ha || w.k("Value for " + b + " must be a color string or a Brush, not " + a) }, Bd: function (a, b, c, d) { b = w.getTypeName(b); c = w.getTypeName(c); void 0 !== d && (c += "." + d); "string" === typeof a ? w.k(c + " value is not an instance of " + b + ': "' + a + '"') : w.k(c + " value is not an instance of " + b + ": " + a) }, Fa: function (a, b, c, d) { c = w.getTypeName(c); void 0 !== d && (c += "." + d); w.k(c + " is not in the range " + b + ": " + a) }, jd: function (a) { w.k(w.kf(a) + " constructor cannot take any arguments.") }, Ma: function (a) { w.k("Collection was modified during iteration: " + a.toString() + "\n Perhaps you should iterate over a copy of the collection,\n or you could collect items to be removed from the collection after the iteration.") }, Ej: function (a, b) { w.k("No property to set for this enum value: " + b + " on " + a.toString()) }, trace: function (a) { window.console && window.console.log(a) }, hx: {}, Ht: function (a, b) { !0 !== w.hx[a] && (w.hx[a] = !0, window.console && window.console.log(a + " is deprecated in " + b + ", see the GoJS change log for more information.")) }, Pa: function (a) { return "object" === typeof a && null !== a }, isArray: function (a) { return Array.isArray(a) || a instanceof NodeList || a instanceof HTMLCollection }, yI: function (a) { return Array.isArray(a) }, Wz: function (a, b, c) { w.isArray(a) || w.Bd(a, "Array or NodeList or HTMLCollection", b, c) }, Za: function (a) { return a.length }, Jl: function (a) { return Array.prototype.slice.call(a) }, Ba: function (a, b) { Array.isArray(a); return a[b] }, qE: function (a, b, c) { Array.isArray(a) ? a[b] = c : w.k("Cannot replace an object in an HTMLCollection or NodeList at " + b) }, Gl: function (a, b) { if (Array.isArray(a)) return a.indexOf(b); for (var c = a.length, d = 0; d < c; d++)if (a[d] === b) return d; return -1 }, sh: function (a, b, c) { Array.isArray(a) ? b >= a.length ? a.push(c) : a.splice(b, 0, c) : w.k("Cannot insert an object into an HTMLCollection or NodeList: " + c + " at " + b) }, Kg: function (a, b) { Array.isArray(a) ? b >= a.length ? a.pop() : a.splice(b, 1) : w.k("Cannot remove an object from an HTMLCollection or NodeList at " + b) }, zy: [], K: function () { var a = w.zy.pop(); return void 0 === a ? new z : a }, xb: function (a, b) { var c = w.zy.pop(); if (void 0 === c) return new z(a, b); c.x = a; c.y = b; return c }, v: function (a) { w.zy.push(a) }, MB: [], jm: function () { var a = w.MB.pop(); return void 0 === a ? new ia : a }, Bk: function (a) { w.MB.push(a) }, Ay: [], If: function () { var a = w.Ay.pop(); return void 0 === a ? new B : a }, jg: function (a, b, c, d) { var e = w.Ay.pop(); if (void 0 === e) return new B(a, b, c, d); e.x = a; e.y = b; e.width = c; e.height = d; return e }, Db: function (a) { w.Ay.push(a) }, NB: [], Jf: function () { var a = w.NB.pop(); return void 0 === a ? new ja : a }, we: function (a) { w.NB.push(a) }, By: null, s: function () { var a = w.By; return null !== a ? (w.By = null, a) : new ka }, q: function (a) { a.reset(); w.By = a }, LB: [], cb: function () { var a = w.LB.pop(); return void 0 === a ? [] : a }, ua: function (a) { a.length = 0; w.LB.push(a) }, io: Object.freeze([]), nm: 1, nc: function (a) { a.__gohashid = w.nm++ }, Vp: function (a) { var b = a.__gohashid; void 0 === b && (b = w.nm++ , a.__gohashid = b); return b }, Nd: function (a) { return a.__gohashid }, ga: function (a, b) { b.Ky = a; ca[a] = b }, Ka: function (a, b) { function c() { } c.prototype = b.prototype; a.prototype = new c; a.prototype.constructor = a }, ni: function (a) { a.WG = !0 }, defineProperty: function (a, b, c, d, e) { w.j(a, "function", "Util.defineProperty:classfunc"); w.j(b, "object", "Util.defineProperty:propobj"); w.j(c, "function", "Util.defineProperty:getter"); w.j(d, "function", "Util.defineProperty:setter"); for (var f in b) { b = b[f]; c = { get: c, set: d, enumerable: !0 }; if (void 0 !== e) for (var h in e) c[h] = e[h]; Object.defineProperty(a.prototype, f, c); e = Object.getOwnPropertyDescriptor(a.prototype, f); b && e && Object.defineProperty(a.prototype, b, e); break } }, aK: !1, u: function (a, b, c, d) { w.j(a, "function", "Util.defineReadOnlyProperty:classfunc"); w.j(b, "object", "Util.defineReadOnlyProperty:propobj"); w.j(c, "function", "Util.defineReadOnlyProperty:getter"); for (var e in b) { var f = b[e]; b = { get: c, set: function (a) { w.k('The property "' + f + '" is read-only and cannot be set to ' + a) }, enumerable: !0 }; if (void 0 !== d) for (var h in d) b[h] = d[h]; Object.defineProperty(a.prototype, e, b); d = Object.getOwnPropertyDescriptor(a.prototype, e); f && d && Object.defineProperty(a.prototype, f, d); break } }, ce: function (a, b) { for (var c in b) b[c] = !0; a.prototype.SG = b }, getTypeName: function (a) { return void 0 === a ? "" : "string" === typeof a ? a : "function" === typeof a ? w.kf(a) : null === a ? "*" : "" }, kf: function (a) { if ("function" === typeof a) { if (a.Ky) return a.Ky; if (a.name) return a.name; var b = a.toString(), c = b.indexOf("("), b = b.substring(9, c).trim(); if ("" !== b) return a.Ky = b } else if ("object" === typeof a && a.constructor) return w.kf(a.constructor); return typeof a }, p: function (a, b, c) { w.j(a, "function", "Util.defineEnumValue:classfunc"); w.j(b, "string", "Util.defineEnumValue:name"); w.j(c, "number", "Util.defineEnumValue:num"); c = new ea(a, b, c); Object.freeze(c); a[b] = c; var d = a.Tu; d instanceof la || (d = new la("string", ea), a.Tu = d); d.add(b, c); return c }, tb: function (a, b) { if (!a || !b) return null; var c = void 0; try { "function" === typeof b ? c = b(a) : "function" === typeof a.getAttribute ? (c = a.getAttribute(b), null === c && (c = void 0)) : c = a[b] } catch (d) { } return c }, La: function (a, b, c) { if (a && b) try { "function" === typeof b ? b(a, c) : "function" === typeof a.setAttribute ? a.setAttribute(b, c) : a[b] = c } catch (d) { } }, Iu: function (a, b) { w.j(a, "object", "Setting properties requires Objects as arguments"); w.j(b, "object", "Setting properties requires Objects as arguments"); var c = a instanceof C, d = a instanceof D, e; for (e in b) { "" === e && w.k("Setting properties requires non-empty property names"); var f = a, h = e; if (c || d) { var k = e.indexOf("."); if (0 < k) { var l = e.substring(0, k); if (c) f = a.xd(l); else if (f = a[l], void 0 === f || null === f) f = a.eb[l]; w.Pa(f) ? h = e.substr(k + 1) : w.k("Unable to find object named: " + l + " in " + a.toString() + " when trying to set property: " + e) } } if ("_" !== h[0] && !w.fF(f, h)) if (d && "ModelChanged" === h) { a.hH(b[h]); continue } else if (d && "Changed" === h) { a.gn(b[h]); continue } else if (d && w.fF(a.eb, h)) f = a.eb; else if (d && oa(a, h)) { a.Nw(h, b[h]); continue } else if (a instanceof F && "Changed" === h) { a.gn(b[h]); continue } else w.k('Trying to set undefined property "' + h + '" on object: ' + f.toString()); f[h] = b[e]; "_" === h[0] && f instanceof G && f.eH(h) } }, fF: 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.SG; if (d && d[b]) return !0; c = Object.getPrototypeOf(c) } return !1 }, lJ: function (a) { for (var b = [], c = 0; 256 > c; c++)b[c] = c; for (var d = 0, e = 0, c = 0; 256 > c; c++)d = (d + b[c] + 119) % 256, e = b[c], b[c] = b[d], b[d] = e; for (var d = c = 0, f = "", h = 0; h < a.length; h++)c = (c + 1) % 256, d = (d + b[c]) % 256, e = b[c], b[c] = b[d], b[d] = e, f += String.fromCharCode(a.charCodeAt(h) ^ b[(b[c] + b[d]) % 256]); return f }, kI: 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 }, Lg: function (a) { return w.lJ(w.kI(a)) }, lm: null, adym: "7da71ca0ad381e90", vfo: "2be641fdb261", tH: "@COLOR1", uH: "@COLOR2", BE: !1, Et: null, Ft: null }; w.lm = function () { var a = window.document.createElement("canvas"), b = a.getContext("2d"); //去除正版水印限制 //b[w.Lg("7ca11abfd022028846")] = w.Lg("398c3597c01238"); //for (var c = ["5da73c80a36755d3038e4972187c3cae51fd22", "32ab5ff3b26f42dc0ed90f22432913b54ae6247590da4bb21c324ba3a84e385776", "54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387", "74bf19bce72555874c86"], d = 1; 5 > d; d++)b[w.Lg("7ca11abfd7330390")](w.Lg(c[d - 1]), 10, 15 * d + 0); b[w.Lg("7ca11abfd022028846")] = w.Lg("39f046ebb36e4b"); for (d = 1; 5 > d; d++)b[w.Lg("7ca11abfd7330390")](w.Lg(c[d - // 1]), 10, 15 * d + 0); if (4 !== c.length || "5" !== c[0][0] || "7" !== c[3][0]) w.p = function (a, b) { var c = new ea(a, b, 2); Object.freeze(c); a[b] = c; var d = a.Tu; d instanceof la || (d = new la("string", ea), a.Tu = d); d.add(b, c); return c }; return a }(); function ea(a, b, c) { w.nc(this); this.$B = a; this.Sb = b; this.$G = c } w.ga("EnumValue", ea); ea.prototype.toString = function () { return w.kf(this.$B) + "." + this.Sb }; w.u(ea, { Ee: "classType" }, function () { return this.$B }); w.u(ea, { name: "name" }, function () { return this.Sb }); w.u(ea, { value: "value" }, function () { return this.$G }); var pa; ea.findName = pa = function (a, b) { if (void 0 === b || null === b || "" === b) return null; w.j(a, "function", "findName:classfunc"); w.j(b, "string", "EnumValue.findName:name"); var c = a.Tu; return c instanceof la ? c.ja(b) : null }; function ra() { this.YB = [] } ra.prototype.toString = function () { return this.YB.join("") }; ra.prototype.add = function (a) { "" !== a && this.YB.push(a) }; function sa() { } function ta(a) { void 0 === a && (a = 42); this.seed = a; this.vy = 48271; this.Su = 2147483647; this.KB = this.Su / this.vy; this.HG = this.Su % this.vy; this.GG = 1 / this.Su; this.random() } ta.prototype.random = function () { var a = this.seed % this.KB * this.vy - this.seed / this.KB * this.HG; this.seed = 0 < a ? a : a + this.Su; return this.seed * this.GG }; function ua() { } w.u(ua, { i: "iterator" }, function () { return this }); ua.prototype.reset = ua.prototype.reset = function () { }; ua.prototype.next = ua.prototype.next = function () { return !1 }; ua.prototype.hasNext = function () { return !1 }; ua.prototype.first = ua.prototype.first = function () { return null }; ua.prototype.any = function () { return !1 }; ua.prototype.all = function () { return !0 }; ua.prototype.each = function () { return this }; ua.prototype.map = function () { return this }; ua.prototype.filter = function () { return this }; ua.prototype.concat = function (a) { return a.i }; w.u(ua, { count: "count" }, function () { return 0 }); ua.prototype.Lf = function () { }; ua.prototype.toString = function () { return "EmptyIterator" }; var va = new ua; function wa(a) { this.key = -1; this.value = a } w.ce(wa, { key: !0, value: !0 }); w.u(wa, { i: "iterator" }, function () { return this }); wa.prototype.reset = wa.prototype.reset = function () { this.key = -1 }; wa.prototype.next = wa.prototype.next = function () { return -1 === this.key ? (this.key = 0, !0) : !1 }; wa.prototype.hasNext = function () { return this.next() }; wa.prototype.first = wa.prototype.first = function () { this.key = 0; return this.value }; wa.prototype.any = function (a) { this.key = -1; return a(this.value) }; wa.prototype.all = function (a) { this.key = -1; return a(this.value) }; wa.prototype.each = function (a) { this.key = -1; a(this.value); return this }; wa.prototype.map = function (a) { return new wa(a(this.value)) }; wa.prototype.filter = function (a) { return a(this.value) ? new wa(this.value) : va }; wa.prototype.concat = function (a) { return new xa(this, a.i) }; w.u(wa, { count: "count" }, function () { return 1 }); wa.prototype.Lf = function () { this.value = null }; wa.prototype.toString = function () { return "SingletonIterator(" + this.value + ")" }; function xa(a, b) { this.kl = a; this.ll = b; this.Uu = !1 } w.ce(xa, { key: !0, value: !0 }); w.u(xa, { i: "iterator" }, function () { return this }); xa.prototype.reset = xa.prototype.reset = function () { this.kl.reset(); this.ll.reset(); this.Uu = !1 }; xa.prototype.next = xa.prototype.next = function () { if (!this.Uu) { var a = this.kl; if (a.next()) return this.key = a.key, this.value = a.value, !0; this.Uu = !0 } return this.Uu && (a = this.ll, a.next()) ? (this.key = a.key, this.value = a.value, !0) : !1 }; xa.prototype.hasNext = function () { return this.next() }; xa.prototype.first = xa.prototype.first = function () { this.reset(); return this.next() ? this.value : null }; xa.prototype.any = function (a) { return this.kl.any(a) || this.ll.any(a) ? !0 : !1 }; xa.prototype.all = function (a) { return this.kl.all(a) && this.ll.all(a) ? !0 : !1 }; xa.prototype.each = function (a) { this.kl.each(a); this.ll.each(a); return this }; xa.prototype.map = function (a) { return new xa(this.kl.map(a), this.ll.map(a)) }; xa.prototype.filter = function (a) { return new xa(this.kl.filter(a), this.ll.filter(a)) }; xa.prototype.concat = function (a) { return new xa(this, a.i) }; w.u(xa, { count: "count" }, function () { return this.kl.count + this.ll.count }); xa.prototype.Lf = function () { this.value = this.key = null }; xa.prototype.toString = function () { return "ConcatIterator()" }; function ya(a) { this.xc = a; this.$h = null; a.Qb = null; this.Sa = a.F; this.wc = -1 } w.ce(ya, { key: !0, value: !0 }); w.u(ya, { i: "iterator" }, function () { return this }); w.defineProperty(ya, { iq: "predicate" }, function () { return this.$h }, function (a) { this.$h = a }); ya.prototype.reset = ya.prototype.reset = function () { var a = this.xc; a.Qb = null; this.Sa = a.F; this.wc = -1 }; ya.prototype.next = ya.prototype.next = function () { var a = this.xc; if (a.F !== this.Sa) { if (0 > this.key) return !1; w.Ma(a) } var a = a.n, b = a.length, c = ++this.wc, d = this.$h; if (null !== d) for (; c < b;) { var e = a[c]; if (d(e)) return this.key = this.wc = c, this.value = e, !0; c++ } else { if (c < b) return this.key = c, this.value = a[c], !0; this.Lf() } return !1 }; ya.prototype.hasNext = function () { return this.next() }; ya.prototype.first = ya.prototype.first = function () { var a = this.xc; this.Sa = a.F; this.wc = 0; var a = a.n, b = a.length, c = this.$h; if (null !== c) { for (var d = 0; d < b;) { var e = a[d]; if (c(e)) return this.key = this.wc = d, this.value = e; d++ } return null } return 0 < b ? (e = a[0], this.key = 0, this.value = e) : null }; ya.prototype.any = function (a) { var b = this.xc; b.Qb = null; var c = b.F; this.wc = -1; for (var d = b.n, e = d.length, f = this.$h, h = 0; h < e; h++) { var k = d[h]; if (null === f || f(k)) { if (a(k)) return !0; b.F !== c && w.Ma(b) } } return !1 }; ya.prototype.all = function (a) { var b = this.xc; b.Qb = null; var c = b.F; this.wc = -1; for (var d = b.n, e = d.length, f = this.$h, h = 0; h < e; h++) { var k = d[h]; if (null === f || f(k)) { if (!a(k)) return !1; b.F !== c && w.Ma(b) } } return !0 }; ya.prototype.each = function (a) { var b = this.xc; b.Qb = null; var c = b.F; this.wc = -1; for (var d = b.n, e = d.length, f = this.$h, h = 0; h < e; h++) { var k = d[h]; if (null === f || f(k)) a(k), b.F !== c && w.Ma(b) } return this }; ya.prototype.map = function (a) { var b = this.xc; b.Qb = null; var c = b.F; this.wc = -1; for (var d = [], e = b.n, f = e.length, h = this.$h, k = 0; k < f; k++) { var l = e[k]; if (null === h || h(l)) d.push(a(l)), b.F !== c && w.Ma(b) } a = new H; a.n = d; a.Hc(); return a.i }; ya.prototype.filter = function (a) { var b = this.xc; b.Qb = null; var c = b.F; this.wc = -1; for (var d = [], e = b.n, f = e.length, h = this.$h, k = 0; k < f; k++) { var l = e[k]; if (null === h || h(l)) a(l) && d.push(l), b.F !== c && w.Ma(b) } a = new H(b.ma); a.n = d; a.Hc(); return a.i }; ya.prototype.concat = function (a) { this.xc.Qb = null; return new xa(this, a.i) }; w.u(ya, { count: "count" }, function () { var a = this.$h; if (null !== a) { for (var b = 0, c = this.xc.n, d = c.length, e = 0; e < d; e++)a(c[e]) && b++; return b } return this.xc.n.length }); ya.prototype.Lf = function () { this.key = -1; this.value = null; this.Sa = -1; this.$h = null; this.xc.Qb = this }; ya.prototype.toString = function () { return "ListIterator@" + this.wc + "/" + this.xc.count }; function Aa(a) { this.xc = a; a.Ni = null; this.Sa = a.F; this.wc = a.n.length } w.ce(Aa, { key: !0, value: !0 }); w.u(Aa, { i: "iterator" }, function () { return this }); Aa.prototype.reset = Aa.prototype.reset = function () { var a = this.xc; a.Ni = null; this.Sa = a.F; this.wc = a.n.length }; Aa.prototype.next = Aa.prototype.next = function () { var a = this.xc; if (a.F !== this.Sa) { if (0 > this.key) return !1; w.Ma(a) } var b = --this.wc; if (0 <= b) return this.key = b, this.value = a.n[b], !0; this.Lf(); return !1 }; Aa.prototype.hasNext = function () { return this.next() }; Aa.prototype.first = Aa.prototype.first = function () { var a = this.xc; this.Sa = a.F; var b = a.n; this.wc = a = b.length - 1; return 0 <= a ? (b = b[a], this.key = a, this.value = b) : null }; Aa.prototype.any = function (a) { var b = this.xc; b.Ni = null; var c = b.F, d = b.n, e = d.length; this.wc = e; for (e -= 1; 0 <= e; e--) { if (a(d[e])) return !0; b.F !== c && w.Ma(b) } return !1 }; Aa.prototype.all = function (a) { var b = this.xc; b.Ni = null; var c = b.F, d = b.n, e = d.length; this.wc = e; for (e -= 1; 0 <= e; e--) { if (!a(d[e])) return !1; b.F !== c && w.Ma(b) } return !0 }; Aa.prototype.each = function (a) { var b = this.xc; b.Ni = null; var c = b.F, d = b.n, e = d.length; this.wc = e; for (e -= 1; 0 <= e; e--)a(d[e]), b.F !== c && w.Ma(b); return this }; Aa.prototype.map = function (a) { var b = this.xc; b.Ni = null; var c = b.F, d = [], e = b.n, f = e.length; this.wc = f; for (f -= 1; 0 <= f; f--)d.push(a(e[f])), b.F !== c && w.Ma(b); a = new H; a.n = d; a.Hc(); return a.i }; Aa.prototype.filter = function (a) { var b = this.xc; b.Ni = null; var c = b.F, d = [], e = b.n, f = e.length; this.wc = f; for (f -= 1; 0 <= f; f--) { var h = e[f]; a(h) && d.push(h); b.F !== c && w.Ma(b) } a = new H(b.ma); a.n = d; a.Hc(); return a.i }; Aa.prototype.concat = function (a) { this.xc.Ni = null; return new xa(this, a.i) }; w.u(Aa, { count: "count" }, function () { return this.xc.n.length }); Aa.prototype.Lf = function () { this.key = -1; this.value = null; this.Sa = -1; this.xc.Ni = this }; Aa.prototype.toString = function () { return "ListIteratorBackwards(" + this.wc + "/" + this.xc.count + ")" }; function H(a) { w.nc(this); this.Q = !1; this.n = []; this.F = 0; this.Ni = this.Qb = null; void 0 === a || null === a ? this.ma = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a || "boolean" === a || "function" === a ? this.ma = a : w.Fa(a, "the string 'object', 'number', 'string', 'boolean', or 'function'", "List constructor: type") : "function" === typeof a ? this.ma = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a === Boolean ? "boolean" : a === Function ? "function" : a : w.Fa(a, "null, a primitive type name, or a class type", "List constructor: type") } w.ga("List", H); H.prototype.Hc = function () { var a = this.F; a++; 999999999 < a && (a = 0); this.F = a }; H.prototype.freeze = H.prototype.freeze = function () { this.Q = !0; return this }; H.prototype.thaw = H.prototype.Qa = function () { this.Q = !1; return this }; H.prototype.toString = function () { return "List(" + w.getTypeName(this.ma) + ")#" + w.Nd(this) }; H.prototype.add = H.prototype.add = function (a) { null !== a && (this.Q && w.la(this, a), this.n.push(a), this.Hc()) }; H.prototype.push = H.prototype.push = function (a) { this.add(a) }; H.prototype.addAll = H.prototype.Jc = function (a) { if (null === a) return this; this.Q && w.la(this); var b = this.n; if (w.isArray(a)) for (var c = w.Za(a), d = 0; d < c; d++) { var e = w.Ba(a, d); b.push(e) } else for (a = a.i; a.next();)e = a.value, b.push(e); this.Hc(); return this }; H.prototype.clear = H.prototype.clear = function () { this.Q && w.la(this); this.n.length = 0; this.Hc() }; H.prototype.contains = H.prototype.contains = function (a) { return null === a ? !1 : -1 !== this.n.indexOf(a) }; H.prototype.has = H.prototype.has = function (a) { return this.contains(a) }; H.prototype.indexOf = H.prototype.indexOf = function (a) { return null === a ? -1 : this.n.indexOf(a) }; H.prototype.elt = H.prototype.ea = function (a) { var b = this.n; (0 > a || a >= b.length) && w.Fa(a, "0 <= i < length", H, "elt:i"); return b[a] }; H.prototype.get = H.prototype.get = function (a) { return this.ea(a) }; H.prototype.setElt = H.prototype.ig = function (a, b) { var c = this.n; (0 > a || a >= c.length) && w.Fa(a, "0 <= i < length", H, "setElt:i"); this.Q && w.la(this, a); c[a] = b }; H.prototype.set = H.prototype.set = function (a, b) { this.ig(a, b) }; H.prototype.first = H.prototype.first = function () { var a = this.n; return 0 === a.length ? null : a[0] }; H.prototype.last = H.prototype.fe = function () { var a = this.n, b = a.length; return 0 < b ? a[b - 1] : null }; H.prototype.pop = H.prototype.pop = function () { this.Q && w.la(this); var a = this.n; return 0 < a.length ? a.pop() : null }; H.prototype.any = function (a) { for (var b = this.n, c = this.F, d = b.length, e = 0; e < d; e++) { if (a(b[e])) return !0; this.F !== c && w.Ma(this) } return !1 }; H.prototype.all = function (a) { for (var b = this.n, c = this.F, d = b.length, e = 0; e < d; e++) { if (!a(b[e])) return !1; this.F !== c && w.Ma(this) } return !0 }; H.prototype.each = function (a) { for (var b = this.n, c = this.F, d = b.length, e = 0; e < d; e++)a(b[e]), this.F !== c && w.Ma(this); return this }; H.prototype.map = function (a) { for (var b = new H, c = [], d = this.n, e = this.F, f = d.length, h = 0; h < f; h++)c.push(a(d[h])), this.F !== e && w.Ma(this); b.n = c; b.Hc(); return b }; H.prototype.filter = function (a) { for (var b = new H(this.ma), c = [], d = this.n, e = this.F, f = d.length, h = 0; h < f; h++) { var k = d[h]; a(k) && c.push(k); this.F !== e && w.Ma(this) } b.n = c; b.Hc(); return b }; H.prototype.concat = function (a) { return this.copy().Jc(a) }; H.prototype.insertAt = H.prototype.Pd = function (a, b) { 0 > a && w.Fa(a, ">= 0", H, "insertAt:i"); this.Q && w.la(this, a); var c = this.n; a >= c.length ? c.push(b) : c.splice(a, 0, b); this.Hc(); return !0 }; H.prototype.remove = H.prototype["delete"] = H.prototype.remove = function (a) { if (null === a) return !1; this.Q && w.la(this, a); var b = this.n; a = b.indexOf(a); if (-1 === a) return !1; a === b.length - 1 ? b.pop() : b.splice(a, 1); this.Hc(); return !0 }; H.prototype.removeAt = H.prototype.$c = function (a) { var b = this.n; (0 > a || a >= b.length) && w.Fa(a, "0 <= i < length", H, "removeAt:i"); this.Q && w.la(this, a); a === b.length - 1 ? b.pop() : b.splice(a, 1); this.Hc() }; H.prototype.removeRange = H.prototype.removeRange = function (a, b) { var c = this.n, d = c.length; if (0 > a) a = 0; else if (a >= d) return this; if (0 > b) return this; b >= d && (b = d - 1); if (a > b) return this; this.Q && w.la(this); for (var e = a, f = b + 1; f < d;)c[e++] = c[f++]; c.length = d - (b - a + 1); this.Hc(); return this }; H.prototype.copy = function () { var a = new H(this.ma), b = this.n; 0 < b.length && (a.n = Array.prototype.slice.call(b)); return a }; H.prototype.toArray = H.prototype.gc = function () { for (var a = this.n, b = this.count, c = Array(b), d = 0; d < b; d++)c[d] = a[d]; return c }; H.prototype.toSet = H.prototype.vG = function () { for (var a = new I(this.ma), b = this.n, c = this.count, d = 0; d < c; d++)a.add(b[d]); return a }; H.prototype.sort = H.prototype.sort = function (a) { this.Q && w.la(this); this.n.sort(a); this.Hc(); return this }; H.prototype.sortRange = H.prototype.wq = function (a, b, c) { var d = this.n, e = d.length; void 0 === b && (b = 0); void 0 === c && (c = e); this.Q && w.la(this); var f = c - b; if (1 >= f) return this; (0 > b || b >= e - 1) && w.Fa(b, "0 <= from < length", H, "sortRange:from"); if (2 === f) return c = d[b], e = d[b + 1], 0 < a(c, e) && (d[b] = e, d[b + 1] = c, this.Hc()), this; if (0 === b) if (c >= e) d.sort(a); else for (f = d.slice(0, c), f.sort(a), a = 0; a < c; a++)d[a] = f[a]; else if (c >= e) for (f = d.slice(b), f.sort(a), a = b; a < e; a++)d[a] = f[a - b]; else for (f = d.slice(b, c), f.sort(a), a = b; a < c; a++)d[a] = f[a - b]; this.Hc(); return this }; H.prototype.reverse = H.prototype.reverse = function () { this.Q && w.la(this); this.n.reverse(); this.Hc(); return this }; w.u(H, { count: "count" }, function () { return this.n.length }); w.u(H, { size: "size" }, function () { return this.n.length }); w.u(H, { length: "length" }, function () { return this.n.length }); w.u(H, { i: "iterator" }, function () { if (0 >= this.n.length) return va; var a = this.Qb; return null !== a ? (a.reset(), a) : new ya(this) }); w.u(H, { In: "iteratorBackwards" }, function () { if (0 >= this.n.length) return va; var a = this.Ni; return null !== a ? (a.reset(), a) : new Aa(this) }); function Ba(a) { this.bi = a; a.Qb = null; this.Sa = a.F; this.Va = null } w.ce(Ba, { key: !0, value: !0 }); w.u(Ba, { i: "iterator" }, function () { return this }); Ba.prototype.reset = Ba.prototype.reset = function () { var a = this.bi; a.Qb = null; this.Sa = a.F; this.Va = null }; Ba.prototype.next = Ba.prototype.next = function () { var a = this.bi; if (a.F !== this.Sa) { if (null === this.key) return !1; w.Ma(a) } var b = this.Va, b = null === b ? a.Ea : b.Xa; if (null !== b) return this.Va = b, this.value = b.value, this.key = b.key, !0; this.Lf(); return !1 }; Ba.prototype.hasNext = function () { return this.next() }; Ba.prototype.first = Ba.prototype.first = function () { var a = this.bi; this.Sa = a.F; a = a.Ea; if (null !== a) { this.Va = a; var b = a.value; this.key = a.key; return this.value = b } return null }; Ba.prototype.any = function (a) { var b = this.bi; b.Qb = null; var c = b.F; this.Va = null; for (var d = b.Ea; null !== d;) { if (a(d.value)) return !0; b.F !== c && w.Ma(b); d = d.Xa } return !1 }; Ba.prototype.all = function (a) { var b = this.bi; b.Qb = null; var c = b.F; this.Va = null; for (var d = b.Ea; null !== d;) { if (!a(d.value)) return !1; b.F !== c && w.Ma(b); d = d.Xa } return !0 }; Ba.prototype.each = function (a) { var b = this.bi; b.Qb = null; var c = b.F; this.Va = null; for (var d = b.Ea; null !== d;)a(d.value), b.F !== c && w.Ma(b), d = d.Xa; return this }; Ba.prototype.map = function (a) { var b = this.bi; b.Qb = null; for (var c = new H, d = b.F, e = b.Ea; null !== e;)c.add(a(e.value)), b.F !== d && w.Ma(b), e = e.Xa; return c.i }; Ba.prototype.filter = function (a) { var b = this.bi; b.Qb = null; for (var c = new H(b.ma), d = b.F, e = b.Ea; null !== e;) { var f = e.value; a(f) && c.add(f); b.F !== d && w.Ma(b); e = e.Xa } return c.i }; Ba.prototype.concat = function (a) { this.bi.Qb = null; return new xa(this, a.i) }; w.u(Ba, { count: "count" }, function () { return this.bi.od }); Ba.prototype.Lf = function () { this.value = this.key = null; this.Sa = -1; this.bi.Qb = this }; Ba.prototype.toString = function () { return null !== this.Va ? "SetIterator@" + this.Va.value : "SetIterator" }; function I(a) { w.nc(this); this.Q = !1; void 0 === a || null === a ? this.ma = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.ma = a : w.Fa(a, "the string 'object', 'number' or 'string'", "Set constructor: type") : "function" === typeof a ? this.ma = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : w.Fa(a, "null, a primitive type name, or a class type", "Set constructor: type"); this.pd = {}; this.od = 0; this.Qb = null; this.F = 0; this.Vh = this.Ea = null } w.ga("Set", I); I.prototype.Hc = function () { var a = this.F; a++; 999999999 < a && (a = 0); this.F = a }; I.prototype.freeze = I.prototype.freeze = function () { this.Q = !0; return this }; I.prototype.thaw = I.prototype.Qa = function () { this.Q = !1; return this }; I.prototype.toString = function () { return "Set(" + w.getTypeName(this.ma) + ")#" + w.Nd(this) }; I.prototype.add = I.prototype.add = function (a) { if (null === a) return !1; this.Q && w.la(this, a); var b = a; w.Pa(a) && (b = w.Vp(a)); return void 0 === this.pd[b] ? (this.od++ , a = new Ca(a, a), this.pd[b] = a, b = this.Vh, null === b ? this.Ea = a : (a.hp = b, b.Xa = a), this.Vh = a, this.Hc(), !0) : !1 }; I.prototype.addAll = I.prototype.Jc = function (a) { if (null === a) return this; this.Q && w.la(this); if (w.isArray(a)) for (var b = w.Za(a), c = 0; c < b; c++)this.add(w.Ba(a, c)); else for (a = a.i; a.next();)this.add(a.value); return this }; I.prototype.contains = I.prototype.contains = function (a) { if (null === a) return !1; var b = a; return w.Pa(a) && (b = w.Nd(a), void 0 === b) ? !1 : void 0 !== this.pd[b] }; I.prototype.has = I.prototype.has = function (a) { return this.contains(a) }; I.prototype.containsAll = function (a) { if (null === a) return !0; for (a = a.i; a.next();)if (!this.contains(a.value)) return !1; return !0 }; I.prototype.containsAny = function (a) { if (null === a) return !0; for (a = a.i; a.next();)if (this.contains(a.value)) return !0; return !1 }; I.prototype.first = I.prototype.first = function () { var a = this.Ea; return null === a ? null : a.value }; I.prototype.any = function (a) { for (var b = this.F, c = this.Ea; null !== c;) { if (a(c.value)) return !0; this.F !== b && w.Ma(this); c = c.Xa } return !1 }; I.prototype.all = function (a) { for (var b = this.F, c = this.Ea; null !== c;) { if (!a(c.value)) return !1; this.F !== b && w.Ma(this); c = c.Xa } return !0 }; I.prototype.each = function (a) { for (var b = this.F, c = this.Ea; null !== c;)a(c.value), this.F !== b && w.Ma(this), c = c.Xa; return this }; I.prototype.map = function (a) { for (var b = new I, c = this.F, d = this.Ea; null !== d;)b.add(a(d.value)), this.F !== c && w.Ma(this), d = d.Xa; return b }; I.prototype.filter = function (a) { for (var b = new I(this.ma), c = this.F, d = this.Ea; null !== d;) { var e = d.value; a(e) && b.add(e); this.F !== c && w.Ma(this); d = d.Xa } return b }; I.prototype.concat = function (a) { return this.copy().Jc(a) }; I.prototype.remove = I.prototype["delete"] = I.prototype.remove = function (a) { if (null === a) return !1; this.Q && w.la(this, a); var b = a; if (w.Pa(a) && (b = w.Nd(a), void 0 === b)) return !1; a = this.pd[b]; if (void 0 === a) return !1; var c = a.Xa, d = a.hp; null !== c && (c.hp = d); null !== d && (d.Xa = c); this.Ea === a && (this.Ea = c); this.Vh === a && (this.Vh = d); delete this.pd[b]; this.od--; this.Hc(); return !0 }; I.prototype.removeAll = I.prototype.Zx = function (a) { if (null === a) return this; this.Q && w.la(this); if (w.isArray(a)) for (var b = w.Za(a), c = 0; c < b; c++)this.remove(w.Ba(a, c)); else for (a = a.i; a.next();)this.remove(a.value); return this }; I.prototype.retainAll = function (a) { if (null === a || 0 === this.count) return this; this.Q && w.la(this); var b = new I(this.ma); b.Jc(a); a = []; for (var c = this.i; c.next();) { var d = c.value; b.contains(d) || a.push(d) } this.Zx(a); return this }; I.prototype.clear = I.prototype.clear = function () { this.Q && w.la(this); this.pd = {}; this.od = 0; this.Vh = this.Ea = null; this.Hc() }; I.prototype.copy = function () { var a = new I(this.ma), b = this.pd, c; for (c in b) a.add(b[c].value); return a }; I.prototype.toArray = I.prototype.gc = function () { var a = Array(this.od), b = this.pd, c = 0, d; for (d in b) a[c] = b[d].value, c++; return a }; I.prototype.toList = function () { var a = new H(this.ma), b = this.pd, c; for (c in b) a.add(b[c].value); return a }; w.u(I, { count: "count" }, function () { return this.od }); w.u(I, { size: "size" }, function () { return this.od }); w.u(I, { i: "iterator" }, function () { if (0 >= this.od) return va; var a = this.Qb; return null !== a ? (a.reset(), a) : new Ba(this) }); function Da(a) { this.Ga = a; this.Sa = a.F; this.Va = null } w.ce(Da, { key: !0, value: !0 }); w.u(Da, { i: "iterator" }, function () { return this }); Da.prototype.reset = Da.prototype.reset = function () { this.Sa = this.Ga.F; this.Va = null }; Da.prototype.next = Da.prototype.next = function () { var a = this.Ga; if (a.F !== this.Sa) { if (null === this.key) return !1; w.Ma(a) } var b = this.Va, b = null === b ? a.Ea : b.Xa; if (null !== b) return this.Va = b, this.value = this.key = a = b.key, !0; this.Lf(); return !1 }; Da.prototype.hasNext = function () { return this.next() }; Da.prototype.first = Da.prototype.first = function () { var a = this.Ga; this.Sa = a.F; a = a.Ea; return null !== a ? (this.Va = a, this.value = this.key = a = a.key) : null }; Da.prototype.any = function (a) { var b = this.Ga, c = b.F; this.Va = null; for (var d = b.Ea; null !== d;) { if (a(d.key)) return !0; b.F !== c && w.Ma(b); d = d.Xa } return !1 }; Da.prototype.all = function (a) { var b = this.Ga, c = b.F; this.Va = null; for (var d = b.Ea; null !== d;) { if (!a(d.key)) return !1; b.F !== c && w.Ma(b); d = d.Xa } return !0 }; Da.prototype.each = function (a) { var b = this.Ga, c = b.F; this.Va = null; for (var d = b.Ea; null !== d;)a(d.key), b.F !== c && w.Ma(b), d = d.Xa; return this }; Da.prototype.map = function (a) { var b = this.Ga, c = b.F; this.Va = null; for (var d = new H, e = b.Ea; null !== e;)d.add(a(e.key)), b.F !== c && w.Ma(b), e = e.Xa; return d.i }; Da.prototype.filter = function (a) { var b = this.Ga, c = b.F; this.Va = null; for (var d = new H(b.Uh), e = b.Ea; null !== e;) { var f = e.key; a(f) && d.add(f); b.F !== c && w.Ma(b); e = e.Xa } return d.i }; Da.prototype.concat = function (a) { return new xa(this, a.i) }; w.u(Da, { count: "count" }, function () { return this.Ga.od }); Da.prototype.Lf = function () { this.value = this.key = null; this.Sa = -1 }; Da.prototype.toString = function () { return null !== this.Va ? "MapKeySetIterator@" + this.Va.value : "MapKeySetIterator" }; function Ea(a) { w.nc(this); this.Q = !0; this.Ga = a } w.Ka(Ea, I); Ea.prototype.freeze = function () { return this }; Ea.prototype.Qa = function () { return this }; Ea.prototype.toString = function () { return "MapKeySet(" + this.Ga.toString() + ")" }; Ea.prototype.add = Ea.prototype.add = function () { w.k("This Set is read-only: " + this.toString()); return !1 }; Ea.prototype.set = Ea.prototype.set = function () { w.k("This Set is read-only: " + this.toString()); return !1 }; Ea.prototype.contains = Ea.prototype.contains = function (a) { return this.Ga.contains(a) }; Ea.prototype.has = Ea.prototype.has = function (a) { return this.contains(a) }; Ea.prototype.remove = Ea.prototype["delete"] = Ea.prototype.remove = function () { w.k("This Set is read-only: " + this.toString()); return !1 }; Ea.prototype.clear = Ea.prototype.clear = function () { w.k("This Set is read-only: " + this.toString()) }; Ea.prototype.first = Ea.prototype.first = function () { var a = this.Ga.Ea; return null !== a ? a.key : null }; Ea.prototype.any = function (a) { for (var b = this.Ga.Ea; null !== b;) { if (a(b.key)) return !0; b = b.Xa } return !1 }; Ea.prototype.all = function (a) { for (var b = this.Ga.Ea; null !== b;) { if (!a(b.key)) return !1; b = b.Xa } return !0 }; Ea.prototype.each = function (a) { for (var b = this.Ga.Ea; null !== b;)a(b.key), b = b.Xa; return this }; Ea.prototype.map = function (a) { for (var b = new I, c = this.Ga.Ea; null !== c;)b.add(a(c.key)), c = c.Xa; return b }; Ea.prototype.filter = function (a) { for (var b = new I(this.Ga.Uh), c = this.Ga.Ea; null !== c;) { var d = c.key; a(d) && b.add(d); c = c.Xa } return b }; Ea.prototype.concat = function (a) { return this.vG().Jc(a) }; Ea.prototype.copy = function () { return new Ea(this.Ga) }; Ea.prototype.toSet = Ea.prototype.vG = function () { var a = new I(this.Ga.Uh), b = this.Ga.pd, c; for (c in b) a.add(b[c].key); return a }; Ea.prototype.toArray = Ea.prototype.gc = function () { var a = this.Ga.pd, b = Array(this.Ga.od), c = 0, d; for (d in a) b[c] = a[d].key, c++; return b }; Ea.prototype.toList = function () { var a = new H(this.Ga.Uh), b = this.Ga.pd, c; for (c in b) a.add(b[c].key); return a }; w.u(Ea, { count: "count" }, function () { return this.Ga.od }); w.u(Ea, { size: "size" }, function () { return this.Ga.od }); w.u(Ea, { i: "iterator" }, function () { return 0 >= this.Ga.od ? va : new Da(this.Ga) }); function Fa(a) { this.Ga = a; a.Oi = null; this.Sa = a.F; this.Va = null } w.ce(Fa, { key: !0, value: !0 }); w.u(Fa, { i: "iterator" }, function () { return this }); Fa.prototype.reset = Fa.prototype.reset = function () { var a = this.Ga; a.Oi = null; this.Sa = a.F; this.Va = null }; Fa.prototype.next = Fa.prototype.next = function () { var a = this.Ga; if (a.F !== this.Sa) { if (null === this.key) return !1; w.Ma(a) } var b = this.Va, b = null === b ? a.Ea : b.Xa; if (null !== b) return this.Va = b, this.value = b.value, this.key = b.key, !0; this.Lf(); return !1 }; Fa.prototype.hasNext = function () { return this.next() }; Fa.prototype.first = Fa.prototype.first = function () { var a = this.Ga; this.Sa = a.F; a = a.Ea; if (null !== a) { this.Va = a; var b = a.value; this.key = a.key; return this.value = b } return null }; Fa.prototype.any = function (a) { var b = this.Ga; b.Oi = null; var c = b.F; this.Va = null; for (var d = b.Ea; null !== d;) { if (a(d.value)) return !0; b.F !== c && w.Ma(b); d = d.Xa } return !1 }; Fa.prototype.all = function (a) { var b = this.Ga; b.Oi = null; var c = b.F; this.Va = null; for (var d = b.Ea; null !== d;) { if (!a(d.value)) return !1; b.F !== c && w.Ma(b); d = d.Xa } return !0 }; Fa.prototype.each = function (a) { var b = this.Ga; b.Oi = null; var c = b.F; this.Va = null; for (var d = b.Ea; null !== d;)a(d.value), b.F !== c && w.Ma(b), d = d.Xa; return this }; Fa.prototype.map = function (a) { var b = this.Ga; b.Oi = null; var c = b.F; this.Va = null; for (var d = new H, e = b.Ea; null !== e;)d.add(a(e.value)), b.F !== c && w.Ma(b), e = e.Xa; return d.i }; Fa.prototype.filter = function (a) { var b = this.Ga; b.Oi = null; var c = b.F; this.Va = null; for (var d = new H(b.Uh), e = b.Ea; null !== e;) { var f = e.value; a(f) && d.add(f); b.F !== c && w.Ma(b); e = e.Xa } return d.i }; Fa.prototype.concat = function (a) { this.Ga.Oi = null; return new xa(this, a.i) }; w.u(Fa, { count: "count" }, function () { return this.Ga.od }); Fa.prototype.Lf = function () { this.value = this.key = null; this.Sa = -1; this.Ga.Oi = this }; Fa.prototype.toString = function () { return null !== this.Va ? "MapValueSetIterator@" + this.Va.value : "MapValueSetIterator" }; function Ca(a, b) { this.key = a; this.value = b; this.hp = this.Xa = null } w.ce(Ca, { key: !0, value: !0 }); Ca.prototype.toString = function () { return "{" + this.key + ":" + this.value + "}" }; function Ga(a) { this.Ga = a; a.Qb = null; this.Sa = a.F; this.Va = null } w.ce(Ga, { key: !0, value: !0 }); w.u(Ga, { i: "iterator" }, function () { return this }); Ga.prototype.reset = Ga.prototype.reset = function () { var a = this.Ga; a.Qb = null; this.Sa = a.F; this.Va = null }; Ga.prototype.next = Ga.prototype.next = function () { var a = this.Ga; if (a.F !== this.Sa) { if (null === this.key) return !1; w.Ma(a) } var b = this.Va, b = null === b ? a.Ea : b.Xa; if (null !== b) return this.Va = b, this.key = b.key, this.value = b.value, !0; this.Lf(); return !1 }; Ga.prototype.hasNext = function () { return this.next() }; Ga.prototype.first = Ga.prototype.first = function () { var a = this.Ga; this.Sa = a.F; a = a.Ea; return null !== a ? (this.Va = a, this.key = a.key, this.value = a.value, a) : null }; Ga.prototype.any = function (a) { var b = this.Ga; b.Qb = null; var c = b.F; this.Va = null; for (var d = b.Ea; null !== d;) { if (a(d)) return !0; b.F !== c && w.Ma(b); d = d.Xa } return !1 }; Ga.prototype.all = function (a) { var b = this.Ga; b.Qb = null; var c = b.F; this.Va = null; for (var d = b.Ea; null !== d;) { if (!a(d)) return !1; b.F !== c && w.Ma(b); d = d.Xa } return !0 }; Ga.prototype.each = function (a) { var b = this.Ga; b.Qb = null; var c = b.F; this.Va = null; for (var d = b.Ea; null !== d;)a(d), b.F !== c && w.Ma(b), d = d.Xa; return this }; Ga.prototype.map = function (a) { var b = this.Ga; b.Qb = null; var c = b.F; this.Va = null; for (var d = new H, e = b.Ea; null !== e;)d.add(a(e)), b.F !== c && w.Ma(b), e = e.Xa; return d.i }; Ga.prototype.filter = function (a) { var b = this.Ga; b.Qb = null; var c = b.F; this.Va = null; for (var d = new H, e = b.Ea; null !== e;)a(e) && d.add(e), b.F !== c && w.Ma(b), e = e.Xa; return d.i }; Ga.prototype.concat = function (a) { this.Ga.Qb = null; return new xa(this, a.i) }; w.u(Ga, { count: "count" }, function () { return this.Ga.od }); Ga.prototype.Lf = function () { this.value = this.key = null; this.Sa = -1; this.Ga.Qb = this }; Ga.prototype.toString = function () { return null !== this.Va ? "MapIterator@" + this.Va : "MapIterator" }; function la(a, b) { w.nc(this); this.Q = !1; void 0 === a || null === a ? this.Uh = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.Uh = a : w.Fa(a, "the string 'object', 'number' or 'string'", "Map constructor: keytype") : "function" === typeof a ? this.Uh = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : w.Fa(a, "null, a primitive type name, or a class type", "Map constructor: keytype"); void 0 === b || null === b ? this.rt = null : "string" === typeof b ? "object" === b || "string" === b || "boolean" === b || "number" === b || "function" === b ? this.rt = b : w.Fa(b, "the string 'object', 'number', 'string', 'boolean', or 'function'", "Map constructor: valtype") : "function" === typeof b ? this.rt = b === Object ? "object" : b === String ? "string" : b === Number ? "number" : b === Boolean ? "boolean" : b === Function ? "function" : b : w.Fa(b, "null, a primitive type name, or a class type", "Map constructor: valtype"); this.pd = {}; this.od = 0; this.Oi = this.Qb = null; this.F = 0; this.Vh = this.Ea = null } w.ga("Map", la); la.prototype.Hc = function () { var a = this.F; a++; 999999999 < a && (a = 0); this.F = a }; la.prototype.freeze = la.prototype.freeze = function () { this.Q = !0; return this }; la.prototype.thaw = la.prototype.Qa = function () { this.Q = !1; return this }; la.prototype.toString = function () { return "Map(" + w.getTypeName(this.Uh) + "," + w.getTypeName(this.rt) + ")#" + w.Nd(this) }; la.prototype.add = la.prototype.add = function (a, b) { this.Q && w.la(this, a); var c = a; w.Pa(a) && (c = w.Vp(a)); var d = this.pd[c]; if (void 0 === d) return this.od++ , d = new Ca(a, b), this.pd[c] = d, c = this.Vh, null === c ? this.Ea = d : (d.hp = c, c.Xa = d), this.Vh = d, this.Hc(), !0; d.value = b; return !1 }; la.prototype.set = la.prototype.set = function (a, b) { return this.add(a, b) }; la.prototype.addAll = la.prototype.Jc = function (a) { if (null === a) return this; if (w.isArray(a)) for (var b = w.Za(a), c = 0; c < b; c++) { var d = w.Ba(a, c); this.add(d.key, d.value) } else for (a = a.i; a.next();)this.add(a.key, a.value); return this }; la.prototype.first = la.prototype.first = function () { return this.Ea }; la.prototype.any = function (a) { for (var b = this.F, c = this.Ea; null !== c;) { if (a(c)) return !0; this.F !== b && w.Ma(this); c = c.Xa } return !1 }; la.prototype.all = function (a) { for (var b = this.F, c = this.Ea; null !== c;) { if (!a(c)) return !1; this.F !== b && w.Ma(this); c = c.Xa } return !0 }; la.prototype.each = function (a) { for (var b = this.F, c = this.Ea; null !== c;)a(c), this.F !== b && w.Ma(this), c = c.Xa; return this }; la.prototype.map = function (a) { for (var b = new la(this.Uh), c = this.F, d = this.Ea; null !== d;)b.add(d.key, a(d)), this.F !== c && w.Ma(this), d = d.Xa; return b }; la.prototype.filter = function (a) { for (var b = new la(this.Uh, this.rt), c = this.F, d = this.Ea; null !== d;)a(d) && b.add(d.key, d.value), this.F !== c && w.Ma(this), d = d.Xa; return b }; la.prototype.concat = function (a) { return this.copy().Jc(a) }; la.prototype.contains = la.prototype.contains = function (a) { var b = a; return w.Pa(a) && (b = w.Nd(a), void 0 === b) ? !1 : void 0 !== this.pd[b] }; la.prototype.has = la.prototype.has = function (a) { return this.contains(a) }; la.prototype.getValue = la.prototype.ja = function (a) { var b = a; if (w.Pa(a) && (b = w.Nd(a), void 0 === b)) return null; a = this.pd[b]; return void 0 === a ? null : a.value }; la.prototype.get = la.prototype.get = function (a) { return this.ja(a) }; la.prototype.remove = la.prototype["delete"] = la.prototype.remove = function (a) { if (null === a) return !1; this.Q && w.la(this, a); var b = a; if (w.Pa(a) && (b = w.Nd(a), void 0 === b)) return !1; a = this.pd[b]; if (void 0 === a) return !1; var c = a.Xa, d = a.hp; null !== c && (c.hp = d); null !== d && (d.Xa = c); this.Ea === a && (this.Ea = c); this.Vh === a && (this.Vh = d); delete this.pd[b]; this.od--; this.Hc(); return !0 }; la.prototype.clear = la.prototype.clear = function () { this.Q && w.la(this); this.pd = {}; this.od = 0; this.Vh = this.Ea = null; this.Hc() }; la.prototype.copy = function () { var a = new la(this.Uh, this.rt), b = this.pd, c; for (c in b) { var d = b[c]; a.add(d.key, d.value) } return a }; la.prototype.toArray = la.prototype.gc = function () { var a = this.pd, b = Array(this.od), c = 0, d; for (d in a) { var e = a[d]; b[c] = new Ca(e.key, e.value); c++ } return b }; la.prototype.toKeySet = la.prototype.Fj = function () { return new Ea(this) }; w.u(la, { count: "count" }, function () { return this.od }); w.u(la, { size: "size" }, function () { return this.od }); w.u(la, { i: "iterator" }, function () { if (0 >= this.count) return va; var a = this.Qb; return null !== a ? (a.reset(), a) : new Ga(this) }); w.u(la, { xF: "iteratorKeys" }, function () { return 0 >= this.count ? va : new Da(this) }); w.u(la, { yF: "iteratorValues" }, function () { if (0 >= this.count) return va; var a = this.Oi; return null !== a ? (a.reset(), a) : new Fa(this) }); function z(a, b) { void 0 === a ? this.y = this.x = 0 : (this.x = a, this.y = b) } w.ga("Point", z); w.ni(z); w.ce(z, { x: !0, y: !0 }); z.prototype.assign = function (a) { this.x = a.x; this.y = a.y }; z.prototype.setTo = z.prototype.m = function (a, b) { this.x = a; this.y = b; return this }; z.prototype.set = z.prototype.set = function (a) { this.x = a.x; this.y = a.y; return this }; z.prototype.copy = function () { var a = new z; a.x = this.x; a.y = this.y; return a }; z.prototype.Ha = function () { Object.freeze(this); return this }; z.prototype.S = function () { return Object.isFrozen(this) ? this : this.copy().freeze() }; z.prototype.freeze = function () { return this }; z.prototype.Qa = function () { Object.isFrozen(this) && w.k("cannot thaw constant: " + this); return this }; z.parse = function (a) { if ("string" === typeof a) { a = a.split(" "); for (var b = 0, c = 0; "" === a[b];)b++; var d = a[b++]; d && (c = parseFloat(d)); for (var e = 0; "" === a[b];)b++; (d = a[b++]) && (e = parseFloat(d)); return new z(c, e) } return new z }; z.stringify = function (a) { return a.x.toString() + " " + a.y.toString() }; z.prototype.toString = function () { return "Point(" + this.x + "," + this.y + ")" }; z.prototype.equals = z.prototype.L = function (a) { return a instanceof z ? this.x === a.x && this.y === a.y : !1 }; z.prototype.equalTo = z.prototype.kx = function (a, b) { return this.x === a && this.y === b }; z.prototype.equalsApprox = z.prototype.Kc = function (a) { return J(this.x, a.x) && J(this.y, a.y) }; z.prototype.add = z.prototype.add = function (a) { this.x += a.x; this.y += a.y; return this }; z.prototype.subtract = z.prototype.$n = function (a) { this.x -= a.x; this.y -= a.y; return this }; z.prototype.offset = z.prototype.offset = function (a, b) { this.x += a; this.y += b; return this }; z.prototype.rotate = z.prototype.rotate = function (a) { if (0 === a) return this; var b = this.x, c = this.y; if (0 === b && 0 === c) return this; var d = 0, e = 0; 360 <= a ? a -= 360 : 0 > a && (a += 360); 90 === a ? (d = 0, e = 1) : 180 === a ? (d = -1, e = 0) : 270 === a ? (d = 0, e = -1) : (a = a * Math.PI / 180, d = Math.cos(a), e = Math.sin(a)); this.x = d * b - e * c; this.y = e * b + d * c; return this }; z.prototype.scale = z.prototype.scale = function (a, b) { this.x *= a; this.y *= b; return this }; z.prototype.distanceSquaredPoint = z.prototype.wf = function (a) { var b = a.x - this.x; a = a.y - this.y; return b * b + a * a }; z.prototype.distanceSquared = z.prototype.Pp = function (a, b) { var c = a - this.x, d = b - this.y; return c * c + d * d }; z.prototype.normalize = z.prototype.normalize = function () { var a = this.x, b = this.y, c = Math.sqrt(a * a + b * b); 0 < c && (this.x = a / c, this.y = b / c); return this }; z.prototype.directionPoint = z.prototype.Ob = function (a) { return Ha(a.x - this.x, a.y - this.y) }; z.prototype.direction = z.prototype.direction = function (a, b) { return Ha(a - this.x, b - this.y) }; function Ha(a, b) { if (0 === a) return 0 < b ? 90 : 0 > b ? 270 : 0; if (0 === b) return 0 < a ? 0 : 180; if (isNaN(a) || isNaN(b)) return 0; var c = 180 * Math.atan(Math.abs(b / a)) / Math.PI; 0 > a ? c = 0 > b ? c + 180 : 180 - c : 0 > b && (c = 360 - c); return c } z.prototype.projectOntoLineSegment = function (a, b, c, d) { Ia(a, b, c, d, this.x, this.y, this); return this }; z.prototype.projectOntoLineSegmentPoint = function (a, b) { Ia(a.x, a.y, b.x, b.y, this.x, this.y, this); return this }; z.prototype.snapToGrid = function (a, b, c, d) { Ka(this.x, this.y, a, b, c, d, this); return this }; z.prototype.snapToGridPoint = function (a, b) { Ka(this.x, this.y, a.x, a.y, b.width, b.height, this); return this }; z.prototype.setRectSpot = z.prototype.Xn = function (a, b) { this.x = a.x + b.x * a.width + b.offsetX; this.y = a.y + b.y * a.height + b.offsetY; return this }; z.prototype.setSpot = z.prototype.Ku = function (a, b, c, d, e) { this.x = a + e.x * c + e.offsetX; this.y = b + e.y * d + e.offsetY; return this }; z.prototype.transform = function (a) { a.nb(this); return this }; function La(a, b) { b.pi(a); return a } var Ma; z.distanceLineSegmentSquared = Ma = 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 Na; z.distanceSquared = Na = function (a, b, c, d) { a = c - a; b = d - b; return a * a + b * b }; var Oa; z.direction = Oa = function (a, b, c, d) { a = c - a; b = d - b; if (0 === a) return 0 < b ? 90 : 0 > b ? 270 : 0; if (0 === b) return 0 < a ? 0 : 180; if (isNaN(a) || isNaN(b)) return 0; d = 180 * Math.atan(Math.abs(b / a)) / Math.PI; 0 > a ? d = 0 > b ? d + 180 : 180 - d : 0 > b && (d = 360 - d); return d }; z.prototype.isReal = z.prototype.I = function () { return isFinite(this.x) && isFinite(this.y) }; function ia(a, b) { void 0 === a ? this.height = this.width = 0 : (this.width = a, this.height = b) } w.ga("Size", ia); w.ni(ia); w.ce(ia, { width: !0, height: !0 }); ia.prototype.assign = function (a) { this.width = a.width; this.height = a.height }; ia.prototype.setTo = ia.prototype.m = function (a, b) { this.width = a; this.height = b; return this }; ia.prototype.set = ia.prototype.set = function (a) { this.width = a.width; this.height = a.height; return this }; ia.prototype.copy = function () { var a = new ia; a.width = this.width; a.height = this.height; return a }; ia.prototype.Ha = function () { Object.freeze(this); return this }; ia.prototype.S = function () { return Object.isFrozen(this) ? this : this.copy().freeze() }; ia.prototype.freeze = function () { return this }; ia.prototype.Qa = function () { Object.isFrozen(this) && w.k("cannot thaw constant: " + this); return this }; ia.parse = function (a) { if ("string" === typeof a) { a = a.split(" "); for (var b = 0, c = 0; "" === a[b];)b++; var d = a[b++]; d && (c = parseFloat(d)); for (var e = 0; "" === a[b];)b++; (d = a[b++]) && (e = parseFloat(d)); return new ia(c, e) } return new ia }; ia.stringify = function (a) { return a.width.toString() + " " + a.height.toString() }; ia.prototype.toString = function () { return "Size(" + this.width + "," + this.height + ")" }; ia.prototype.equals = ia.prototype.L = function (a) { return a instanceof ia ? this.width === a.width && this.height === a.height : !1 }; ia.prototype.equalTo = ia.prototype.kx = function (a, b) { return this.width === a && this.height === b }; ia.prototype.equalsApprox = ia.prototype.Kc = function (a) { return J(this.width, a.width) && J(this.height, a.height) }; ia.prototype.isReal = ia.prototype.I = function () { return isFinite(this.width) && isFinite(this.height) }; function B(a, b, c, d) { void 0 === a ? this.height = this.width = this.y = this.x = 0 : a instanceof z ? b instanceof z ? (this.x = Math.min(a.x, b.x), this.y = Math.min(a.y, b.y), this.width = Math.abs(a.x - b.x), this.height = Math.abs(a.y - b.y)) : b instanceof ia ? (this.x = a.x, this.y = a.y, this.width = b.width, this.height = b.height) : w.k("Incorrect arguments supplied to Rect constructor") : (this.x = a, this.y = b, this.width = c, this.height = d) } w.ga("Rect", B); w.ni(B); w.ce(B, { x: !0, y: !0, width: !0, height: !0 }); B.prototype.assign = function (a) { this.x = a.x; this.y = a.y; this.width = a.width; this.height = a.height }; function Pa(a, b, c) { a.width = b; a.height = c } B.prototype.setTo = B.prototype.m = function (a, b, c, d) { this.x = a; this.y = b; this.width = c; this.height = d; return this }; B.prototype.set = B.prototype.set = function (a) { this.x = a.x; this.y = a.y; this.width = a.width; this.height = a.height; return this }; B.prototype.setPoint = B.prototype.Xg = function (a) { this.x = a.x; this.y = a.y; return this }; B.prototype.setSize = function (a) { this.width = a.width; this.height = a.height; return this }; B.prototype.copy = function () { var a = new B; a.x = this.x; a.y = this.y; a.width = this.width; a.height = this.height; return a }; B.prototype.Ha = function () { Object.freeze(this); return this }; B.prototype.S = function () { return Object.isFrozen(this) ? this : this.copy().freeze() }; B.prototype.freeze = function () { return this }; B.prototype.Qa = function () { Object.isFrozen(this) && w.k("cannot thaw constant: " + this); return this }; B.parse = function (a) { if ("string" === typeof a) { a = a.split(" "); for (var b = 0, c = 0; "" === a[b];)b++; var d = a[b++]; d && (c = parseFloat(d)); for (var e = 0; "" === a[b];)b++; (d = a[b++]) && (e = parseFloat(d)); for (var f = 0; "" === a[b];)b++; (d = a[b++]) && (f = parseFloat(d)); for (var h = 0; "" === a[b];)b++; (d = a[b++]) && (h = parseFloat(d)); return new B(c, e, f, h) } return new B }; B.stringify = function (a) { return a.x.toString() + " " + a.y.toString() + " " + a.width.toString() + " " + a.height.toString() }; B.prototype.toString = function () { return "Rect(" + this.x + "," + this.y + "," + this.width + "," + this.height + ")" }; B.prototype.equals = B.prototype.L = function (a) { return a instanceof B ? this.x === a.x && this.y === a.y && this.width === a.width && this.height === a.height : !1 }; B.prototype.equalTo = B.prototype.kx = function (a, b, c, d) { return this.x === a && this.y === b && this.width === c && this.height === d }; B.prototype.equalsApprox = B.prototype.Kc = function (a) { return J(this.x, a.x) && J(this.y, a.y) && J(this.width, a.width) && J(this.height, a.height) }; function Qa(a, b) { return Va(a.x, b.x) && Va(a.y, b.y) && Va(a.width, b.width) && Va(a.height, b.height) } B.prototype.containsPoint = B.prototype.Ia = function (a) { return this.x <= a.x && this.x + this.width >= a.x && this.y <= a.y && this.y + this.height >= a.y }; B.prototype.containsRect = B.prototype.wk = function (a) { return this.x <= a.x && a.x + a.width <= this.x + this.width && this.y <= a.y && a.y + a.height <= this.y + this.height }; B.prototype.contains = B.prototype.contains = function (a, b, c, d) { void 0 === c && (c = 0); void 0 === d && (d = 0); return this.x <= a && a + c <= this.x + this.width && this.y <= b && b + d <= this.y + this.height }; B.prototype.reset = function () { this.height = this.width = this.y = this.x = 0 }; B.prototype.offset = B.prototype.offset = function (a, b) { this.x += a; this.y += b; return this }; B.prototype.inflate = B.prototype.zf = function (a, b) { return Xa(this, b, a, b, a) }; B.prototype.addMargin = B.prototype.Ow = function (a) { return Xa(this, a.top, a.right, a.bottom, a.left) }; B.prototype.subtractMargin = B.prototype.MJ = function (a) { return Xa(this, -a.top, -a.right, -a.bottom, -a.left) }; B.prototype.grow = function (a, b, c, d) { return Xa(this, a, b, c, d) }; function Xa(a, b, c, d, e) { var f = a.width; c + e <= -f ? (a.x += f / 2, a.width = 0) : (a.x -= e, a.width += c + e); c = a.height; b + d <= -c ? (a.y += c / 2, a.height = 0) : (a.y -= b, a.height += b + d); return a } B.prototype.intersectRect = function (a) { return Ya(this, a.x, a.y, a.width, a.height) }; B.prototype.intersect = B.prototype.hF = function (a, b, c, d) { return Ya(this, a, b, c, d) }; function Ya(a, b, c, d, e) { var f = Math.max(a.x, b), h = Math.max(a.y, c); b = Math.min(a.x + a.width, b + d); c = Math.min(a.y + a.height, c + e); a.x = f; a.y = h; a.width = Math.max(0, b - f); a.height = Math.max(0, c - h); return a } B.prototype.intersectsRect = B.prototype.Wf = function (a) { return this.iF(a.x, a.y, a.width, a.height) }; B.prototype.intersects = B.prototype.iF = 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 Za(a, b) { var c = a.width, d = b.width + 10 + 10, e = a.x, f = b.x - 10; if (e > d + f || f > c + e) return !1; c = a.height; d = b.height + 10 + 10; e = a.y; f = b.y - 10; return e > d + f || f > c + e ? !1 : !0 } B.prototype.unionPoint = B.prototype.ui = function (a) { return $a(this, a.x, a.y, 0, 0) }; B.prototype.unionRect = B.prototype.Kh = function (a) { return $a(this, a.x, a.y, a.width, a.height) }; B.prototype.union = B.prototype.AG = function (a, b, c, d) { void 0 === c && (c = 0); void 0 === d && (d = 0); return $a(this, a, b, c, d) }; function $a(a, b, c, d, e) { var f = Math.min(a.x, b), h = Math.min(a.y, c); b = Math.max(a.x + a.width, b + d); c = Math.max(a.y + a.height, c + e); a.x = f; a.y = h; a.width = b - f; a.height = c - h; return a } B.prototype.setSpot = B.prototype.Ku = function (a, b, c) { this.x = a - c.offsetX - c.x * this.width; this.y = b - c.offsetY - c.y * this.height; return this }; var cb; B.contains = cb = function (a, b, c, d, e, f, h, k) { void 0 === h && (h = 0); void 0 === k && (k = 0); return a <= e && e + h <= a + c && b <= f && f + k <= b + d }; B.intersects = function (a, b, c, d, e, f, h, k) { c += a; h += e; if (a > h || e > c) return !1; a = d + b; k += f; return b > k || f > a ? !1 : !0 }; w.defineProperty(B, { left: "left" }, function () { return this.x }, function (a) { this.x = a }); w.defineProperty(B, { top: "top" }, function () { return this.y }, function (a) { this.y = a }); w.defineProperty(B, { right: "right" }, function () { return this.x + this.width }, function (a) { this.x += a - (this.x + this.width) }); w.defineProperty(B, { bottom: "bottom" }, function () { return this.y + this.height }, function (a) { this.y += a - (this.y + this.height) }); w.defineProperty(B, { position: "position" }, function () { return new z(this.x, this.y) }, function (a) { this.x = a.x; this.y = a.y }); w.defineProperty(B, { size: "size" }, function () { return new ia(this.width, this.height) }, function (a) { this.width = a.width; this.height = a.height }); w.defineProperty(B, { Il: "center" }, function () { return new z(this.x + this.width / 2, this.y + this.height / 2) }, function (a) { this.x = a.x - this.width / 2; this.y = a.y - this.height / 2 }); w.defineProperty(B, { ka: "centerX" }, function () { return this.x + this.width / 2 }, function (a) { this.x = a - this.width / 2 }); w.defineProperty(B, { ra: "centerY" }, function () { return this.y + this.height / 2 }, function (a) { this.y = a - this.height / 2 }); B.prototype.isReal = B.prototype.I = function () { return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height) }; B.prototype.isEmpty = function () { return 0 === this.width && 0 === this.height }; function db(a, b, c, d) { void 0 === a ? this.left = this.bottom = this.right = this.top = 0 : void 0 === b ? this.left = this.bottom = this.right = this.top = a : void 0 === c ? (d = b, this.top = a, this.right = b, this.bottom = a, this.left = d) : void 0 !== d ? (this.top = a, this.right = b, this.bottom = c, this.left = d) : w.k("Invalid arguments to Margin constructor") } w.ga("Margin", db); w.ni(db); w.ce(db, { top: !0, right: !0, bottom: !0, left: !0 }); db.prototype.assign = function (a) { this.top = a.top; this.right = a.right; this.bottom = a.bottom; this.left = a.left }; db.prototype.setTo = db.prototype.m = function (a, b, c, d) { this.top = a; this.right = b; this.bottom = c; this.left = d; return this }; db.prototype.set = db.prototype.set = function (a) { this.top = a.top; this.right = a.right; this.bottom = a.bottom; this.left = a.left; return this }; db.prototype.copy = function () { var a = new db; a.top = this.top; a.right = this.right; a.bottom = this.bottom; a.left = this.left; return a }; db.prototype.Ha = function () { Object.freeze(this); return this }; db.prototype.S = function () { return Object.isFrozen(this) ? this : this.copy().freeze() }; db.prototype.freeze = function () { return this }; db.prototype.Qa = function () { Object.isFrozen(this) && w.k("cannot thaw constant: " + this); return this }; db.parse = function (a) { if ("string" === typeof a) { a = a.split(" "); for (var b = 0, c = NaN; "" === a[b];)b++; var d = a[b++]; d && (c = parseFloat(d)); if (isNaN(c)) return new db; for (var e = NaN; "" === a[b];)b++; (d = a[b++]) && (e = parseFloat(d)); if (isNaN(e)) return new db(c); for (var f = NaN; "" === a[b];)b++; (d = a[b++]) && (f = parseFloat(d)); if (isNaN(f)) return new db(c, e); for (var h = NaN; "" === a[b];)b++; (d = a[b++]) && (h = parseFloat(d)); return isNaN(h) ? new db(c, e) : new db(c, e, f, h) } return new db }; db.stringify = function (a) { return a.top.toString() + " " + a.right.toString() + " " + a.bottom.toString() + " " + a.left.toString() }; db.prototype.toString = function () { return "Margin(" + this.top + "," + this.right + "," + this.bottom + "," + this.left + ")" }; db.prototype.equals = db.prototype.L = function (a) { return a instanceof db ? this.top === a.top && this.right === a.right && this.bottom === a.bottom && this.left === a.left : !1 }; db.prototype.equalTo = db.prototype.kx = function (a, b, c, d) { return this.top === a && this.right === b && this.bottom === c && this.left === d }; db.prototype.equalsApprox = db.prototype.Kc = function (a) { return J(this.top, a.top) && J(this.right, a.right) && J(this.bottom, a.bottom) && J(this.left, a.left) }; db.prototype.isReal = db.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 } w.ni(ja); w.ce(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.gu = 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.GF = 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.vx = function () { var a = 1 / (this.m11 * this.m22 - this.m12 * this.m21), b = -this.m12 * a, c = -this.m21 * a, d = this.m11 * a, e = a * (this.m21 * this.dy - this.m22 * this.dx), f = a * (this.m12 * this.dx - this.m11 * this.dy); this.m11 = this.m22 * a; this.m12 = b; this.m21 = c; this.m22 = d; this.dx = e; this.dy = f; return this }; 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.nb = function (a) { var b = a.x, c = a.y; a.x = b * this.m11 + c * this.m21 + this.dx; a.y = b * this.m12 + c * this.m22 + this.dy; return a }; ja.prototype.invertedTransformPoint = ja.prototype.pi = function (a) { var b = 1 / (this.m11 * this.m22 - this.m12 * this.m21), c = -this.m12 * b, d = this.m11 * b, e = b * (this.m12 * this.dx - this.m11 * this.dy), f = a.x, h = a.y; a.x = f * this.m22 * b + h * -this.m21 * b + b * (this.m21 * this.dy - this.m22 * this.dx); a.y = f * c + h * d + e; return a }; ja.prototype.transformRect = ja.prototype.zG = function (a) { var b = a.x, c = a.y, d = b + a.width, e = c + a.height, f = this.m11, h = this.m12, k = this.m21, l = this.m22, m = this.dx, n = this.dy, p = b * f + c * k + m, q = b * h + c * l + n, r = d * f + c * k + m, c = d * h + c * l + n, s = b * f + e * k + m, b = b * h + e * l + n, f = d * f + e * k + m, d = d * h + e * l + n, e = p, h = q, p = Math.min(p, r), e = Math.max(e, r), h = Math.min(h, c), q = Math.max(q, c), p = Math.min(p, s), e = Math.max(e, s), h = Math.min(h, b), q = Math.max(q, b), p = Math.min(p, f), e = Math.max(e, f), h = Math.min(h, d), q = Math.max(q, d); a.x = p; a.y = h; a.width = e - p; a.height = q - h; return a }; function L(a, b, c, d) { void 0 === a ? this.offsetY = this.offsetX = this.y = this.x = 0 : (void 0 === b && (b = 0), void 0 === c && (c = 0), void 0 === d && (d = 0), this.x = a, this.y = b, this.offsetX = c, this.offsetY = d) } w.ga("Spot", L); w.ni(L); w.ce(L, { x: !0, y: !0, offsetX: !0, offsetY: !0 }); L.prototype.assign = function (a) { this.x = a.x; this.y = a.y; this.offsetX = a.offsetX; this.offsetY = a.offsetY }; L.prototype.setTo = L.prototype.m = function (a, b, c, d) { this.x = a; this.y = b; this.offsetX = c; this.offsetY = d; return this }; L.prototype.set = L.prototype.set = function (a) { this.x = a.x; this.y = a.y; this.offsetX = a.offsetX; this.offsetY = a.offsetY; return this }; L.prototype.copy = function () { var a = new L; a.x = this.x; a.y = this.y; a.offsetX = this.offsetX; a.offsetY = this.offsetY; return a }; L.prototype.Ha = function () { Object.freeze(this); return this }; L.prototype.S = function () { return Object.isFrozen(this) ? this : this.copy().freeze() }; L.prototype.freeze = function () { return this }; L.prototype.Qa = function () { Object.isFrozen(this) && w.k("cannot thaw constant: " + this); return this }; function eb(a, b) { a.x = NaN; a.y = NaN; a.offsetX = b; return a } var sb; L.parse = sb = function (a) { if ("string" === typeof a) { a = a.trim(); if ("None" === a) return tb; if ("TopLeft" === a) return xb; if ("Top" === a || "TopCenter" === a || "MiddleTop" === a) return yb; if ("TopRight" === a) return Db; if ("Left" === a || "LeftCenter" === a || "MiddleLeft" === a) return Gb; if ("Center" === a) return Hb; if ("Right" === a || "RightCenter" === a || "MiddleRight" === a) return Kb; if ("BottomLeft" === a) return Lb; if ("Bottom" === a || "BottomCenter" === a || "MiddleBottom" === a) return Mb; if ("BottomRight" === a) return Nb; 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 dc; if ("TopRightSides" === a) return ec; if ("BottomLeftSides" === a) return fc; if ("BottomRightSides" === a) return gc; if ("NotTopSide" === a) return hc; if ("NotLeftSide" === a) return ic; if ("NotRightSide" === a) return oc; if ("NotBottomSide" === a) return pc; if ("AllSides" === a) return qc; if ("Default" === a) return rc; 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.Xc() ? a.x.toString() + " " + a.y.toString() + " " + a.offsetX.toString() + " " + a.offsetY.toString() : a.toString() }; L.prototype.toString = function () { return this.Xc() ? 0 === this.offsetX && 0 === this.offsetY ? "Spot(" + this.x + "," + this.y + ")" : "Spot(" + this.x + "," + this.y + "," + this.offsetX + "," + this.offsetY + ")" : this.L(tb) ? "None" : this.L(xb) ? "TopLeft" : this.L(yb) ? "Top" : this.L(Db) ? "TopRight" : this.L(Gb) ? "Left" : this.L(Hb) ? "Center" : this.L(Kb) ? "Right" : this.L(Lb) ? "BottomLeft" : this.L(Mb) ? "Bottom" : this.L(Nb) ? "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(dc) ? "TopLeftSides" : this.L(ec) ? "TopRightSides" : this.L(fc) ? "BottomLeftSides" : this.L(gc) ? "BottomRightSides" : this.L(hc) ? "NotTopSide" : this.L(ic) ? "NotLeftSide" : this.L(oc) ? "NotRightSide" : this.L(pc) ? "NotBottomSide" : this.L(qc) ? "AllSides" : this.L(rc) ? "Default" : "None" }; L.prototype.equals = L.prototype.L = function (a) { return a instanceof L ? (this.x === a.x || isNaN(this.x) && isNaN(a.x)) && (this.y === a.y || isNaN(this.y) && isNaN(a.y)) && this.offsetX === a.offsetX && this.offsetY === a.offsetY : !1 }; L.prototype.opposite = L.prototype.KF = function () { return new L(.5 - (this.x - .5), .5 - (this.y - .5), -this.offsetX, -this.offsetY) }; L.prototype.includesSide = L.prototype.sj = function (a) { if (!this.uj()) return !1; if (!a.uj()) if (a.L(sc)) a = Xb; else if (a.L(tc)) a = Yb; else if (a.L(xc)) a = Wb; else if (a.L(yc)) a = Zb; else return !1; a = a.offsetY; return (this.offsetY & a) === a }; L.prototype.isSpot = L.prototype.Xc = function () { return !isNaN(this.x) && !isNaN(this.y) }; L.prototype.isNoSpot = L.prototype.Rd = function () { return isNaN(this.x) || isNaN(this.y) }; L.prototype.isSide = L.prototype.uj = function () { return isNaN(this.x) && isNaN(this.y) && 1 === this.offsetX && 0 !== this.offsetY }; L.prototype.isNone = L.prototype.AI = function () { return isNaN(this.x) && isNaN(this.y) && 0 === this.offsetX && 0 === this.offsetY }; L.prototype.isDefault = L.prototype.Wc = function () { return isNaN(this.x) && isNaN(this.y) && -1 === this.offsetX && 0 === this.offsetY }; var tb; L.None = tb = eb(new L(0, 0, 0, 0), 0).Ha(); var rc; L.Default = rc = eb(new L(0, 0, -1, 0), -1).Ha(); var xb; L.TopLeft = xb = (new L(0, 0, 0, 0)).Ha(); var yb; L.TopCenter = yb = (new L(.5, 0, 0, 0)).Ha(); var Db; L.TopRight = Db = (new L(1, 0, 0, 0)).Ha(); var Gb; L.LeftCenter = Gb = (new L(0, .5, 0, 0)).Ha(); var Hb; L.Center = Hb = (new L(.5, .5, 0, 0)).Ha(); var Kb; L.RightCenter = Kb = (new L(1, .5, 0, 0)).Ha(); var Lb; L.BottomLeft = Lb = (new L(0, 1, 0, 0)).Ha(); var Mb; L.BottomCenter = Mb = (new L(.5, 1, 0, 0)).Ha(); var Nb; L.BottomRight = Nb = (new L(1, 1, 0, 0)).Ha(); var Hc; L.MiddleTop = Hc = yb; var Ic; L.MiddleLeft = Ic = Gb; var Jc; L.MiddleRight = Jc = Kb; var Kc; L.MiddleBottom = Kc = Mb; var xc; L.Top = xc = yb; var sc; L.Left = sc = Gb; var tc; L.Right = tc = Kb; var yc; L.Bottom = yc = Mb; var Wb; L.TopSide = Wb = eb(new L(0, 0, 1, w.ld), 1).Ha(); var Xb; L.LeftSide = Xb = eb(new L(0, 0, 1, w.Sc), 1).Ha(); var Yb; L.RightSide = Yb = eb(new L(0, 0, 1, w.bd), 1).Ha(); var Zb; L.BottomSide = Zb = eb(new L(0, 0, 1, w.ad), 1).Ha(); var $b; L.TopBottomSides = $b = eb(new L(0, 0, 1, w.ld | w.ad), 1).Ha(); var ac; L.LeftRightSides = ac = eb(new L(0, 0, 1, w.Sc | w.bd), 1).Ha(); var dc; L.TopLeftSides = dc = eb(new L(0, 0, 1, w.ld | w.Sc), 1).Ha(); var ec; L.TopRightSides = ec = eb(new L(0, 0, 1, w.ld | w.bd), 1).Ha(); var fc; L.BottomLeftSides = fc = eb(new L(0, 0, 1, w.ad | w.Sc), 1).Ha(); var gc; L.BottomRightSides = gc = eb(new L(0, 0, 1, w.ad | w.bd), 1).Ha(); var hc; L.NotTopSide = hc = eb(new L(0, 0, 1, w.Sc | w.bd | w.ad), 1).Ha(); var ic; L.NotLeftSide = ic = eb(new L(0, 0, 1, w.ld | w.bd | w.ad), 1).Ha(); var oc; L.NotRightSide = oc = eb(new L(0, 0, 1, w.ld | w.Sc | w.ad), 1).Ha(); var pc; L.NotBottomSide = pc = eb(new L(0, 0, 1, w.ld | w.Sc | w.bd), 1).Ha(); var qc; L.AllSides = qc = eb(new L(0, 0, 1, w.ld | w.Sc | w.bd | w.ad), 1).Ha(); function Lc() { this.Ub = [1, 0, 0, 1, 0, 0] } Lc.prototype.copy = function () { var a = new Lc; a.Ub[0] = this.Ub[0]; a.Ub[1] = this.Ub[1]; a.Ub[2] = this.Ub[2]; a.Ub[3] = this.Ub[3]; a.Ub[4] = this.Ub[4]; a.Ub[5] = this.Ub[5]; return a }; Lc.prototype.translate = function (a, b) { this.Ub[4] += this.Ub[0] * a + this.Ub[2] * b; this.Ub[5] += this.Ub[1] * a + this.Ub[3] * b }; Lc.prototype.scale = function (a, b) { this.Ub[0] *= a; this.Ub[1] *= a; this.Ub[2] *= b; this.Ub[3] *= b }; function Mc(a) { this.type = a; this.r2 = this.y2 = this.x2 = this.r1 = this.y1 = this.x1 = 0; this.uE = []; this.pattern = null } Mc.prototype.addColorStop = function (a, b) { this.uE.push({ offset: a, color: b }) }; function Oc(a, b, c) { this.fillStyle = "#000000"; this.font = "10px sans-serif"; this.globalAlpha = 1; this.lineCap = "butt"; this.Jn = 0; this.lineJoin = "miter"; this.lineWidth = 1; this.miterLimit = 10; this.shadowBlur = 0; this.shadowColor = "rgba(0, 0, 0, 0)"; this.shadowOffsetY = this.shadowOffsetX = 0; this.strokeStyle = "#000000"; this.textAlign = "start"; this.Hp = !1; this.Eg = this.$s = this.Zs = 0; this.document = b || document; this.IE = c; this.Fx = null; this.path = []; this.wh = new Lc; this.stack = []; this.yf = []; this.ix = a; this.gJ = "http://www.w3.org/2000/svg"; this.width = this.ix.width; this.height = this.ix.height; this.hm = Pc(this, "svg", { width: this.width + "px", height: this.height + "px", ZL: "0 0 " + this.ix.width + " " + this.ix.height }); this.hm.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.w3.org/2000/svg"); this.hm.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"); Qc(this, 1, 0, 0, 1, 0, 0); a = w.nm++; b = Pc(this, "clipPath", { id: "mainClip" + a }); b.appendChild(Pc(this, "rect", { x: 0, y: 0, width: this.width, height: this.height })); this.hm.appendChild(b); this.yf[0].setAttributeNS(null, "clip-path", "url(#mainClip" + a + ")") } g = Oc.prototype; g.arc = function (a, b, c, d, e, f) { Rc(this, a, b, c, d, e, f) }; g.beginPath = function () { this.path = [] }; g.bezierCurveTo = function (a, b, c, d, e, f) { this.path.push(["C", a, b, c, d, e, f]) }; g.clearRect = function () { }; g.clip = function () { Sc(this, "clipPath", this.path, new 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 () { return null }; 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); void 0 === d && (f = b, h = c, k = d = a.naturalWidth, l = e = a.naturalHeight); d = d || 0; e = e || 0; f = f || 0; h = h || 0; k = k || 0; l = l || 0; m = { x: 0, y: 0, width: a.naturalWidth, height: a.naturalHeight, href: m, preserveAspectRatio: "xMidYMid slice" }; Va(d, k) && Va(e, l) || (m.preserveAspectRatio = "none"); var n = ""; k /= d; l /= e; if (0 !== f || 0 !== h) n += " translate(" + f + ", " + h + ")"; if (1 !== k || 1 !== l) n += " scale(" + k + ", " + l + ")"; if (0 !== b || 0 !== c) n += " translate(" + -b + ", " + -c + ")"; if (0 !== b || 0 !== c || d !== a.naturalWidth || e !== a.naturalHeight) a = "CLIP" + w.nm++ , f = Pc(this, "clipPath", { id: a }), f.appendChild(Pc(this, "rect", { x: b, y: c, width: d, height: e })), this.hm.appendChild(f), m["clip-path"] = "url(#" + a + ")"; Tc(this, "image", m, this.wh, n); this.addElement("image", m) }; g.fill = function () { Sc(this, "fill", this.path, this.wh) }; g.Mg = function () { this.Hp ? this.clip() : this.fill() }; g.fillRect = function (a, b, c, d) { Uc(this, "fill", [a, b, c, d], this.wh) }; g.fillText = function (a, b, c) { a = [a, b, c]; b = this.textAlign; "left" === b ? b = "start" : "right" === b ? b = "end" : "center" === b && (b = "middle"); b = { x: a[1], y: a[2], style: "font: " + this.font, "text-anchor": b }; Tc(this, "fill", b, this.wh); this.addElement("text", b, a[0]) }; g.lineTo = function (a, b) { this.path.push(["L", a, b]) }; g.moveTo = function (a, b) { this.path.push(["M", a, b]) }; g.quadraticCurveTo = function (a, b, c, d) { this.path.push(["Q", a, b, c, d]) }; g.rect = function (a, b, c, d) { this.path.push(["M", a, b], ["L", a + c, b], ["L", a + c, b + d], ["L", a, b + d], ["z"]) }; g.restore = function () { this.wh = this.stack.pop(); this.path = this.stack.pop(); var a = this.stack.pop(); this.fillStyle = a.fillStyle; this.font = a.font; this.globalAlpha = a.globalAlpha; this.lineCap = a.lineCap; this.Jn = a.Jn; 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, Jn: this.Jn, lineJoin: this.lineJoin, lineWidth: this.lineWidth, miterLimit: this.miterLimit, shadowBlur: this.shadowBlur, shadowColor: this.shadowColor, shadowOffsetX: this.shadowOffsetX, shadowOffsetY: this.shadowOffsetY, strokeStyle: this.strokeStyle, textAlign: this.textAlign }); for (var a = [], b = 0; b < this.path.length; b++)a.push(this.path[b]); this.stack.push(a); this.stack.push(this.wh.copy()) }; g.setTransform = function (a, b, c, d, e, f) { 1 === a && 0 === b && 0 === c && 1 === d && 0 === e && 0 === f || Qc(this, a, b, c, d, e, f) }; g.scale = function (a, b) { this.wh.scale(a, b) }; g.translate = function (a, b) { this.wh.translate(a, b) }; g.transform = function () { }; g.stroke = function () { Sc(this, "stroke", this.path, this.wh) }; g.Dj = function () { this.Hp || this.stroke() }; g.strokeRect = function (a, b, c, d) { Uc(this, "stroke", [a, b, c, d], this.wh) }; function Pc(a, b, c, d) { a = a.document.createElementNS(a.gJ, b); if (w.Pa(c)) for (var e in c) a.setAttributeNS("href" === e ? "http://www.w3.org/1999/xlink" : "", e, c[e]); void 0 !== d && (a.textContent = d); return a } g.addElement = function (a, b, c) { a = Pc(this, a, b, c); 0 < this.yf.length ? this.yf[this.yf.length - 1].appendChild(a) : this.hm.appendChild(a); return this.Fx = a }; function Tc(a, b, c, d, e) { 1 !== a.globalAlpha && (c.opacity = a.globalAlpha); "fill" === b ? (a.fillStyle instanceof Mc ? c.fill = Vc(a, a.fillStyle) : (/^rgba\(/.test(a.fillStyle) && (b = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle), c.fill = "rgb(" + b[1] + "," + b[2] + "," + b[3] + ")", c["fill-opacity"] = b[4]), c.fill = a.fillStyle), c.stroke = "none") : "stroke" === b && (c.fill = "none", a.strokeStyle instanceof Mc ? c.stroke = Vc(a, a.strokeStyle) : (/^rgba\(/.test(a.strokeStyle) && (b = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle), c.stroke = "rgb(" + b[1] + "," + b[2] + "," + b[3] + ")", c["stroke-opacity"] = b[4]), c.stroke = a.strokeStyle), c["stroke-width"] = a.lineWidth, c["stroke-linecap"] = a.lineCap, c["stroke-linejoin"] = a.lineJoin, c["stroke-miterlimit"] = a.miterLimit); a = d.Ub; a = "matrix(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")"; void 0 !== e && (a += e); c.transform = a } function Vc(a, b) { var c = "GRAD" + w.nm++, d; if ("linear" === b.type) d = Pc(a, "linearGradient", { x1: b.x1, x2: b.x2, y1: b.y1, y2: b.y2, id: c, gradientUnits: "userSpaceOnUse" }); else if ("radial" === b.type) d = Pc(a, "radialGradient", { x1: b.x1, x2: b.x2, y1: b.y1, y2: b.y2, r1: b.r1, r2: b.r2, id: c }); else if ("pattern" === b.type) { var e = b.pattern; d = { width: e.width, height: e.height, id: c, patternUnits: "userSpaceOnUse" }; var f = ""; e instanceof HTMLCanvasElement && (f = e.toDataURL()); e instanceof HTMLImageElement && (f = e.src); e = { x: 0, y: 0, width: e.width, height: e.height, href: f }; d = Pc(a, "pattern", d); d.appendChild(Pc(a, "image", e)) } else throw Error("invalid gradient"); for (var e = b.uE, f = e.length, h = [], k = 0; k < f; k++) { var l = e[k], m = l.color, l = { offset: l.offset, "stop-color": m }; /^rgba\(/.test(m) && (m = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(m), l["stop-color"] = "rgb(" + m[1] + "," + m[2] + "," + m[3] + ")", l["stop-opacity"] = m[4]); h.push(l) } h.sort(function (a, b) { return a.offset > b.offset ? 1 : -1 }); for (k = 0; k < f; k++)d.appendChild(Pc(a, "stop", h[k])); a.hm.appendChild(d); return "url(#" + c + ")" } function Uc(a, b, c, d) { c = { x: c[0], y: c[1], width: c[2], height: c[3] }; Tc(a, b, c, d); a.addElement("rect", c) } function Sc(a, b, c, d) { for (var e = [], f = 0; f < c.length; f++) { var h = w.Jl(c[f]), k = [h.shift()]; if ("A" === k[0]) k.push(h.shift() + "," + h.shift(), h.shift(), h.shift() + "," + h.shift(), h.shift() + "," + h.shift()); else for (; h.length;)k.push(h.shift() + "," + h.shift()); e.push(k.join(" ")) } c = { d: e.join(" ") }; Tc(a, b, c, d); "clipPath" === b ? (b = "CLIP" + w.nm++ , d = Pc(a, "clipPath", { id: b }), d.appendChild(Pc(a, "path", c)), a.hm.appendChild(d), 0 < a.yf.length && a.yf[a.yf.length - 1].setAttributeNS(null, "clip-path", "url(#" + b + ")")) : a.addElement("path", c) } function Rc(a, b, c, d, e, f, h) { var k = Math.abs(e - f); if (e !== f) { var l = b + d * Math.cos(f); f = c + d * Math.sin(f); k >= 2 * Math.PI ? (Rc(a, b, c, d, e, e + Math.PI, h), Rc(a, b, c, d, e + Math.PI, e + 2 * Math.PI, h), a.path.push(["M", l, f])) : (b += d * Math.cos(e), c += d * Math.sin(e), k = 180 * k / Math.PI, e = h ? 0 : 1, h = 180 <= k === !!h ? 0 : 1, 0 !== a.path.length ? a.path.push(["L", b, c]) : a.path.push(["M", b, c]), a.path.push(["A", d, d, k, h, e, l, f])) } } function Qc(a, b, c, d, e, f, h) { var k = new Lc; k.Ub = [b, c, d, e, f, h]; b = {}; Tc(a, "g", b, k); k = a.addElement("g", b); a.yf.push(k) } g.bb = function () { if (0 !== this.shadowOffsetX || 0 !== this.shadowOffsetY || 0 !== this.shadowBlur) { var a = "SHADOW" + w.nm++, b = this.addElement("filter", { id: a, x: "-100%", y: "-100%", width: "300%", height: "300%" }, null), c, d, e, f, h; c = Pc(this, "feGaussianBlur", { "in": "SourceAlpha", result: "blur", OL: this.shadowBlur / 2 }); d = Pc(this, "feFlood", { "in": "blur", result: "flood", "flood-color": this.shadowColor }); e = Pc(this, "feComposite", { "in": "flood", in2: "blur", operator: "in", result: "comp" }); f = Pc(this, "feOffset", { "in": "comp", result: "offsetBlur", dx: this.shadowOffsetX, dy: this.shadowOffsetY }); h = Pc(this, "feMerge", {}); h.appendChild(Pc(this, "feMergeNode", { "in": "offsetBlur" })); h.appendChild(Pc(this, "feMergeNode", { "in": "SourceGraphic" })); b.appendChild(c); b.appendChild(d); b.appendChild(e); b.appendChild(f); b.appendChild(h); 0 < this.yf.length && this.yf[this.yf.length - 1].setAttributeNS(null, "filter", "url(#" + a + ")") } }; g.pB = function (a, b, c) { this.Zs = a; this.$s = b; this.Eg = c }; g.Yn = function () { this.shadowBlur = this.shadowOffsetY = this.shadowOffsetX = 0 }; g.Zn = function () { this.shadowOffsetX = this.Zs; this.shadowOffsetY = this.$s; this.shadowBlur = this.Eg }; g.kA = function () { return !1 }; g.hA = function () { }; g.Fe = function () { }; g.ky = function () { }; Oc.prototype.rotate = function () { }; function Wc(a, b) { this.ownerDocument = void 0 === b ? document : b; var c = this.ownerDocument.createElement("canvas"); c.tabIndex = 0; this.Jd = c; this.xk = new Xc(c); c.$ = a; Object.seal(this) } g = Wc.prototype; g.toDataURL = function (a, b) { return this.Jd.toDataURL(a, b) }; g.getBoundingClientRect = function () { return this.Jd.getBoundingClientRect() }; g.focus = function () { return this.Jd.focus() }; g.addEventListener = function (a, b, c) { this.Jd.addEventListener(a, b, c) }; g.removeEventListener = function (a, b, c) { this.Jd.removeEventListener(a, b, c) }; w.defineProperty(Wc, { width: "width" }, function () { return this.Jd.width }, function (a) { this.Jd.width = a }); w.defineProperty(Wc, { height: "height" }, function () { return this.Jd.height }, function (a) { this.Jd.height = a }); w.u(Wc, { style: "style" }, function () { return this.Jd.style }); function Xc(a) { a.getContext && a.getContext("2d") || w.k("Browser does not support HTML Canvas Element"); this.ta = a.getContext("2d"); this.Hy = this.Jy = this.Iy = ""; this.Tq = !1; this.Eg = this.$s = this.Zs = 0; Object.seal(this) } Xc.prototype.ky = function (a) { this.ta.xA = a; this.ta.uL = a }; w.defineProperty(Xc, { fillStyle: "fillStyle" }, function () { return this.ta.fillStyle }, function (a) { this.Hy !== a && (this.Hy = this.ta.fillStyle = a) }); w.defineProperty(Xc, { font: "font" }, function () { return this.ta.font }, function (a) { this.Iy !== a && (this.Iy = this.ta.font = a) }); w.defineProperty(Xc, { globalAlpha: "globalAlpha" }, function () { return this.ta.globalAlpha }, function (a) { this.ta.globalAlpha = a }); w.defineProperty(Xc, { lineCap: "lineCap" }, function () { return this.ta.lineCap }, function (a) { this.ta.lineCap = a }); w.defineProperty(Xc, { Jn: "lineDashOffset" }, function () { return this.ta.Jn }, function (a) { this.ta.Jn = a }); w.defineProperty(Xc, { lineJoin: "lineJoin" }, function () { return this.ta.lineJoin }, function (a) { this.ta.lineJoin = a }); w.defineProperty(Xc, { lineWidth: "lineWidth" }, function () { return this.ta.lineWidth }, function (a) { this.ta.lineWidth = a }); w.defineProperty(Xc, { miterLimit: "miterLimit" }, function () { return this.ta.miterLimit }, function (a) { this.ta.miterLimit = a }); w.defineProperty(Xc, { shadowBlur: "shadowBlur" }, function () { return this.ta.shadowBlur }, function (a) { this.ta.shadowBlur = a }); w.defineProperty(Xc, { shadowColor: "shadowColor" }, function () { return this.ta.shadowColor }, function (a) { this.ta.shadowColor = a }); w.defineProperty(Xc, { shadowOffsetX: "shadowOffsetX" }, function () { return this.ta.shadowOffsetX }, function (a) { this.ta.shadowOffsetX = a }); w.defineProperty(Xc, { shadowOffsetY: "shadowOffsetY" }, function () { return this.ta.shadowOffsetY }, function (a) { this.ta.shadowOffsetY = a }); w.defineProperty(Xc, { strokeStyle: "strokeStyle" }, function () { return this.ta.strokeStyle }, function (a) { this.Jy !== a && (this.Jy = this.ta.strokeStyle = a) }); w.defineProperty(Xc, { textAlign: "textAlign" }, function () { return this.ta.textAlign }, function (a) { this.ta.textAlign = a }); w.defineProperty(Xc, { xA: "imageSmoothingEnabled" }, function () { return this.ta.xA }, function (a) { this.ta.xA = a }); g = Xc.prototype; g.arc = function (a, b, c, d, e, f) { this.ta.arc(a, b, c, d, e, f) }; g.beginPath = function () { this.ta.beginPath() }; g.bezierCurveTo = function (a, b, c, d, e, f) { this.ta.bezierCurveTo(a, b, c, d, e, f) }; g.clearRect = function (a, b, c, d) { this.ta.clearRect(a, b, c, d) }; g.clip = function () { this.ta.clip() }; g.closePath = function () { this.ta.closePath() }; g.createLinearGradient = function (a, b, c, d) { return this.ta.createLinearGradient(a, b, c, d) }; g.createPattern = function (a, b) { return this.ta.createPattern(a, b) }; g.createRadialGradient = function (a, b, c, d, e, f) { return this.ta.createRadialGradient(a, b, c, d, e, f) }; g.drawImage = function (a, b, c, d, e, f, h, k, l) { void 0 === d ? this.ta.drawImage(a, b, c) : this.ta.drawImage(a, b, c, d, e, f, h, k, l) }; g.fill = function () { this.ta.fill() }; g.fillRect = function (a, b, c, d) { this.ta.fillRect(a, b, c, d) }; g.fillText = function (a, b, c) { this.ta.fillText(a, b, c) }; g.getImageData = function (a, b, c, d) { return this.ta.getImageData(a, b, c, d) }; g.lineTo = function (a, b) { this.ta.lineTo(a, b) }; g.measureText = function (a) { return this.ta.measureText(a) }; g.moveTo = function (a, b) { this.ta.moveTo(a, b) }; g.quadraticCurveTo = function (a, b, c, d) { this.ta.quadraticCurveTo(a, b, c, d) }; g.rect = function (a, b, c, d) { this.ta.rect(a, b, c, d) }; g.restore = function () { this.ta.restore() }; Xc.prototype.rotate = function (a) { this.ta.rotate(a) }; g = Xc.prototype; g.save = function () { this.ta.save() }; g.setTransform = function (a, b, c, d, e, f) { this.ta.setTransform(a, b, c, d, e, f) }; g.scale = function (a, b) { this.ta.scale(a, b) }; g.stroke = function () { this.ta.stroke() }; g.transform = function (a, b, c, d, e, f) { 1 === a && 0 === b && 0 === c && 1 === d && 0 === e && 0 === f || this.ta.transform(a, b, c, d, e, f) }; g.translate = function (a, b) { this.ta.translate(a, b) }; g.Mg = function (a) { if (a instanceof ha && a.type === cd) { var b = a.ro; a = a.My; a > b ? (this.scale(b / a, 1), this.translate((a - b) / 2, 0)) : b > a && (this.scale(1, a / b), this.translate(0, (b - a) / 2)); this.Tq ? this.clip() : this.fill(); a > b ? (this.translate(-(a - b) / 2, 0), this.scale(1 / (b / a), 1)) : b > a && (this.translate(0, -(b - a) / 2), this.scale(1, 1 / (a / b))) } else this.Tq ? this.clip() : this.fill() }; g.Dj = function () { this.Tq || this.stroke() }; w.defineProperty(Xc, { Hp: "clipInsteadOfFill" }, function () { return this.Tq }, function (a) { this.Tq = a }); g = Xc.prototype; g.pB = function (a, b, c) { this.Zs = a; this.$s = b; this.Eg = c }; g.Yn = function () { this.shadowBlur = this.shadowOffsetY = this.shadowOffsetX = 0 }; g.Zn = function () { this.shadowOffsetX = this.Zs; this.shadowOffsetY = this.$s; this.shadowBlur = this.Eg }; g.kA = function (a, b) { var c = this.ta; if (void 0 !== c.setLineDash) c.setLineDash(a), c.lineDashOffset = b; else if (void 0 !== c.webkitLineDash) c.webkitLineDash = a, c.webkitLineDashOffset = b; else if (void 0 !== c.mozDash) c.mozDash = a, c.mozDashOffset = b; else return !1; return !0 }; g.hA = function () { var a = this.ta; void 0 !== a.setLineDash ? (a.setLineDash(w.io), a.lineDashOffset = 0) : void 0 !== a.webkitLineDash ? (a.webkitLineDash = w.io, a.webkitLineDashOffset = 0) : void 0 !== a.mozDash && (a.mozDash = null, a.mozDashOffset = 0) }; g.Fe = function (a) { a && (this.Iy = ""); this.Hy = this.Jy = "" }; var dd = (Math.sqrt(2) - 1) / 3 * 4, ed = (new z(0, 0)).Ha(), fd = (new B(0, 0, 0, 0)).Ha(), gd = (new db(0, 0, 0, 0)).Ha(), nd = (new db(2, 2, 2, 2)).Ha(), od = (new z(6, 6)).Ha(), pd = (new z(-Infinity, -Infinity)).Ha(), qd = (new z(Infinity, Infinity)).Ha(), rd = (new ia(0, 0)).Ha(), Ad = (new ia(1, 1)).Ha(), Bd = (new ia(6, 6)).Ha(), Cd = (new ia(8, 8)).Ha(), Dd = (new ia(10, 10)).Ha(), Ed = (new ia(Infinity, Infinity)).Ha(), Fd = (new z(NaN, NaN)).Ha(), Gd = (new ia(NaN, NaN)).Ha(), Pd = (new B(NaN, NaN, NaN, NaN)).Ha(), Qd = (new L(.156, .156)).Ha(), Rd = (new L(.844, .844)).Ha(), Sd = new sa, Td = new sa, Ud = null; function Vd(a) { if (0 >= a) return 0; var b = Ud; if (null === b) { for (var b = [], c = 0; 2E3 >= c; c++)b[c] = Math.sqrt(c); Ud = b } return 1 > a ? (c = 1 / a, 2E3 >= c ? 1 / b[c | 0] : Math.sqrt(a)) : 2E3 >= a ? b[a | 0] : Math.sqrt(a) } function J(a, b) { var c = a - b; return .5 > c && -.5 < c } function Va(a, b) { var c = a - b; return 5E-8 > c && -5E-8 < c } function Wd(a, b, c, d, e, f, h) { 0 >= e && (e = 1E-6); var k = 0, l = 0, m = 0, n = 0; a < c ? (l = a, k = c) : (l = c, k = a); b < d ? (n = b, m = d) : (n = d, m = b); if (a === c) return n <= h && h <= m && a - e <= f && f <= a + e; if (b === d) return l <= f && f <= k && b - e <= h && h <= b + e; k += e; l -= e; if (l <= f && f <= k && (m += e, n -= e, n <= h && h <= m)) if (k - l > m - n) if (a - c > e || c - a > e) { if (f = (d - b) / (c - a) * (f - a) + b, f - e <= h && h <= f + e) return !0 } else return !0; else if (b - d > e || d - b > e) { if (h = (c - a) / (d - b) * (h - b) + a, h - e <= f && f <= h + e) return !0 } else return !0; return !1 } function Xd(a, b, c, d, e, f, h, k, l, m, n, p) { if (Wd(a, b, h, k, p, c, d) && Wd(a, b, h, k, p, e, f)) return Wd(a, b, h, k, p, m, n); var q = (a + c) / 2, r = (b + d) / 2, s = (c + e) / 2, u = (d + f) / 2; e = (e + h) / 2; f = (f + k) / 2; d = (q + s) / 2; c = (r + u) / 2; var s = (s + e) / 2, u = (u + f) / 2, t = (d + s) / 2, x = (c + u) / 2; return Xd(a, b, q, r, d, c, t, x, l, m, n, p) || Xd(t, x, s, u, e, f, h, k, l, m, n, p) } function Yd(a, b, c, d, e, f, h, k, l, m) { if (Wd(a, b, h, k, l, c, d) && Wd(a, b, h, k, l, e, f)) $a(m, a, b, 0, 0), $a(m, h, k, 0, 0); else { var n = (a + c) / 2, p = (b + d) / 2, q = (c + e) / 2, r = (d + f) / 2; e = (e + h) / 2; f = (f + k) / 2; d = (n + q) / 2; c = (p + r) / 2; var q = (q + e) / 2, r = (r + f) / 2, s = (d + q) / 2, u = (c + r) / 2; Yd(a, b, n, p, d, c, s, u, l, m); Yd(s, u, q, r, e, f, h, k, l, m) } } function Zd(a, b, c, d, e, f, h, k, l, m) { if (Wd(a, b, h, k, l, c, d) && Wd(a, b, h, k, l, e, f)) 0 === m.length && (m.push(a), m.push(b)), m.push(h), m.push(k); else { var n = (a + c) / 2, p = (b + d) / 2, q = (c + e) / 2, r = (d + f) / 2; e = (e + h) / 2; f = (f + k) / 2; d = (n + q) / 2; c = (p + r) / 2; var q = (q + e) / 2, r = (r + f) / 2, s = (d + q) / 2, u = (c + r) / 2; Zd(a, b, n, p, d, c, s, u, l, m); Zd(s, u, q, r, e, f, h, k, l, m) } } function fe(a, b, c, d, e, f, h, k, l, m, n, p, q, r) { var s = 1 - l; a = a * s + c * l; b = b * s + d * l; c = c * s + e * l; d = d * s + f * l; e = e * s + h * l; f = f * s + k * l; k = a * s + c * l; h = b * s + d * l; c = c * s + e * l; d = d * s + f * l; m.x = a; m.y = b; n.x = k; n.y = h; p.x = k * s + c * l; p.y = h * s + d * l; q.x = c; q.y = d; r.x = e; r.y = f } function ge(a, b, c, d, e, f, h, k, l, m) { if (Wd(a, b, e, f, m, c, d)) return Wd(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 ge(a, b, n, p, q, r, h, k, l, m) || ge(q, r, c, d, e, f, h, k, l, m) } function he(a, b, c, d, e, f, h, k) { if (Wd(a, b, e, f, h, c, d)) $a(k, a, b, 0, 0), $a(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; he(a, b, l, m, n, p, h, k); he(n, p, c, d, e, f, h, k) } } function ie(a, b, c, d, e, f, h, k) { if (Wd(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; ie(a, b, l, m, n, p, h, k); ie(n, p, c, d, e, f, h, k) } } function je(a, b, c, d, e, f, h, k, l, m, n, p, q, r) { 0 >= q && (q = 1E-6); if (Wd(a, b, h, k, q, c, d) && Wd(a, b, h, k, q, e, f)) { var s = (a - h) * (m - p) - (b - k) * (l - n); if (0 === s) return !1; q = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / s; s = ((a * k - b * h) * (m - p) - (b - k) * (l * p - m * n)) / s; if ((l > n ? l - n : n - l) < (m > p ? m - p : p - m)) { if (h = l = 0, b < k ? (l = b, h = k) : (l = k, h = b), s < l || s > h) return !1 } else if (a < h ? l = a : (l = h, h = a), q < l || q > h) return !1; r.x = q; r.y = s; return !0 } var s = (a + c) / 2, u = (b + d) / 2; c = (c + e) / 2; d = (d + f) / 2; e = (e + h) / 2; f = (f + k) / 2; var t = (s + c) / 2, x = (u + d) / 2; c = (c + e) / 2; d = (d + f) / 2; var v = (t + c) / 2, A = (x + d) / 2, y = (n - l) * (n - l) + (p - m) * (p - m), K = !1; je(a, b, s, u, t, x, v, A, l, m, n, p, q, r) && (b = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), b < y && (y = b, K = !0)); a = r.x; s = r.y; je(v, A, c, d, e, f, h, k, l, m, n, p, q, r) && (b = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), b < y ? K = !0 : (r.x = a, r.y = s)); return K } function ke(a, b, c, d, e, f, h, k, l, m, n, p, q) { var r = 0; 0 >= q && (q = 1E-6); if (Wd(a, b, h, k, q, c, d) && Wd(a, b, h, k, q, e, f)) { q = (a - h) * (m - p) - (b - k) * (l - n); if (0 === q) return r; var s = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / q, u = ((a * k - b * h) * (m - p) - (b - k) * (l * p - m * n)) / q; if (s >= n) return r; if ((l > n ? l - n : n - l) < (m > p ? m - p : p - m)) { if (a = l = 0, b < k ? (l = b, a = k) : (l = k, a = b), u < l || u > a) return r } else if (a < h ? (l = a, a = h) : l = h, s < l || s > a) return r; 0 < q ? r++ : 0 > q && r-- } else { var s = (a + c) / 2, u = (b + d) / 2, t = (c + e) / 2, x = (d + f) / 2; e = (e + h) / 2; f = (f + k) / 2; d = (s + t) / 2; c = (u + x) / 2; var t = (t + e) / 2, x = (x + f) / 2, v = (d + t) / 2, A = (c + x) / 2, r = r + ke(a, b, s, u, d, c, v, A, l, m, n, p, q), r = r + ke(v, A, t, x, e, f, h, k, l, m, n, p, q) } return r } function Ia(a, b, c, d, e, f, h) { if (Va(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 (Va(b, d)) { a < c ? k = a : (k = c, c = a); d = e; if (d < k) return h.x = k, h.y = b, !1; if (d > c) return h.x = c, h.y = b, !1; h.x = d; h.y = b; return !0 } k = ((a - e) * (a - c) + (b - f) * (b - d)) / ((c - a) * (c - a) + (d - b) * (d - b)); if (-5E-6 > k) return h.x = a, h.y = b, !1; if (1.000005 < k) return h.x = c, h.y = d, !1; h.x = a + k * (c - a); h.y = b + k * (d - b); return !0 } function le(a, b, c, d, e, f, h, k, l) { if (J(a, c) && J(b, d)) return l.x = a, l.y = b, !1; if (Va(e, h)) { if (Va(a, c)) return Ia(a, b, c, d, e, f, l), !1; f = (d - b) / (c - a) * (e - a) + b; return Ia(a, b, c, d, e, f, l) } k = (k - f) / (h - e); if (Va(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 (Va(k, h)) return Ia(a, b, c, d, e, f, l), !1; e = (h * a - k * e + f - b) / (h - k); if (Va(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 Ia(a, b, c, d, e, f, l) } function me(a, b, c, d, e, f, h, k, l) { var m = 1E21, n = a, p = b; if (le(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) } le(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)); le(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)); le(a, d, c, d, e, f, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - f) * (l.y - f), q < m && (m = q, n = l.x, p = l.y)); l.x = n; l.y = p; return 1E21 > m } function ne(a, b, c, d, e, f, h, k, l) { c = a - c; var m = e - h, n = h = 0; 0 === c || 0 === m ? 0 === c ? (k = (f - k) / m, h = a, n = k * h + (f - k * e)) : (d = (b - d) / c, h = e, n = d * h + (b - d * a)) : (d = (b - d) / c, k = (f - k) / m, a = b - d * a, h = (f - k * e - a) / (d - k), n = d * h + a); l.m(h, n); return l } function oe(a, b, c) { var d = b.x, e = b.y, f = c.x, h = c.y, k = a.left, l = a.right, m = a.top, n = a.bottom; return d === f ? (f = a = 0, e < h ? (a = e, f = h) : (a = h, f = e), k <= d && d <= l && a <= n && f >= m) : e === h ? (d < f ? a = d : (a = f, f = d), m <= e && e <= n && a <= l && f >= k) : a.Ia(b) || a.Ia(c) || pe(k, m, l, m, d, e, f, h) || pe(l, m, l, n, d, e, f, h) || pe(l, n, k, n, d, e, f, h) || pe(k, n, k, m, d, e, f, h) ? !0 : !1 } function pe(a, b, c, d, e, f, h, k) { return 0 >= xe(a, b, c, d, e, f) * xe(a, b, c, d, h, k) && 0 >= xe(e, f, h, k, a, b) * xe(e, f, h, k, c, d) } function xe(a, b, c, d, e, f) { c -= a; d -= b; a = e - a; b = f - b; f = a * d - b * c; 0 === f && (f = a * c + b * d, 0 < f && (f = (a - c) * c + (b - d) * d, 0 > f && (f = 0))); return 0 > f ? -1 : 0 < f ? 1 : 0 } function ye(a) { 0 > a && (a += 360); 360 <= a && (a -= 360); return a } function ze(a, b, c, d) { var e = Math.PI; d || (b *= e / 180, c *= e / 180); d = b < c ? 1 : -1; var f = [], h = e / 2, k = b; for (b = Math.min(2 * e, Math.abs(c - b)); 1E-5 < b;) { c = k + d * Math.min(b, h); var e = (c - k) / 2, l = a * Math.cos(e), m = a * Math.sin(e), n = -m, p = l * l + n * n, q = p + l * l + n * m, p = 4 / 3 * (Math.sqrt(2 * p * q) - q) / (l * m - n * l), m = l - p * n, l = n + p * l, n = -l, p = e + k, e = Math.cos(p), p = Math.sin(p); f.push([0 + a * Math.cos(k), 0 + a * Math.sin(k), 0 + m * e - l * p, 0 + m * p + l * e, 0 + m * e - n * p, 0 + m * p + n * e, 0 + a * Math.cos(c), 0 + a * Math.sin(c)]); b -= Math.abs(c - k); k = c } return f } function Ka(a, b, c, d, e, f, h) { c = Math.floor((a - c) / e) * e + c; d = Math.floor((b - d) / f) * f + d; var k = c; c + e - a < e / 2 && (k = c + e); a = d; d + f - b < f / 2 && (a = d + f); h.m(k, a) } function Ae(a, b) { var c = Math.max(a, b), d = Math.min(a, b), e = 1, f = 1; do e = c % d, c = f = d, d = e; while (0 < e); return f } function Be(a, b, c, d) { var e = 0 > c, f = 0 > d, h = 0, k = h = 0; a < b ? (h = 1, k = 0) : (h = 0, k = 1); var l = 0, m = 0, n = 0, p = 0, l = 0 === h ? a : b, n = 0 === h ? c : d; if (0 === h ? e : f) n = -n; h = k; m = 0 === h ? a : b; p = 0 === h ? c : d; if (0 === h ? e : f) p = -p; a = a = 0; if (0 < p) if (0 < n) { b = l * l; a = m * m; l *= n; c = m * p; d = -a + c; e = -a + Math.sqrt(l * l + c * c); m = d; for (f = 0; 9999999999 > f; ++f) { m = .5 * (d + e); if (m === d || m === e) break; k = l / (m + b); h = c / (m + a); k = k * k + h * h - 1; if (0 < k) d = m; else if (0 > k) e = m; else break } n = b * n / (m + b) - n; p = a * p / (m + a) - p; a = Math.sqrt(n * n + p * p) } else a = Math.abs(p - m); else p = l * l - m * m, a = l * n, a < p ? (p = a / p, a = m * Math.sqrt(Math.abs(1 - p * p)), n = l * p - n, a = Math.sqrt(n * n + a * a)) : a = Math.abs(n - l); return a } function Ce(a) { 1 < arguments.length && w.k("Geometry constructor can take at most one optional argument, the Geometry type."); w.nc(this); this.Q = !1; void 0 === a && (a = De); this.ma = a; this.Gb = this.yb = this.Ic = this.zc = 0; this.Nj = new H(Ee); this.zv = this.Nj.F; this.jv = (new B).freeze(); this.fb = !0; this.Iq = this.lo = null; this.Jq = NaN; this.hi = xb; this.ii = Nb; this.No = this.Po = NaN; this.Fi = Fe } w.ga("Geometry", Ce); w.ni(Ce); Ce.prototype.copy = function () { var a = new Ce; a.ma = this.ma; a.zc = this.zc; a.Ic = this.Ic; a.yb = this.yb; a.Gb = this.Gb; for (var b = this.Nj.n, c = b.length, d = a.Nj, e = 0; e < c; e++) { var f = b[e].copy(); d.add(f) } a.zv = this.zv; a.jv.assign(this.jv); a.fb = this.fb; a.lo = this.lo; a.Iq = this.Iq; a.Jq = this.Jq; a.hi = this.hi.S(); a.ii = this.ii.S(); a.Po = this.Po; a.No = this.No; a.Fi = this.Fi; return a }; var Ge; Ce.Line = Ge = w.p(Ce, "Line", 0); var He; Ce.Rectangle = He = w.p(Ce, "Rectangle", 1); var Pe; Ce.Ellipse = Pe = w.p(Ce, "Ellipse", 2); var De; Ce.Path = De = w.p(Ce, "Path", 3); Ce.prototype.Ha = function () { this.freeze(); Object.freeze(this); return this }; Ce.prototype.freeze = function () { this.Q = !0; var a = this.fc; a.freeze(); for (var a = a.n, b = a.length, c = 0; c < b; c++)a[c].freeze(); return this }; Ce.prototype.Qa = function () { Object.isFrozen(this) && w.k("cannot thaw constant: " + this); this.Q = !1; var a = this.fc; a.Qa(); for (var a = a.n, b = a.length, c = 0; c < b; c++)a[c].Qa(); return this }; Ce.prototype.equalsApprox = Ce.prototype.Kc = function (a) { if (!(a instanceof Ce)) return !1; if (this.type !== a.type) return this.type === Ge && a.type === De ? Qe(this, a) : a.type === Ge && this.type === De ? Qe(a, this) : !1; if (this.type === De) { var b = this.fc.n; a = a.fc.n; var c = b.length; if (c !== a.length) return !1; for (var d = 0; d < c; d++)if (!b[d].Kc(a[d])) return !1; return !0 } return J(this.ha, a.ha) && J(this.fa, a.fa) && J(this.C, a.C) && J(this.D, a.D) }; function Qe(a, b) { if (a.type !== Ge || b.type !== De) return !1; if (1 === b.fc.count) { var c = b.fc.ea(0); if (1 === c.vb.count && J(a.ha, c.ha) && J(a.fa, c.fa) && (c = c.vb.ea(0), c.type === Re && J(a.C, c.C) && J(a.D, c.D))) return !0 } return !1 } var Se; Ce.stringify = Se = function (a) { return a.toString() }; Ce.prototype.ic = function (a) { a.Ee === Ce ? this.type = a : w.Ej(this, a) }; Ce.prototype.toString = function (a) { void 0 === a && (a = -1); switch (this.type) { case Ge: return 0 > a ? "M" + this.ha.toString() + " " + this.fa.toString() + "L" + this.C.toString() + " " + this.D.toString() : "M" + this.ha.toFixed(a) + " " + this.fa.toFixed(a) + "L" + this.C.toFixed(a) + " " + this.D.toFixed(a); case He: var b = new B(this.ha, this.fa, 0, 0); b.AG(this.C, this.D, 0, 0); return 0 > a ? "M" + b.x.toString() + " " + b.y.toString() + "H" + b.right.toString() + "V" + b.bottom.toString() + "H" + b.left.toString() + "z" : "M" + b.x.toFixed(a) + " " + b.y.toFixed(a) + "H" + b.right.toFixed(a) + "V" + b.bottom.toFixed(a) + "H" + b.left.toFixed(a) + "z"; case Pe: b = new B(this.ha, this.fa, 0, 0); b.AG(this.C, this.D, 0, 0); if (0 > a) { var c = b.left.toString() + " " + (b.y + b.height / 2).toString(), d = b.right.toString() + " " + (b.y + b.height / 2).toString(); return "M" + c + "A" + (b.width / 2).toString() + " " + (b.height / 2).toString() + " 0 0 1 " + d + "A" + (b.width / 2).toString() + " " + (b.height / 2).toString() + " 0 0 1 " + c } c = b.left.toFixed(a) + " " + (b.y + b.height / 2).toFixed(a); d = b.right.toFixed(a) + " " + (b.y + b.height / 2).toFixed(a); return "M" + c + "A" + (b.width / 2).toFixed(a) + " " + (b.height / 2).toFixed(a) + " 0 0 1 " + d + "A" + (b.width / 2).toFixed(a) + " " + (b.height / 2).toFixed(a) + " 0 0 1 " + c; case De: for (var b = "", c = this.fc.n, d = c.length, e = 0; e < d; e++) { var f = c[e]; 0 < e && (b += " x "); f.fu && (b += "F "); b += f.toString(a) } return b; default: return this.type.toString() } }; Ce.fillPath = function (a) { "string" !== typeof a && w.Bd(a, "string", Ce, "fillPath:str"); a = a.split(/[Xx]/); for (var b = a.length, c = "", d = 0; d < b; d++)var e = a[d], c = null !== e.match(/[Ff]/) ? 0 === d ? c + e : c + ("X" + (" " === e[0] ? "" : " ") + e) : c + ((0 === d ? "" : "X ") + "F" + (" " === e[0] ? "" : " ") + e); return c }; var Te; Ce.parse = Te = function (a, b) { function c() { return m >= u - 1 ? !0 : null !== l[m + 1].match(/[A-Za-z]/) } function d() { m++; return l[m] } function e() { var a = new z(parseFloat(d()), parseFloat(d())); n === n.toLowerCase() && (a.x = s.x + a.x, a.y = s.y + a.y); return a } function f() { return s = e() } function h() { return r = e() } function k() { return "c" !== p.toLowerCase() && "s" !== p.toLowerCase() ? s : new z(2 * s.x - r.x, 2 * s.y - r.y) } void 0 === b && (b = !1); "string" !== typeof a && w.Bd(a, "string", Ce, "parse:str"); a = a.replace(/,/gm, " "); a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm, "$1 $2"); a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm, "$1 $2"); a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([^\s])/gm, "$1 $2"); a = a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm, "$1 $2"); a = a.replace(/([0-9])([+\-])/gm, "$1 $2"); a = a.replace(/(\.[0-9]*)(\.)/gm, "$1 $2"); a = a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm, "$1 $3 $4 "); a = a.replace(/[\s\r\t\n]+/gm, " "); a = a.replace(/^\s+|\s+$/g, ""); for (var l = a.split(" "), m = -1, n = "", p = "", q = new z(0, 0), r = new z(0, 0), s = new z(0, 0), u = l.length, t = w.s(), x = !1, v = !1, A = !0, y = null; !(m >= u - 1);)if (p = n, n = d(), "" !== n) switch (n.toUpperCase()) { case "X": A = !0; v = x = !1; break; case "M": y = f(); null === t.Xb || !0 === A ? (M(t, y.x, y.y, x, !1, !v), A = !1) : t.moveTo(y.x, y.y); for (q = s; !c();)y = f(), t.lineTo(y.x, y.y); break; case "L": for (; !c();)y = f(), t.lineTo(y.x, y.y); break; case "H": for (; !c();)s = y = new z((n === n.toLowerCase() ? s.x : 0) + parseFloat(d()), s.y), t.lineTo(s.x, s.y); break; case "V": for (; !c();)s = y = new z(s.x, (n === n.toLowerCase() ? s.y : 0) + parseFloat(d())), t.lineTo(s.x, s.y); break; case "C": for (; !c();) { var K = e(), E = h(), y = f(); N(t, K.x, K.y, E.x, E.y, y.x, y.y) } break; case "S": for (; !c();)K = k(), E = h(), y = f(), N(t, K.x, K.y, E.x, E.y, y.x, y.y); break; case "Q": for (; !c();)E = h(), y = f(), Ue(t, E.x, E.y, y.x, y.y); break; case "T": for (; !c();)r = E = k(), y = f(), Ue(t, E.x, E.y, y.x, y.y); break; case "B": for (; !c();) { var y = parseFloat(d()), K = parseFloat(d()), E = parseFloat(d()), Q = parseFloat(d()), X = parseFloat(d()), O = X, aa = !1; c() || (O = parseFloat(d()), c() || (aa = 0 !== parseFloat(d()))); n === n.toLowerCase() && (E += s.x, Q += s.y); t.arcTo(y, K, E, Q, X, O, aa) } break; case "A": for (; !c();)K = Math.abs(parseFloat(d())), E = Math.abs(parseFloat(d())), Q = parseFloat(d()), X = !!parseFloat(d()), O = !!parseFloat(d()), y = f(), Ve(t, K, E, Q, X, O, y.x, y.y); break; case "Z": y = t.o.fc.n[t.o.fc.length - 1]; P(t); s = q; break; case "F": y = ""; for (K = 1; l[m + K];)if (null !== l[m + K].match(/[Uu]/)) K++; else if (null === l[m + K].match(/[A-Za-z]/)) K++; else { y = l[m + K]; break } y.match(/[Mm]/) ? x = !0 : We(t); break; case "U": y = ""; for (K = 1; l[m + K];)if (null !== l[m + K].match(/[Ff]/)) K++; else if (null === l[m + K].match(/[A-Za-z]/)) K++; else { y = l[m + K]; break } y.match(/[Mm]/) ? v = !0 : t.bb(!1) }q = t.o; w.q(t); if (b) for (t = q.fc.i; t.next();)y = t.value, y.fu = !0; return q }; function Xe(a, b) { for (var c = a.length, d = w.K(), e = 0; e < c; e++) { var f = a[e]; d.x = f[0]; d.y = f[1]; b.nb(d); f[0] = d.x; f[1] = d.y; d.x = f[2]; d.y = f[3]; b.nb(d); f[2] = d.x; f[3] = d.y; d.x = f[4]; d.y = f[5]; b.nb(d); f[4] = d.x; f[5] = d.y; d.x = f[6]; d.y = f[7]; b.nb(d); f[6] = d.x; f[7] = d.y } w.v(d) } Ce.prototype.Ax = function () { if (this.fb || this.zv !== this.fc.F) return !0; for (var a = this.fc.n, b = a.length, c = 0; c < b; c++)if (a[c].Ax()) return !0; return !1 }; Ce.prototype.sy = function () { this.fb = !1; this.Iq = this.lo = null; this.Jq = NaN; this.zv = this.fc.F; for (var a = this.fc.n, b = a.length, c = 0; c < b; c++)a[c].sy() }; Ce.prototype.uh = function () { var a = this.jv; a.Qa(); isNaN(this.Po) || isNaN(this.No) ? a.m(0, 0, 0, 0) : a.m(0, 0, this.Po, this.No); Ye(this, a, !1); $a(a, 0, 0, 0, 0); a.freeze() }; Ce.prototype.computeBoundsWithoutOrigin = Ce.prototype.xH = function () { var a = new B; Ye(this, a, !0); return a }; function Ye(a, b, c) { switch (a.type) { case Ge: case He: case Pe: c ? b.m(a.zc, a.Ic, 0, 0) : $a(b, a.zc, a.Ic, 0, 0); $a(b, a.yb, a.Gb, 0, 0); break; case De: var d = a.fc; a = d.n; for (var d = d.length, e = 0; e < d; e++) { var f = a[e]; c && 0 === e ? b.m(f.ha, f.fa, 0, 0) : $a(b, f.ha, f.fa, 0, 0); for (var h = f.vb.n, k = h.length, l = f.ha, m = f.fa, n = 0; n < k; n++) { var p = h[n]; switch (p.type) { case Re: case pf: l = p.C; m = p.D; $a(b, l, m, 0, 0); break; case qf: Yd(l, m, p.uc, p.Qc, p.Dh, p.Eh, p.C, p.D, .5, b); l = p.C; m = p.D; break; case rf: he(l, m, p.uc, p.Qc, p.C, p.D, .5, b); l = p.C; m = p.D; break; case sf: case tf: var q = p.type === sf ? uf(p, f) : vf(p, f, l, m), r = q.length; if (0 === r) { l = p.ka; m = p.ra; $a(b, l, m, 0, 0); break } for (var p = null, s = 0; s < r; s++)p = q[s], Yd(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], .5, b); null !== p && (l = p[6], m = p[7]); break; default: w.k("Unknown Segment type: " + p.type) } } } break; default: w.k("Unknown Geometry type: " + a.type) } } Ce.prototype.normalize = Ce.prototype.normalize = function () { this.Q && w.la(this); var a = this.xH(); this.offset(-a.x, -a.y); return new z(-a.x, -a.y) }; Ce.prototype.offset = Ce.prototype.offset = function (a, b) { this.Q && w.la(this); this.transform(1, 0, 0, 1, a, b); return this }; Ce.prototype.scale = Ce.prototype.scale = function (a, b) { this.Q && w.la(this); this.transform(a, 0, 0, b, 0, 0); return this }; Ce.prototype.rotate = Ce.prototype.rotate = function (a, b, c) { this.Q && w.la(this); void 0 === b && (b = 0); void 0 === c && (c = 0); var d = w.Jf(); d.reset(); d.rotate(a, b, c); this.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy); w.we(d); return this }; Ce.prototype.transform = Ce.prototype.transform = function (a, b, c, d, e, f) { var h = 0, k = 0; switch (this.type) { case Ge: case He: case Pe: h = this.zc; k = this.Ic; this.zc = h * a + k * c + e; this.Ic = h * b + k * d + f; h = this.yb; k = this.Gb; this.yb = h * a + k * c + e; this.Gb = h * b + k * d + f; break; case De: for (var l = this.fc.n, m = l.length, n = 0; n < m; n++) { var p = l[n], h = p.ha, k = p.fa; p.ha = h * a + k * c + e; p.fa = h * b + k * d + f; for (var p = p.vb.n, q = p.length, r = 0; r < q; r++) { var s = p[r]; switch (s.type) { case Re: case pf: h = s.C; k = s.D; s.C = h * a + k * c + e; s.D = h * b + k * d + f; break; case qf: h = s.uc; k = s.Qc; s.uc = h * a + k * c + e; s.Qc = h * b + k * d + f; h = s.Dh; k = s.Eh; s.Dh = h * a + k * c + e; s.Eh = h * b + k * d + f; h = s.C; k = s.D; s.C = h * a + k * c + e; s.D = h * b + k * d + f; break; case rf: h = s.uc; k = s.Qc; s.uc = h * a + k * c + e; s.Qc = h * b + k * d + f; h = s.C; k = s.D; s.C = h * a + k * c + e; s.D = h * b + k * d + f; break; case sf: h = s.ka; k = s.ra; s.ka = h * a + k * c + e; s.ra = h * b + k * d + f; 0 !== b && (h = 180 * Math.atan2(b, a) / Math.PI, 0 > h && (h += 360), s.ze += h); 0 > a && (s.ze = 180 - s.ze, s.of = -s.of); 0 > d && (s.ze = -s.ze, s.of = -s.of); s.radiusX *= Math.sqrt(a * a + c * c); void 0 !== s.radiusY && (s.radiusY *= Math.sqrt(b * b + d * d)); break; case tf: h = s.C; k = s.D; s.C = h * a + k * c + e; s.D = h * b + k * d + f; 0 !== b && (h = 180 * Math.atan2(b, a) / Math.PI, 0 > h && (h += 360), s.Gj += h); 0 > a && (s.Gj = 180 - s.Gj, s.Yl = !s.Yl); 0 > d && (s.Gj = -s.Gj, s.Yl = !s.Yl); s.radiusX *= Math.sqrt(a * a + c * c); s.radiusY *= Math.sqrt(b * b + d * d); break; default: w.k("Unknown Segment type: " + s.type) } } } }this.fb = !0; return this }; Ce.prototype.Ia = function (a, b, c, d) { var e = a.x, f = a.y, h = this.gb.x - 20; a = a.y; for (var k = 0, l = 0, m = 0, n = 0, p = 0, q = 0, r = this.fc.n, s = r.length, u = 0; u < s; u++) { var t = r[u]; if (t.fu) { if (c && t.Ia(e, f, b)) return !0; for (var x = t.vb, l = t.ha, m = t.fa, v = l, A = m, y = x.n, K = 0; K <= x.length; K++) { var E, Q; K !== x.length ? (E = y[K], Q = E.type, p = E.C, q = E.D) : (Q = Re, p = v, q = A); switch (Q) { case pf: n = wf(e, f, h, a, l, m, v, A); if (isNaN(n)) return !0; k += n; v = p; A = q; break; case Re: n = wf(e, f, h, a, l, m, p, q); if (isNaN(n)) return !0; k += n; break; case qf: n = ke(l, m, E.uc, E.Qc, E.Dh, E.Eh, p, q, h, a, e, f, .5); k += n; break; case rf: n = ke(l, m, (l + 2 * E.uc) / 3, (m + 2 * E.Qc) / 3, (2 * E.uc + p) / 3, (2 * E.Qc + q) / 3, p, q, h, a, e, f, .5); k += n; break; case sf: case tf: Q = E.type === sf ? uf(E, t) : vf(E, t, l, m); var X = Q.length; if (0 === X) { n = wf(e, f, h, a, l, m, E.ka, E.ra); if (isNaN(n)) return !0; k += n; break } for (var O = null, aa = 0; aa < X; aa++) { O = Q[aa]; if (0 === aa) { n = wf(e, f, h, a, l, m, O[0], O[1]); if (isNaN(n)) return !0; k += n } n = ke(O[0], O[1], O[2], O[3], O[4], O[5], O[6], O[7], h, a, e, f, .5); k += n } null !== O && (p = O[6], q = O[7]); break; default: w.k("Unknown Segment type: " + E.type) }l = p; m = q } if (0 !== k) return !0; k = 0 } else if (t.Ia(e, f, d ? b : b + 2)) return !0 } return 0 !== k }; function wf(a, b, c, d, e, f, h, k) { if (Wd(e, f, h, k, .05, a, b)) return NaN; var l = (a - c) * (f - k); if (0 === l) return 0; var m = ((a * d - b * c) * (e - h) - (a - c) * (e * k - f * h)) / l; b = (a * d - b * c) * (f - k) / l; if (m >= a) return 0; if ((e > h ? e - h : h - e) < (f > k ? f - k : k - f)) { if (e = a = 0, f < k ? (a = f, e = k) : (a = k, e = f), b < a || b > e) return 0 } else if (e < h ? (a = e, e = h) : a = h, m < a || m > e) return 0; return 0 < l ? 1 : -1 } function xf(a, b, c, d) { a = a.fc.n; for (var e = a.length, f = 0; f < e; f++)if (a[f].Ia(b, c, d)) return !0; return !1 } Ce.prototype.getPointAlongPath = Ce.prototype.cI = function (a, b) { 0 > a ? a = 0 : 1 < a && (a = 1); void 0 === b && (b = new z); if (this.type === Ge) return b.m(this.ha + a * (this.C - this.ha), this.fa + a * (this.D - this.fa)), b; for (var c = this.qx, d = this.Qt, e = c.length, f = this.Rt * a, h = 0, k = 0; k < e; k++)for (var l = d[k], m = l.length, n = 0; n < m; n++) { var p = l[n]; if (h + p >= f) return d = (f - h) / p, c = c[k], k = c[2 * n], e = c[2 * n + 1], b.m(k + (c[2 * n + 2] - k) * d, e + (c[2 * n + 3] - e) * d), b; h += p } b.m(NaN, NaN); return b }; Ce.prototype.getAngleAlongPath = Ce.prototype.VE = function (a) { 0 > a ? a = 0 : 1 < a && (a = 1); var b = 0; if (this.type === Ge) return b = 180 * Math.atan2(this.D - this.fa, this.C - this.ha) / Math.PI; for (var b = this.qx, c = this.Qt, d = b.length, e = this.Rt * a, f = 0, h = 0; h < d; h++) { var k = c[h], l = k.length; for (a = 0; a < l; a++) { var m = k[a]; if (f + m >= e) return b = b[h], b = 180 * Math.atan2(b[2 * a + 3] - b[2 * a + 1], b[2 * a + 2] - b[2 * a]) / Math.PI; f += m } } return NaN }; Ce.prototype.getFractionForPoint = Ce.prototype.ZH = function (a) { if (this.type === Ge) { var b = this.ha, c = this.fa, d = this.C, e = this.D; if (b !== d || c !== e) { var f = a.x; a = a.y; var h = 0, k = 0; return b === d ? (c < e ? (h = c, k = e) : (h = e, k = c), a <= h ? h === c ? 0 : 1 : a >= k ? k === c ? 0 : 1 : Math.abs(a - c) / (k - h)) : c === e ? (b < d ? (h = b, k = d) : (h = d, k = b), f <= h ? h === b ? 0 : 1 : f >= k ? k === b ? 0 : 1 : Math.abs(f - b) / (k - h)) : ((f - b) * (f - b) + (a - c) * (a - c)) / ((d - b) * (d - b) + (e - c) * (e - c)) } } else if (this.type === He) { if (b = this.ha, c = this.fa, d = this.C, e = this.D, b !== d || c !== e) { var h = d - b, k = e - c, l = 2 * h + 2 * k, f = a.x; a = a.y; f = Math.min(Math.max(f, b), d); a = Math.min(Math.max(a, c), e); var b = Math.abs(f - b), d = Math.abs(f - d), c = Math.abs(a - c), e = Math.abs(a - e), m = Math.min(b, d, c, e); if (m === c) return f / l; if (m === d) return (h + a) / l; if (m === e) return (2 * h + k - f) / l; if (m === b) return (2 * h + 2 * k - a) / l } } else { for (var e = this.qx, h = this.Qt, k = this.Rt, l = w.K(), c = Infinity, b = d = 0, f = e.length, n = m = 0, p = 0; p < f; p++)for (var q = e[p], r = h[p], s = q.length, u = 0; u < s; u += 2) { var t = q[u], x = q[u + 1]; if (0 !== u) { Ia(m, n, t, x, a.x, a.y, l); var v = (l.x - a.x) * (l.x - a.x) + (l.y - a.y) * (l.y - a.y); v < c && (c = v, d = b, d += Math.sqrt((l.x - m) * (l.x - m) + (l.y - n) * (l.y - n))); b += r[(u - 2) / 2] } m = t; n = x } w.v(l); a = d / k; return 0 > a ? 0 : 1 < a ? 1 : a } return 0 }; w.u(Ce, { qx: null }, function () { yf(this); return this.lo }); function yf(a) { if (null === a.lo) { a.Ax() && a.sy(); var b = a.lo = [], c = a.Iq = [], d = [], e = []; if (a.type === Ge) d.push(a.ha), d.push(a.fa), d.push(a.C), d.push(a.D), b.push(d), e.push(Math.sqrt((a.ha - a.C) * (a.ha - a.C) + (a.fa - a.D) * (a.fa - a.D))), c.push(e); else if (a.type === He) d.push(a.ha), d.push(a.fa), d.push(a.C), d.push(a.fa), d.push(a.C), d.push(a.D), d.push(a.ha), d.push(a.D), d.push(a.ha), d.push(a.fa), b.push(d), e.push(Math.abs(a.ha - a.C)), e.push(Math.abs(a.fa - a.D)), e.push(Math.abs(a.ha - a.C)), e.push(Math.abs(a.fa - a.D)), c.push(e); else if (a.type === Pe) { var f = new Ee; f.ha = a.C; f.fa = (a.fa + a.D) / 2; var h = new zf(sf); h.ze = 0; h.of = 360; h.ka = (a.ha + a.C) / 2; h.ra = (a.fa + a.D) / 2; h.radiusX = Math.abs(a.ha - a.C) / 2; h.radiusY = Math.abs(a.fa - a.D) / 2; f.add(h); a = uf(h, f); e = a.length; if (0 === e) d.push(h.ka), d.push(h.ra); else for (var h = f.ha, f = f.fa, k = 0; k < e; k++) { var l = a[k]; Zd(h, f, l[2], l[3], l[4], l[5], l[6], l[7], .5, d); h = l[6]; f = l[7] } b.push(d); c.push(Af(d)) } else for (var m = a.fc.i; m.next();) { var n = m.value, d = []; d.push(n.ha); d.push(n.fa); for (var h = n.ha, f = n.fa, p = h, q = f, r = n.vb.n, s = r.length, u = 0; u < s; u++) { var t = r[u]; switch (t.ma) { case pf: 4 <= d.length && (b.push(d), c.push(Af(d))); d = []; d.push(t.C); d.push(t.D); h = t.C; f = t.D; p = h; q = f; break; case Re: d.push(t.C); d.push(t.D); h = t.C; f = t.D; break; case qf: Zd(h, f, t.Ed, t.Xe, t.oh, t.Dg, t.yb, t.Gb, .5, d); h = t.C; f = t.D; break; case rf: ie(h, f, t.Ed, t.Xe, t.yb, t.Gb, .5, d); h = t.C; f = t.D; break; case sf: a = uf(t, n); e = a.length; if (0 === e) { d.push(t.ka); d.push(t.ra); h = t.ka; f = t.ra; break } for (k = 0; k < e; k++)l = a[k], Zd(h, f, l[2], l[3], l[4], l[5], l[6], l[7], .5, d), h = l[6], f = l[7]; break; case tf: a = vf(t, n, h, f); e = a.length; if (0 === e) { d.push(t.ka); d.push(t.ra); h = t.ka; f = t.ra; break } for (k = 0; k < e; k++)l = a[k], Zd(h, f, l[2], l[3], l[4], l[5], l[6], l[7], .5, d), h = l[6], f = l[7]; break; default: w.k("Segment not of valid type: " + t.ma) }t.Th && (d.push(p), d.push(q)) } 4 <= d.length && (b.push(d), c.push(Af(d))) } } } w.u(Ce, { Qt: null }, function () { yf(this); return this.Iq }); w.u(Ce, { Rt: null }, function () { var a = this.Jq; if (isNaN(a)) { if (this.type === Ge) var a = Math.abs(this.C - this.ha), b = Math.abs(this.D - this.fa), a = Math.sqrt(a * a + b * b); else if (this.type === He) a = Math.abs(this.C - this.ha), b = Math.abs(this.D - this.fa), a = 2 * a + 2 * b; else for (var b = this.Qt, c = b.length, d = a = 0; d < c; d++)for (var e = b[d], f = e.length, h = 0; h < f; h++)a += e[h]; this.Jq = a } return a }); function Af(a) { for (var b = [], c = 0, d = 0, e = a.length, f = 0; f < e; f += 2) { var h = a[f], k = a[f + 1]; 0 !== f && (c = Math.sqrt(Na(c, d, h, k)), b.push(c)); c = h; d = k } return b } w.defineProperty(Ce, { type: "type" }, function () { return this.ma }, function (a) { this.ma !== a && (this.Q && w.la(this, a), this.ma = a, this.fb = !0) }); w.defineProperty(Ce, { ha: "startX" }, function () { return this.zc }, function (a) { this.zc !== a && (this.Q && w.la(this, a), this.zc = a, this.fb = !0) }); w.defineProperty(Ce, { fa: "startY" }, function () { return this.Ic }, function (a) { this.Ic !== a && (this.Q && w.la(this, a), this.Ic = a, this.fb = !0) }); w.defineProperty(Ce, { C: "endX" }, function () { return this.yb }, function (a) { this.yb !== a && (this.Q && w.la(this, a), this.yb = a, this.fb = !0) }); w.defineProperty(Ce, { D: "endY" }, function () { return this.Gb }, function (a) { this.Gb !== a && (this.Q && w.la(this, a), this.Gb = a, this.fb = !0) }); w.defineProperty(Ce, { fc: "figures" }, function () { return this.Nj }, function (a) { this.Nj !== a && (this.Q && w.la(this, a), this.Nj = a, this.fb = !0) }); Ce.prototype.add = Ce.prototype.add = function (a) { this.Nj.add(a); return this }; Ce.prototype.setSpots = function (a, b, c, d, e, f, h, k) { this.Q && w.la(this); this.hi = (new L(a, b, e, f)).freeze(); this.ii = (new L(c, d, h, k)).freeze(); return this }; w.defineProperty(Ce, { A: "spot1" }, function () { return this.hi }, function (a) { this.Q && w.la(this, a); this.hi = a.S() }); w.defineProperty(Ce, { B: "spot2" }, function () { return this.ii }, function (a) { this.Q && w.la(this, a); this.ii = a.S() }); w.defineProperty(Ce, { be: "defaultStretch" }, function () { return this.Fi }, function (a) { this.Q && w.la(this, a); this.Fi = a }); w.u(Ce, { gb: "bounds" }, function () { this.Ax() && (this.sy(), this.uh()); return this.jv }); function Ee(a, b, c, d) { w.nc(this); this.Q = !1; void 0 === c && (c = !0); this.Cm = c; void 0 === d && (d = !0); this.Qo = d; this.zc = void 0 !== a ? a : 0; this.Ic = void 0 !== b ? b : 0; this.lp = new H(zf); this.yw = this.lp.F; this.fb = !0 } w.ga("PathFigure", Ee); w.ni(Ee); Ee.prototype.copy = function () { var a = new Ee; a.Cm = this.Cm; a.Qo = this.Qo; a.zc = this.zc; a.Ic = this.Ic; for (var b = this.lp.n, c = b.length, d = a.lp, e = 0; e < c; e++) { var f = b[e].copy(); d.add(f) } a.yw = this.yw; a.fb = this.fb; return a }; Ee.prototype.equalsApprox = Ee.prototype.Kc = function (a) { if (!(a instanceof Ee && J(this.ha, a.ha) && J(this.fa, a.fa))) return !1; var b = this.vb.n; a = a.vb.n; var c = b.length; if (c !== a.length) return !1; for (var d = 0; d < c; d++)if (!b[d].Kc(a[d])) return !1; return !0 }; g = Ee.prototype; g.toString = function (a) { void 0 === a && (a = -1); for (var b = 0 > a ? "M" + this.ha.toString() + " " + this.fa.toString() : "M" + this.ha.toFixed(a) + " " + this.fa.toFixed(a), c = this.vb.n, d = c.length, e = 0; e < d; e++)b += " " + c[e].toString(a); return b }; g.freeze = function () { this.Q = !0; var a = this.vb; a.freeze(); for (var b = a.n, a = a.length, c = 0; c < a; c++)b[c].freeze(); return this }; g.Qa = function () { this.Q = !1; var a = this.vb; a.Qa(); for (var a = a.n, b = a.length, c = 0; c < b; c++)a[c].Qa(); return this }; g.Ax = function () { if (this.fb) return !0; var a = this.vb; if (this.yw !== a.F) return !0; for (var a = a.n, b = a.length, c = 0; c < b; c++)if (a[c].fb) return !0; return !1 }; g.sy = function () { this.fb = !1; var a = this.vb; this.yw = a.F; for (var a = a.n, b = a.length, c = 0; c < b; c++) { var d = a[c]; d.fb = !1; d.ng = null } }; w.defineProperty(Ee, { fu: "isFilled" }, function () { return this.Cm }, function (a) { this.Q && w.la(this, a); this.Cm = a }); w.defineProperty(Ee, { am: "isShadowed" }, function () { return this.Qo }, function (a) { this.Q && w.la(this, a); this.Qo = a }); w.defineProperty(Ee, { ha: "startX" }, function () { return this.zc }, function (a) { this.Q && w.la(this, a); this.zc = a; this.fb = !0 }); w.defineProperty(Ee, { fa: "startY" }, function () { return this.Ic }, function (a) { this.Q && w.la(this, a); this.Ic = a; this.fb = !0 }); w.defineProperty(Ee, { vb: "segments" }, function () { return this.lp }, function (a) { this.Q && w.la(this, a); this.lp = a; this.fb = !0 }); Ee.prototype.add = Ee.prototype.add = function (a) { this.lp.add(a); return this }; Ee.prototype.Ia = function (a, b, c) { for (var d = this.ha, e = this.fa, f = d, h = e, k = this.vb.n, l = k.length, m = 0; m < l; m++) { var n = k[m]; switch (n.type) { case pf: f = n.C; h = n.D; d = n.C; e = n.D; break; case Re: if (Wd(d, e, n.C, n.D, c, a, b)) return !0; d = n.C; e = n.D; break; case qf: if (Xd(d, e, n.uc, n.Qc, n.Dh, n.Eh, n.C, n.D, .5, a, b, c)) return !0; d = n.C; e = n.D; break; case rf: if (ge(d, e, n.uc, n.Qc, n.C, n.D, .5, a, b, c)) return !0; d = n.C; e = n.D; break; case sf: case tf: var p = n.type === sf ? uf(n, this) : vf(n, this, d, e), q = p.length; if (0 === q) { if (Wd(d, e, n.ka, n.ra, c, a, b)) return !0; d = n.ka; e = n.ra; break } for (var r = null, s = 0; s < q; s++)if (r = p[s], 0 === s && Wd(d, e, r[0], r[1], c, a, b) || Xd(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], .5, a, b, c)) return !0; null !== r && (d = r[6], e = r[7]); break; default: w.k("Unknown Segment type: " + n.type) }if (n.xx && (d !== f || e !== h) && Wd(d, e, f, h, c, a, b)) return !0 } return !1 }; function zf(a, b, c, d, e, f, h, k) { w.nc(this); this.Q = !1; void 0 === a && (a = Re); this.ma = a; this.yb = void 0 !== b ? b : 0; this.Gb = void 0 !== c ? c : 0; void 0 === d && (d = 0); void 0 === e && (e = 0); void 0 === f && (f = 0); void 0 === h && (h = 0); a === tf ? (a = f % 360, 0 > a && (a += 360), this.Ed = a, this.Xe = 0, this.oh = Math.max(d, 0), this.Dg = Math.max(e, 0), this.Vo = "boolean" === typeof h ? !!h : !1, this.po = !!k) : (this.Ed = d, this.Xe = e, a === sf && (f = Math.max(f, 0)), this.oh = f, "number" === typeof h ? (a === sf && (h = Math.max(h, 0)), this.Dg = h) : this.Dg = 0, this.po = this.Vo = !1); this.Th = !1; this.fb = !0; this.ng = null } w.ga("PathSegment", zf); w.ni(zf); zf.prototype.copy = function () { var a = new zf; a.ma = this.ma; a.yb = this.yb; a.Gb = this.Gb; a.Ed = this.Ed; a.Xe = this.Xe; a.oh = this.oh; a.Dg = this.Dg; a.Vo = this.Vo; a.po = this.po; a.Th = this.Th; a.fb = this.fb; return a }; zf.prototype.equalsApprox = zf.prototype.Kc = function (a) { if (!(a instanceof zf) || this.type !== a.type || this.xx !== a.xx) return !1; switch (this.type) { case pf: case Re: return J(this.C, a.C) && J(this.D, a.D); case qf: return J(this.C, a.C) && J(this.D, a.D) && J(this.uc, a.uc) && J(this.Qc, a.Qc) && J(this.Dh, a.Dh) && J(this.Eh, a.Eh); case rf: return J(this.C, a.C) && J(this.D, a.D) && J(this.uc, a.uc) && J(this.Qc, a.Qc); case sf: return J(this.ze, a.ze) && J(this.of, a.of) && J(this.ka, a.ka) && J(this.ra, a.ra) && J(this.radiusX, a.radiusX) && J(this.radiusY, a.radiusY); case tf: return this.Yl === a.Yl && this.Bx === a.Bx && J(this.Gj, a.Gj) && J(this.C, a.C) && J(this.D, a.D) && J(this.radiusX, a.radiusX) && J(this.radiusY, a.radiusY); default: return !1 } }; zf.prototype.ic = function (a) { a.Ee === zf ? this.type = a : w.Ej(this, a) }; zf.prototype.toString = function (a) { void 0 === a && (a = -1); var b = ""; switch (this.type) { case pf: b = 0 > a ? "M" + this.C.toString() + " " + this.D.toString() : "M" + this.C.toFixed(a) + " " + this.D.toFixed(a); break; case Re: b = 0 > a ? "L" + this.C.toString() + " " + this.D.toString() : "L" + this.C.toFixed(a) + " " + this.D.toFixed(a); break; case qf: b = 0 > a ? "C" + this.uc.toString() + " " + this.Qc.toString() + " " + this.Dh.toString() + " " + this.Eh.toString() + " " + this.C.toString() + " " + this.D.toString() : "C" + this.uc.toFixed(a) + " " + this.Qc.toFixed(a) + " " + this.Dh.toFixed(a) + " " + this.Eh.toFixed(a) + " " + this.C.toFixed(a) + " " + this.D.toFixed(a); break; case rf: b = 0 > a ? "Q" + this.uc.toString() + " " + this.Qc.toString() + " " + this.C.toString() + " " + this.D.toString() : "Q" + this.uc.toFixed(a) + " " + this.Qc.toFixed(a) + " " + this.C.toFixed(a) + " " + this.D.toFixed(a); break; case sf: b = 0 > a ? "B" + this.ze.toString() + " " + this.of.toString() + " " + this.ka.toString() + " " + this.ra.toString() + " " + this.radiusX : "B" + this.ze.toFixed(a) + " " + this.of.toFixed(a) + " " + this.ka.toFixed(a) + " " + this.ra.toFixed(a) + " " + this.radiusX; break; case tf: b = 0 > a ? "A" + this.radiusX.toString() + " " + this.radiusY.toString() + " " + this.Gj.toString() + " " + (this.Bx ? 1 : 0) + " " + (this.Yl ? 1 : 0) + " " + this.C.toString() + " " + this.D.toString() : "A" + this.radiusX.toFixed(a) + " " + this.radiusY.toFixed(a) + " " + this.Gj.toFixed(a) + " " + (this.Bx ? 1 : 0) + " " + (this.Yl ? 1 : 0) + " " + this.C.toFixed(a) + " " + this.D.toFixed(a); break; default: b = this.type.toString() }return b + (this.Th ? "z" : "") }; var pf; zf.Move = pf = w.p(zf, "Move", 0); var Re; zf.Line = Re = w.p(zf, "Line", 1); var qf; zf.Bezier = qf = w.p(zf, "Bezier", 2); var rf; zf.QuadraticBezier = rf = w.p(zf, "QuadraticBezier", 3); var sf; zf.Arc = sf = w.p(zf, "Arc", 4); var tf; zf.SvgArc = tf = w.p(zf, "SvgArc", 4); zf.prototype.freeze = function () { this.Q = !0; return this }; zf.prototype.Qa = function () { this.Q = !1; return this }; zf.prototype.close = zf.prototype.close = function () { this.Th = !0; return this }; function uf(a, b) { if (null !== a.ng && !1 === b.fb) return a.ng; var c = a.radiusX, d = a.radiusY; void 0 === d && (d = c); if (0 === c || 0 === d) return a.ng = [], a.ng; var e = a.Ed, f = a.Xe, h = ze(c < d ? c : d, a.ze, a.ze + a.of, !1); if (c !== d) { var k = w.Jf(); k.reset(); c < d ? k.scale(1, d / c) : k.scale(c / d, 1); Xe(h, k); w.we(k) } c = h.length; for (d = 0; d < c; d++)k = h[d], k[0] += e, k[1] += f, k[2] += e, k[3] += f, k[4] += e, k[5] += f, k[6] += e, k[7] += f; a.ng = h; return a.ng } function vf(a, b, c, d) { function e(a, b, c, d) { return (a * d < b * c ? -1 : 1) * Math.acos((a * c + b * d) / (Math.sqrt(a * a + b * b) * Math.sqrt(c * c + d * d))) } if (null !== a.ng && !1 === b.fb) return a.ng; b = a.oh; var f = a.Dg; if (0 === b || 0 === f) return a.ng = [], a.ng; var h = Math.PI / 180 * a.Ed, k = a.Vo, l = a.po, m = a.yb, n = a.Gb, p = Math.cos(h), q = Math.sin(h), r = p * (c - m) / 2 + q * (d - n) / 2, h = -q * (c - m) / 2 + p * (d - n) / 2, s = r * r / (b * b) + h * h / (f * f); 1 < s && (b *= Math.sqrt(s), f *= Math.sqrt(s)); s = (k === l ? -1 : 1) * Math.sqrt((b * b * f * f - b * b * h * h - f * f * r * r) / (b * b * h * h + f * f * r * r)); isNaN(s) && (s = 0); k = s * b * h / f; s = s * -f * r / b; isNaN(k) && (k = 0); isNaN(s) && (s = 0); c = (c + m) / 2 + p * k - q * s; d = (d + n) / 2 + q * k + p * s; n = e(1, 0, (r - k) / b, (h - s) / f); p = (r - k) / b; m = (h - s) / f; r = (-r - k) / b; k = (-h - s) / f; h = e(p, m, r, k); r = (p * r + m * k) / (Math.sqrt(p * p + m * m) * Math.sqrt(r * r + k * k)); -1 >= r ? h = Math.PI : 1 <= r && (h = 0); !l && 0 < h && (h -= 2 * Math.PI); l && 0 > h && (h += 2 * Math.PI); l = b > f ? 1 : b / f; r = b > f ? f / b : 1; b = ze(b > f ? b : f, n, n + h, !0); f = w.Jf(); f.reset(); f.translate(c, d); f.rotate(a.Ed, 0, 0); f.scale(l, r); Xe(b, f); w.we(f); a.ng = b; return a.ng } w.defineProperty(zf, { xx: "isClosed" }, function () { return this.Th }, function (a) { this.Th !== a && (this.Th = a, this.fb = !0) }); w.defineProperty(zf, { type: "type" }, function () { return this.ma }, function (a) { this.Q && w.la(this, a); this.ma = a; this.fb = !0 }); w.defineProperty(zf, { C: "endX" }, function () { return this.yb }, function (a) { this.Q && w.la(this, a); this.yb = a; this.fb = !0 }); w.defineProperty(zf, { D: "endY" }, function () { return this.Gb }, function (a) { this.Q && w.la(this, a); this.Gb = a; this.fb = !0 }); w.defineProperty(zf, { uc: "point1X" }, function () { return this.Ed }, function (a) { this.Q && w.la(this, a); this.Ed = a; this.fb = !0 }); w.defineProperty(zf, { Qc: "point1Y" }, function () { return this.Xe }, function (a) { this.Q && w.la(this, a); this.Xe = a; this.fb = !0 }); w.defineProperty(zf, { Dh: "point2X" }, function () { return this.oh }, function (a) { this.Q && w.la(this, a); this.oh = a; this.fb = !0 }); w.defineProperty(zf, { Eh: "point2Y" }, function () { return this.Dg }, function (a) { this.Q && w.la(this, a); this.Dg = a; this.fb = !0 }); w.defineProperty(zf, { ka: "centerX" }, function () { return this.Ed }, function (a) { this.Q && w.la(this, a); this.Ed = a; this.fb = !0 }); w.defineProperty(zf, { ra: "centerY" }, function () { return this.Xe }, function (a) { this.Q && w.la(this, a); this.Xe = a; this.fb = !0 }); w.defineProperty(zf, { radiusX: "radiusX" }, function () { return this.oh }, function (a) { 0 > a && w.Fa(a, ">= zero", zf, "radiusX"); this.Q && w.la(this, a); this.oh = a; this.fb = !0 }); w.defineProperty(zf, { radiusY: "radiusY" }, function () { return this.Dg }, function (a) { 0 > a && w.Fa(a, ">= zero", zf, "radiusY"); this.Q && w.la(this, a); this.Dg = a; this.fb = !0 }); w.defineProperty(zf, { ze: "startAngle" }, function () { return this.yb }, function (a) { this.yb !== a && (this.Q && w.la(this, a), a %= 360, 0 > a && (a += 360), this.yb = a, this.fb = !0) }); w.defineProperty(zf, { of: "sweepAngle" }, function () { return this.Gb }, function (a) { this.Q && w.la(this, a); 360 < a && (a = 360); -360 > a && (a = -360); this.Gb = a; this.fb = !0 }); w.defineProperty(zf, { Yl: "isClockwiseArc" }, function () { return this.po }, function (a) { this.Q && w.la(this, a); this.po = a; this.fb = !0 }); w.defineProperty(zf, { Bx: "isLargeArc" }, function () { return this.Vo }, function (a) { this.Q && w.la(this, a); this.Vo = a; this.fb = !0 }); w.defineProperty(zf, { Gj: "xAxisRotation" }, function () { return this.Ed }, function (a) { a %= 360; 0 > a && (a += 360); this.Q && w.la(this, a); this.Ed = a; this.fb = !0 }); function Bf() { this.$ = null; this.Oz = (new z(0, 0)).freeze(); this.Vy = (new z(0, 0)).freeze(); this.gv = this.dw = 0; this.hv = 1; this.Tv = ""; this.Iw = this.vv = !1; this.sv = this.iv = 0; this.Ij = this.Ev = this.Pv = !1; this.vr = null; this.Gw = 0; this.Gg = this.Fw = null } w.ga("InputEvent", Bf); Bf.prototype.copy = function () { var a = new Bf; a.$ = this.$; a.Oz.assign(this.df); a.Vy.assign(this.da); a.dw = this.dw; a.gv = this.gv; a.hv = this.hv; a.Tv = this.Tv; a.vv = this.vv; a.Iw = this.Iw; a.iv = this.iv; a.sv = this.sv; a.Pv = this.Pv; a.Ev = this.Ev; a.Ij = this.Ij; a.vr = this.vr; a.Gw = this.Gw; a.Fw = this.Fw; a.Gg = this.Gg; return a }; Bf.prototype.toString = function () { var a = "^"; 0 !== this.zd && (a += "M:" + this.zd); 0 !== this.button && (a += "B:" + this.button); "" !== this.key && (a += "K:" + this.key); 0 !== this.Ge && (a += "C:" + this.Ge); 0 !== this.Ol && (a += "D:" + this.Ol); this.Cc && (a += "h"); this.bubbles && (a += "b"); null !== this.da && (a += "@" + this.da.toString()); return a }; w.defineProperty(Bf, { g: "diagram" }, function () { return this.$ }, function (a) { this.$ = a }); w.defineProperty(Bf, { df: "viewPoint" }, function () { return this.Oz }, function (a) { w.G(a, z, Bf, "viewPoint"); this.Oz.assign(a) }); w.defineProperty(Bf, { da: "documentPoint" }, function () { return this.Vy }, function (a) { w.G(a, z, Bf, "documentPoint"); this.Vy.assign(a) }); Bf.prototype.getMultiTouchViewPoint = Bf.prototype.tx = function (a, b) { var c = this.g; if (null === c) return b; Cf(c, this.event, a, b); return b }; Bf.prototype.getMultiTouchDocumentPoint = function (a, b) { var c = this.g; if (null === c) return b; Cf(c, this.event, a, b); b.assign(c.zB(b)); return b }; w.defineProperty(Bf, { zd: "modifiers" }, function () { return this.dw }, function (a) { this.dw = a }); w.defineProperty(Bf, { button: "button" }, function () { return this.gv }, function (a) { this.gv = a; if (null === this.event) switch (a) { case 0: this.buttons = 1; break; case 1: this.buttons = 4; break; case 2: this.buttons = 2 } }); w.defineProperty(Bf, { buttons: "buttons" }, function () { return this.hv }, function (a) { this.hv = a }); w.defineProperty(Bf, { key: "key" }, function () { return this.Tv }, function (a) { this.Tv = a }); w.defineProperty(Bf, { Pl: "down" }, function () { return this.vv }, function (a) { this.vv = a }); w.defineProperty(Bf, { up: "up" }, function () { return this.Iw }, function (a) { this.Iw = a }); w.defineProperty(Bf, { Ge: "clickCount" }, function () { return this.iv }, function (a) { this.iv = a }); w.defineProperty(Bf, { Ol: "delta" }, function () { return this.sv }, function (a) { this.sv = a }); w.defineProperty(Bf, { hu: "isMultiTouch" }, function () { return this.Pv }, function (a) { this.Pv = a }); w.defineProperty(Bf, { Cc: "handled" }, function () { return this.Ev }, function (a) { this.Ev = a }); w.defineProperty(Bf, { bubbles: "bubbles" }, function () { return this.Ij }, function (a) { this.Ij = a }); w.defineProperty(Bf, { event: "event" }, function () { return this.vr }, function (a) { this.vr = a }); w.u(Bf, { vj: "isTouchEvent" }, function () { var a = window.TouchEvent; return a && this.event instanceof a ? !0 : (a = window.PointerEvent) && this.event instanceof a && "touch" === this.event.pointerType }); w.u(Bf, { Gk: "isMac" }, function () { return w.Gk }); w.defineProperty(Bf, { timestamp: "timestamp" }, function () { return this.Gw }, function (a) { this.Gw = a }); w.defineProperty(Bf, { Yg: "targetDiagram" }, function () { return this.Fw }, function (a) { this.Fw = a }); w.defineProperty(Bf, { Qe: "targetObject" }, function () { return this.Gg }, function (a) { this.Gg = a }); w.defineProperty(Bf, { control: "control" }, function () { return 0 !== (this.zd & 1) }, function (a) { this.zd = a ? this.zd | 1 : this.zd & -2 }); w.defineProperty(Bf, { shift: "shift" }, function () { return 0 !== (this.zd & 4) }, function (a) { this.zd = a ? this.zd | 4 : this.zd & -5 }); w.defineProperty(Bf, { alt: "alt" }, function () { return 0 !== (this.zd & 2) }, function (a) { this.zd = a ? this.zd | 2 : this.zd & -3 }); w.defineProperty(Bf, { qu: "meta" }, function () { return 0 !== (this.zd & 8) }, function (a) { this.zd = a ? this.zd | 8 : this.zd & -9 }); w.defineProperty(Bf, { left: "left" }, function () { var a = this.event; return null !== a && a instanceof MouseEvent && ("mousedown" === a.type || "mouseup" === a.type) ? 0 === this.button : 0 !== (this.buttons & 1) }, function (a) { this.buttons = a ? this.buttons | 1 : this.buttons & -2 }); w.defineProperty(Bf, { right: "right" }, function () { var a = this.event; return null !== a && a instanceof MouseEvent && ("mousedown" === a.type || "mouseup" === a.type) ? 2 === this.button : 0 !== (this.buttons & 2) }, function (a) { this.buttons = a ? this.buttons | 2 : this.buttons & -3 }); w.defineProperty(Bf, { rL: "middle" }, function () { var a = this.event; return null !== a && a instanceof MouseEvent && ("mousedown" === a.type || "mouseup" === a.type) ? 1 === this.button : 0 !== (this.buttons & 4) }, function (a) { this.buttons = a ? this.buttons | 4 : this.buttons & -5 }); function Df() { this.$ = null; this.Sb = ""; this.mw = this.Dw = null; this.Qq = !1 } w.ga("DiagramEvent", Df); Df.prototype.copy = function () { var a = new Df; a.$ = this.$; a.Sb = this.Sb; a.Dw = this.Dw; a.mw = this.mw; a.Qq = this.Qq; return a }; Df.prototype.toString = function () { var a = "*" + this.name; null !== this.rB && (a += ":" + this.rB.toString()); null !== this.VA && (a += "(" + this.VA.toString() + ")"); return a }; w.defineProperty(Df, { g: "diagram" }, function () { return this.$ }, function (a) { this.$ = a }); w.defineProperty(Df, { name: "name" }, function () { return this.Sb }, function (a) { this.Sb = a }); w.defineProperty(Df, { rB: "subject" }, function () { return this.Dw }, function (a) { this.Dw = a }); w.defineProperty(Df, { VA: "parameter" }, function () { return this.mw }, function (a) { this.mw = a }); w.defineProperty(Df, { cancel: "cancel" }, function () { return this.Qq }, function (a) { this.Qq !== a && w.Ht("DiagramEvent.cancel", "2.0"); this.Qq = a }); function Ef() { this.Rq = Of; this.Um = this.cw = ""; this.rs = this.ss = this.ws = this.xs = this.vs = this.$ = this.me = null } w.ga("ChangedEvent", Ef); var Pf; Ef.Transaction = Pf = w.p(Ef, "Transaction", -1); var Of; Ef.Property = Of = w.p(Ef, "Property", 0); var Qf; Ef.Insert = Qf = w.p(Ef, "Insert", 1); var Rf; Ef.Remove = Rf = w.p(Ef, "Remove", 2); Ef.prototype.clear = Ef.prototype.clear = function () { this.rs = this.ss = this.ws = this.xs = this.vs = this.$ = this.me = null }; Ef.prototype.copy = function () { var a = new Ef; a.Rq = this.Rq; a.cw = this.cw; a.Um = this.Um; a.me = this.me; a.$ = this.$; a.vs = this.vs; var b = this.xs; a.xs = w.Pa(b) && "function" === typeof b.S ? b.S() : b; b = this.ws; a.ws = w.Pa(b) && "function" === typeof b.S ? b.S() : b; b = this.ss; a.ss = w.Pa(b) && "function" === typeof b.S ? b.S() : b; b = this.rs; a.rs = w.Pa(b) && "function" === typeof b.S ? b.S() : b; return a }; Ef.prototype.ic = function (a) { a.Ee === Ef ? this.Ac = a : w.Ej(this, a) }; Ef.prototype.toString = function () { var a = "", a = this.Ac === Pf ? a + "* " : this.Ac === Of ? a + (null !== this.ba ? "!m" : "!d") : a + ((null !== this.ba ? "!m" : "!d") + this.Ac); this.propertyName && "string" === typeof this.propertyName && (a += " " + this.propertyName); this.nf && this.nf !== this.propertyName && (a += " " + this.nf); a += ": "; this.Ac === Pf ? null !== this.oldValue && (a += " " + this.oldValue) : (null !== this.object && (a += Sf(this.object)), null !== this.oldValue && (a += " old: " + Sf(this.oldValue)), null !== this.Aj && (a += " " + this.Aj), null !== this.newValue && (a += " new: " + Sf(this.newValue)), null !== this.zj && (a += " " + this.zj)); return a }; Ef.prototype.getValue = Ef.prototype.ja = function (a) { return a ? this.oldValue : this.newValue }; Ef.prototype.getParam = function (a) { return a ? this.Aj : this.zj }; Ef.prototype.canUndo = Ef.prototype.canUndo = function () { return null !== this.ba || null !== this.g ? !0 : !1 }; Ef.prototype.undo = Ef.prototype.undo = function () { this.canUndo() && (null !== this.ba ? this.ba.on(this, !0) : null !== this.g && this.g.on(this, !0)) }; Ef.prototype.canRedo = Ef.prototype.canRedo = function () { return null !== this.ba || null !== this.g ? !0 : !1 }; Ef.prototype.redo = Ef.prototype.redo = function () { this.canRedo() && (null !== this.ba ? this.ba.on(this, !1) : null !== this.g && this.g.on(this, !1)) }; w.defineProperty(Ef, { ba: "model" }, function () { return this.me }, function (a) { this.me = a }); w.defineProperty(Ef, { g: "diagram" }, function () { return this.$ }, function (a) { this.$ = a }); w.defineProperty(Ef, { Ac: "change" }, function () { return this.Rq }, function (a) { this.Rq = a }); w.defineProperty(Ef, { nf: "modelChange" }, function () { return this.cw }, function (a) { this.cw = a }); w.defineProperty(Ef, { propertyName: "propertyName" }, function () { return this.Um }, function (a) { this.Um = a }); w.u(Ef, { wF: "isTransactionFinished" }, function () { return this.Rq === Pf && ("CommittedTransaction" === this.Um || "FinishedUndo" === this.Um || "FinishedRedo" === this.Um) }); w.defineProperty(Ef, { object: "object" }, function () { return this.vs }, function (a) { this.vs = a }); w.defineProperty(Ef, { oldValue: "oldValue" }, function () { return this.xs }, function (a) { this.xs = a }); w.defineProperty(Ef, { Aj: "oldParam" }, function () { return this.ws }, function (a) { this.ws = a }); w.defineProperty(Ef, { newValue: "newValue" }, function () { return this.ss }, function (a) { this.ss = a }); w.defineProperty(Ef, { zj: "newParam" }, function () { return this.rs }, function (a) { this.rs = a }); function F(a) { 1 < arguments.length && w.k("Model constructor can only take one optional argument, the Array of node data."); w.nc(this); this.fr = this.Sb = ""; this.Mi = !1; this.sz = {}; this.De = []; this.Gc = new la(null, Object); this.fk = "key"; this.uo = this.Zo = null; this.Xq = this.Yq = !1; this.Hq = null; this.Pm = "category"; this.Gi = new la(null, I); this.bk = null; this.dj = !1; this.Nz = null; this.oa = new Tf; void 0 !== a && (this.fg = a) } w.ga("Model", F); F.prototype.cloneProtected = function (a) { a.Sb = this.Sb; a.fr = this.fr; a.Mi = this.Mi; a.fk = this.fk; a.Zo = this.Zo; a.uo = this.uo; a.Yq = this.Yq; a.Xq = this.Xq; a.Hq = this.Hq; a.Pm = this.Pm }; F.prototype.copy = function () { var a = new this.constructor; this.cloneProtected(a); return a }; F.prototype.clear = F.prototype.clear = function () { this.De = []; this.Gc.clear(); this.Gi.clear(); this.oa.clear() }; g = F.prototype; g.toString = function (a) { void 0 === a && (a = 0); if (1 < a) return this.uB(); var b = ("" !== this.name ? this.name : "") + " Model"; if (0 < a) { b += "\n node data:"; a = this.fg; for (var c = w.Za(a), d = 0; d < c; d++)var e = w.Ba(a, d), b = b + (" " + this.sb(e) + ":" + Sf(e)) } return b }; g.eo = function () { var a = ""; "" !== this.name && (a += ',\n "name": ' + this.quote(this.name)); "" !== this.Ml && (a += ',\n "dataFormat": ' + this.quote(this.Ml)); this.hb && (a += ',\n "isReadOnly": ' + this.hb); "key" !== this.bm && "string" === typeof this.bm && (a += ',\n "nodeKeyProperty": ' + this.quote(this.bm)); this.dA && (a += ',\n "copiesArrays": true'); this.cA && (a += ',\n "copiesArrayObjects": true'); "category" !== this.Tn && "string" === typeof this.Tn && (a += ',\n "nodeCategoryProperty": ' + this.quote(this.Tn)); return a }; g.zu = function (a) { a.name && (this.name = a.name); a.dataFormat && (this.Ml = a.dataFormat); a.isReadOnly && (this.hb = a.isReadOnly); a.nodeKeyProperty && (this.bm = a.nodeKeyProperty); a.copiesArrays && (this.dA = a.copiesArrays); a.copiesArrayObjects && (this.cA = a.copiesArrayObjects); a.nodeCategoryProperty && (this.Tn = a.nodeCategoryProperty) }; function Uf(a) { return ',\n "modelData": ' + Vf(a, a.Hk) } function Wf(a, b) { var c = b.modelData; w.Pa(c) && (a.Cu(c), a.Hk = c) } g.GB = function () { var a = this.Hk, b = !1, c; for (c in a) if (!Xf(c, a[c])) { b = !0; break } a = ""; b && (a = Uf(this)); return a + ',\n "nodeDataArray": ' + Yf(this, this.fg, !0) }; g.YA = function (a) { Wf(this, a); a = a.nodeDataArray; w.isArray(a) && (this.Cu(a), this.fg = a) }; function Zf(a, b, c, d) { if (b === c) return !0; if (typeof b !== typeof c || "function" === typeof b || "function" === typeof c) return !1; if (Array.isArray(b) && Array.isArray(c)) { if (d.ja(b) === c) return !0; d.add(b, c); if (b.length !== c.length) return !1; for (var e = 0; e < b.length; e++)if (!Zf(a, b[e], c[e], d)) return !1; return !0 } if (w.Pa(b) && w.Pa(c)) { if (d.ja(b) === c) return !0; d.add(b, c); for (e in b) { var f = b[e]; if (!Xf(e, f)) { var h = c[e]; if (void 0 === h || !Zf(a, f, h, d)) return !1 } } for (var k in c) if (h = c[k], !Xf(k, h) && (f = b[k], void 0 === f || !Zf(a, f, h, d))) return !1; return !0 } return !1 } function $f(a, b, c) { a[c] !== b[c] && w.k("Model.computeJsonDifference: Model." + c + ' is not the same in both models: "' + a[c] + '" and "' + b[c] + '"') } g.HB = function (a) { $f(this, a, "nodeKeyProperty"); this instanceof ag && $f(this, a, "nodeParentKeyProperty"); for (var b = new I, c = new I, d = (new I).Jc(this.Gc.xF), e = new la, f = a.fg, h = 0; h < f.length; h++) { var k = f[h], l = a.sb(k); if (void 0 !== l) { d.remove(l); var m = this.ve(l); null === m ? (b.add(l), c.add(k)) : Zf(this, m, k, e) || c.add(k) } else this.KA(k), l = this.sb(k), b.add(l), c.add(k) } f = ""; Zf(this, this.Hk, a.Hk, e) || (f += Uf(this)); 0 < b.count && (f += this.Dy + Yf(this, b.gc(), !0)); 0 < c.count && (f += this.PB + Yf(this, c.gc(), !0)); 0 < d.count && (f += this.Fy + Yf(this, d.gc(), !0)); return f }; F.prototype.computeJsonDifference = F.prototype.computeJSONDifference = function (a, b) { w.G(a, F, F, "computeJsonDifference:newmodel"); void 0 === b && (b = this.constructor === F ? "go.Model" : this.constructor === R ? "go.GraphLinksModel" : this.constructor === ag ? "go.TreeModel" : w.kf(this)); return '{ "class": ' + this.quote(b) + ', "incremental": 1' + this.eo() + this.HB(a) + "}" }; g = F.prototype; g.Dy = ',\n "insertedNodeKeys": '; g.PB = ',\n "modifiedNodeData": '; g.Fy = ',\n "removedNodeKeys": '; g.FB = function (a, b) { var c = this, d = !1, e = new I, f = new I, h = new I; a.Uf.each(function (a) { a.ba === c && ("nodeDataArray" === a.nf ? a.Ac === Qf ? e.add(a.newValue) : a.Ac === Rf && h.add(a.oldValue) : c.He(a.object) ? f.add(a.object) : c.Hk === a.object && a.Ac === Of && (d = !0)) }); var k = new I; e.each(function (a) { k.add(c.sb(a)); b || f.add(a) }); var l = new I; h.each(function (a) { l.add(c.sb(a)); b && f.add(a) }); var m = ""; d && (m += Uf(this)); 0 < k.count && (m += (b ? this.Fy : this.Dy) + Yf(this, k.gc(), !0)); 0 < f.count && (m += this.PB + Yf(this, f.gc(), !0)); 0 < l.count && (m += (b ? this.Dy : this.Fy) + Yf(this, l.gc(), !0)); return m }; g.XA = function (a) { Wf(this, a); var b = a.insertedNodeKeys, c = a.modifiedNodeData, d = new la; if (w.isArray(c)) for (var e = 0; e < c.length; e++) { var f = w.Ba(c, e), h = this.sb(f); void 0 !== h && null !== h && d.set(h, f) } if (w.isArray(b)) for (var e = w.Za(b), k = 0; k < e; k++)f = w.Ba(b, k), h = this.ve(f), null === h && (h = (h = d.get(f)) ? h : this.copyNodeData({}), this.ly(h, f), this.Dl(h)); if (w.isArray(c)) for (e = w.Za(c), k = 0; k < e; k++)if (f = w.Ba(c, k), h = this.sb(f), h = this.ve(h), null !== h) for (var l in f) "__gohashid" !== l && l !== this.bm && l !== this.hq && this.setDataProperty(h, l, f[l]); a = a.removedNodeKeys; if (w.isArray(a)) for (e = w.Za(a), k = 0; k < e; k++)f = w.Ba(a, k), h = this.ve(f), null !== h && this.ay(h) }; F.prototype.toIncrementalJson = F.prototype.toIncrementalJSON = function (a, b) { w.G(a, Ef, F, "toIncrementalJson:e"); a.Ac !== Pf && w.k("Model.toIncrementalJson argument is not a Transaction ChangedEvent:" + a.toString()); var c = a.object; if (!(a.wF && c instanceof bg)) return '{ "incremental": 0 }'; void 0 === b && (b = this.constructor === F ? "go.Model" : this.constructor === R ? "go.GraphLinksModel" : this.constructor === ag ? "go.TreeModel" : w.kf(this)); return '{ "class": ' + this.quote(b) + ', "incremental": 1' + this.eo() + this.FB(c, "FinishedUndo" === a.propertyName) + "}" }; F.prototype.toJson = F.prototype.toJSON = F.prototype.uB = function (a) { void 0 === a && (a = this.constructor === F ? "go.Model" : this.constructor === R ? "go.GraphLinksModel" : this.constructor === ag ? "go.TreeModel" : w.kf(this)); return '{ "class": ' + this.quote(a) + this.eo() + this.GB() + "}" }; F.prototype.applyIncrementalJson = F.prototype.applyIncrementalJSON = function (a) { var b = null; if ("string" === typeof a) if (window.JSON && window.JSON.parse) try { b = window.JSON.parse(a) } catch (c) { } else w.trace("WARNING: no JSON.parse available"); else "object" === typeof a ? b = a : w.k("Unable to modify a Model from: " + a); var d = b.incremental; "number" !== typeof d && w.k("Unable to apply non-incremental changes to Model: " + a); 0 !== d && (this.Pb("applyIncrementalJson"), this.XA(b), this.wd("applyIncrementalJson")) }; F.fromJson = F.fromJSON = function (a, b) { void 0 === b && (b = null); null !== b && w.G(b, F, F, "fromJson:model"); var c = null; if ("string" === typeof a) if (window.JSON && window.JSON.parse) try { c = window.JSON.parse(a) } catch (d) { } else w.trace("WARNING: no JSON.parse available"); else "object" === typeof a ? c = a : w.k("Unable to construct a Model from: " + a); if (null === b) { var e; e = null; var f = c["class"]; if ("string" === typeof f) try { var h = null; 0 === f.indexOf("go.") ? (f = f.substr(3), h = ca[f]) : (h = ca[f], void 0 === h && (h = window[f])); "function" === typeof h && (e = new h) } catch (k) { } null === e || e instanceof F ? b = e : w.k("Unable to construct a Model of declared class: " + c["class"]) } null === b && (b = new R); b.zu(c); b.YA(c); return b }; F.prototype.replaceJsonObjects = F.prototype.Cu = function (a) { if (w.isArray(a)) for (var b = w.Za(a), c = 0; c < b; c++) { var d = w.Ba(a, c); w.Pa(d) && w.qE(a, c, this.Cu(d)) } else if (w.Pa(a)) { for (c in a) d = a[c], w.Pa(d) && (d = this.Cu(d), a[c] = d); if ("object" === typeof a) { d = a; c = a["class"]; if ("NaN" === c) d = NaN; else if ("Date" === c) d = new Date(a.value); else if ("go.Point" === c) d = new z(lg(a.x), lg(a.y)); else if ("go.Size" === c) d = new ia(lg(a.width), lg(a.height)); else if ("go.Rect" === c) d = new B(lg(a.x), lg(a.y), lg(a.width), lg(a.height)); else if ("go.Margin" === c) d = new db(lg(a.top), lg(a.right), lg(a.bottom), lg(a.left)); else if ("go.Spot" === c) d = "string" === typeof a["enum"] ? sb(a["enum"]) : new L(lg(a.x), lg(a.y), lg(a.offsetX), lg(a.offsetY)); else if ("go.Brush" === c) { if (d = new ha, d.type = pa(ha, a.type), "string" === typeof a.color && (d.color = a.color), a.start instanceof L && (d.start = a.start), a.end instanceof L && (d.end = a.end), "number" === typeof a.startRadius && (d.Nu = lg(a.startRadius)), "number" === typeof a.endRadius && (d.Jt = lg(a.endRadius)), a = a.colorStops, w.Pa(a)) for (b in a) d.addColorStop(parseFloat(b), a[b]) } else "go.Geometry" === c ? (b = null, b = "string" === typeof a.path ? Te(a.path) : new Ce, b.type = pa(Ce, a.type), "number" === typeof a.startX && (b.ha = lg(a.startX)), "number" === typeof a.startY && (b.fa = lg(a.startY)), "number" === typeof a.endX && (b.C = lg(a.endX)), "number" === typeof a.endY && (b.D = lg(a.endY)), a.spot1 instanceof L && (b.A = a.spot1), a.spot2 instanceof L && (b.B = a.spot2), d = b) : "go.EnumValue" === c && (b = a.classType, 0 === b.indexOf("go.") && (b = b.substr(3)), d = pa(ca[b], a.name)); a = d } } return a }; F.prototype.quote = function (a) { for (var b = "", c = a.length, d = 0; d < c; d++) { var e = a[d]; if ('"' === e || "\\" === e) b += "\\" + e; else if ("\b" === e) b += "\\b"; else if ("\f" === e) b += "\\f"; else if ("\n" === e) b += "\\n"; else if ("\r" === e) b += "\\r"; else if ("\t" === e) b += "\\t"; else var f = a.charCodeAt(d), b = 16 > f ? b + ("\\u000" + a.charCodeAt(d).toString(16)) : 32 > f ? b + ("\\u00" + a.charCodeAt(d).toString(16)) : 8232 === f ? b + "\\u2028" : 8233 === f ? b + "\\u2029" : b + e } return '"' + b + '"' }; F.prototype.writeJsonValue = F.prototype.Ru = 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.Ru(a.valueOf()) : w.isArray(a) ? Yf(this, a) : w.Pa(a) ? Vf(this, a) : "function" === typeof a ? "null" : a.toString() }; function Yf(a, b, c) { void 0 === c && (c = !1); var d = w.Za(b); if (0 >= d) return "[]"; var e = new ra; e.add("[ "); c && 1 < d && e.add("\n"); for (var f = 0; f < d; f++) { var h = w.Ba(b, f); void 0 !== h && (0 < f && (e.add(","), c && e.add("\n")), e.add(a.Ru(h))) } c && 1 < d && e.add("\n"); e.add(" ]"); return e.toString() } function Xf(a, b) { return void 0 === b || "__gohashid" === a || "_" === a[0] || "function" === typeof b ? !0 : !1 } function mg(a) { return isNaN(a) ? "NaN" : Infinity === a ? "9e9999" : -Infinity === a ? "-9e9999" : a } function Vf(a, b) { var c = b; if (c instanceof z) b = { "class": "go.Point", x: mg(c.x), y: mg(c.y) }; else if (c instanceof ia) b = { "class": "go.Size", width: mg(c.width), height: mg(c.height) }; else if (c instanceof B) b = { "class": "go.Rect", x: mg(c.x), y: mg(c.y), width: mg(c.width), height: mg(c.height) }; else if (c instanceof db) b = { "class": "go.Margin", top: mg(c.top), right: mg(c.right), bottom: mg(c.bottom), left: mg(c.left) }; else if (c instanceof L) b = c.Xc() ? { "class": "go.Spot", x: mg(c.x), y: mg(c.y), offsetX: mg(c.offsetX), offsetY: mg(c.offsetY) } : { "class": "go.Spot", "enum": c.toString() }; else if (c instanceof ha) { b = { "class": "go.Brush", type: c.type.name }; if (c.type === ng) b.color = c.color; else if (c.type === og || c.type === cd) b.start = c.start, b.end = c.end, c.type === cd && (0 !== c.Nu && (b.startRadius = mg(c.Nu)), isNaN(c.Jt) || (b.endRadius = mg(c.Jt))); if (null !== c.uk) { for (var d = {}, c = c.uk.i; c.next();)d[c.key] = c.value; b.colorStops = d } } else if (c instanceof Ce) b = { "class": "go.Geometry", type: c.type.name }, 0 !== c.ha && (b.startX = mg(c.ha)), 0 !== c.fa && (b.startY = mg(c.fa)), 0 !== c.C && (b.endX = mg(c.C)), 0 !== c.D && (b.endY = mg(c.D)), c.A.L(xb) || (b.spot1 = c.A), c.B.L(Nb) || (b.spot2 = c.B), c.type === De && (b.path = Se(c)); else if (c instanceof ea) b = { "class": "go.EnumValue", classType: w.kf(c.Ee), name: c.name }; else if (c instanceof G || c instanceof D || c instanceof pg || c instanceof F || c instanceof qg || c instanceof rg || c instanceof sg || c instanceof tg || c instanceof Tf || c instanceof bg) return w.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: " + c.toString()), "{}"; var d = "{", c = !0, e; for (e in b) { var f = w.tb(b, e); if (!Xf(e, f)) if (c ? c = !1 : d += ", ", d += '"' + e + '":', "points" === e && f instanceof H && f.ma === z) { for (var h = "[", f = f.i; f.next();) { var k = f.value; 1 < h.length && (h += ","); h += a.Ru(k.x); h += ","; h += a.Ru(k.y) } h += "]"; d += h } else d += a.Ru(f) } return d + "}" } function lg(a) { return "number" === typeof a ? a : "NaN" === a ? NaN : "9e9999" === a ? Infinity : "-9e9999" === a ? -Infinity : parseFloat(a) } w.defineProperty(F, { name: "name" }, function () { return this.Sb }, function (a) { var b = this.Sb; b !== a && (w.j(a, "string", F, "name"), this.Sb = a, this.h("name", b, a)) }); w.defineProperty(F, { Ml: "dataFormat" }, function () { return this.fr }, function (a) { var b = this.fr; b !== a && (w.j(a, "string", F, "dataFormat"), this.fr = a, this.h("dataFormat", b, a)) }); w.defineProperty(F, { hb: "isReadOnly" }, function () { return this.Mi }, function (a) { var b = this.Mi; b !== a && (w.j(a, "boolean", F, "isReadOnly"), this.Mi = a, this.h("isReadOnly", b, a)) }); w.defineProperty(F, { Hk: "modelData" }, function () { return this.sz }, function (a) { var b = this.sz; b !== a && (w.j(a, "object", F, "modelData"), this.sz = a, this.h("modelData", b, a), this.Hb(a)) }); F.prototype.addChangedListener = F.prototype.gn = function (a) { w.j(a, "function", F, "addChangedListener:listener"); null === this.bk && (this.bk = new H("function")); this.bk.add(a) }; F.prototype.removeChangedListener = F.prototype.Au = function (a) { w.j(a, "function", F, "removeChangedListener:listener"); null !== this.bk && (this.bk.remove(a), 0 === this.bk.count && (this.bk = null)) }; F.prototype.Ww = function (a) { this.wb || this.oa.eF(a); if (null !== this.bk) { var b = this.bk, c = b.length; if (1 === c) b = b.ea(0), b(a); else if (0 !== c) for (var d = b.gc(), e = 0; e < c; e++)b = d[e], b(a) } }; F.prototype.raiseChangedEvent = F.prototype.Zc = function (a, b, c, d, e, f, h) { ug(this, "", a, b, c, d, e, f, h) }; F.prototype.raiseChanged = F.prototype.h = function (a, b, c, d, e) { ug(this, "", Of, a, this, b, c, d, e) }; F.prototype.raiseDataChanged = F.prototype.WA = function (a, b, c, d, e, f) { ug(this, "", Of, b, a, c, d, e, f) }; function ug(a, b, c, d, e, f, h, k, l) { void 0 === k && (k = null); void 0 === l && (l = null); var m = new Ef; m.ba = a; m.Ac = c; m.nf = b; m.propertyName = d; m.object = e; m.oldValue = f; m.Aj = k; m.newValue = h; m.zj = l; a.Ww(m) } w.defineProperty(F, { oa: "undoManager" }, function () { return this.Nz }, function (a) { var b = this.Nz; b !== a && (w.G(a, Tf, F, "undoManager"), null !== b && b.pJ(this), this.Nz = a, null !== a && a.gH(this)) }); w.defineProperty(F, { wb: "skipsUndoManager" }, function () { return this.dj }, function (a) { w.j(a, "boolean", F, "skipsUndoManager"); this.dj = a }); F.prototype.on = function (a, b) { if (null !== a && a.ba === this) if (a.Ac === Of) { var c = a.object, d = a.propertyName, e = a.ja(b); w.La(c, d, e) } else a.Ac === Qf ? (c = a.zj, "nodeDataArray" === a.nf ? (d = a.newValue, w.Pa(d) && "number" === typeof c && (e = this.sb(d), b ? (w.Ba(this.De, c) === d && w.Kg(this.De, c), void 0 !== e && this.Gc.remove(e)) : (w.Ba(this.De, c) !== d && w.sh(this.De, c, d), void 0 !== e && this.Gc.add(e, d)))) : "" === a.nf ? (d = a.object, !w.isArray(d) && a.propertyName && (d = w.tb(a.object, a.propertyName)), w.isArray(d) && "number" === typeof c && (e = a.newValue, b ? w.Kg(d, c) : w.sh(d, c, e))) : w.k("unknown ChangedEvent.Insert modelChange: " + a.toString())) : a.Ac === Rf ? (c = a.Aj, "nodeDataArray" === a.nf ? (d = a.oldValue, w.Pa(d) && "number" === typeof c && (e = this.sb(d), b ? (w.Ba(this.De, c) !== d && w.sh(this.De, c, d), void 0 !== e && this.Gc.add(e, d)) : (w.Ba(this.De, c) === d && w.Kg(this.De, c), void 0 !== e && this.Gc.remove(e)))) : "" === a.nf ? (d = a.object, !w.isArray(d) && a.propertyName && (d = w.tb(a.object, a.propertyName)), w.isArray(d) && "number" === typeof c && (e = a.oldValue, b ? w.sh(d, c, e) : w.Kg(d, c))) : w.k("unknown ChangedEvent.Remove modelChange: " + a.toString())) : a.Ac !== Pf && w.k("unknown ChangedEvent: " + a.toString()) }; F.prototype.startTransaction = F.prototype.Pb = function (a) { return this.oa.Pb(a) }; F.prototype.commitTransaction = F.prototype.wd = function (a) { return this.oa.wd(a) }; F.prototype.rollbackTransaction = F.prototype.mq = function () { return this.oa.mq() }; F.prototype.updateTargetBindings = F.prototype.Hb = function (a, b) { void 0 === b && (b = ""); ug(this, "SourceChanged", Pf, b, a, null, null) }; w.defineProperty(F, { bm: "nodeKeyProperty" }, function () { return this.fk }, function (a) { var b = this.fk; b !== a && (vg(a, F, "nodeKeyProperty"), "" === a && w.k("Model.nodeKeyProperty may not be the empty string"), 0 < this.Gc.count && w.k("Cannot set Model.nodeKeyProperty when there is existing node data"), this.fk = a, this.h("nodeKeyProperty", b, a)) }); function vg(a, b, c) { "string" !== typeof a && "function" !== typeof a && w.Bd(a, "string or function", b, c) } F.prototype.getKeyForNodeData = F.prototype.sb = function (a) { if (null !== a) { var b = this.fk; if ("" !== b && (b = w.tb(a, b), void 0 !== b)) { if (wg(b)) return b; w.k("Key value for node data " + a + " is not a number or a string: " + b) } } }; F.prototype.setKeyForNodeData = F.prototype.ly = function (a, b) { void 0 !== b && null !== b && wg(b) || w.Bd(b, "number or string", F, "setKeyForNodeData:key"); if (null !== a) { var c = this.fk; if ("" !== c) if (this.He(a)) { var d = w.tb(a, c); d !== b && null === this.ve(b) && (w.La(a, c, b), this.Gc.remove(d), this.Gc.add(b, a), ug(this, "nodeKey", Of, c, a, d, b), "string" === typeof c && this.Hb(a, c), this.Bu(d, b)) } else w.La(a, c, b) } }; w.defineProperty(F, { kL: "makeUniqueKeyFunction" }, function () { return this.Zo }, function (a) { var b = this.Zo; b !== a && (null !== a && w.j(a, "function", F, "makeUniqueKeyFunction"), this.Zo = a, this.h("makeUniqueKeyFunction", b, a)) }); function wg(a) { return "number" === typeof a || "string" === typeof a } F.prototype.containsNodeData = F.prototype.He = function (a) { var b = this.sb(a); return void 0 === b ? !1 : this.Gc.ja(b) === a }; F.prototype.findNodeDataForKey = F.prototype.ve = function (a) { null === a && w.k("Model.findNodeDataForKey:key must not be null"); return void 0 !== a && wg(a) ? this.Gc.ja(a) : null }; w.defineProperty(F, { fg: "nodeDataArray" }, function () { return this.De }, function (a) { var b = this.De; if (b !== a) { w.Wz(a, F, "nodeDataArray"); this.Gc.clear(); this.BB(); for (var c = w.Za(a), d = 0; d < c; d++) { var e = w.Ba(a, d); if (!w.Pa(e)) { w.k("Model.nodeDataArray must only contain Objects, not: " + e); return } w.Vp(e) } this.De = a; for (var f = new H(Object), d = 0; d < c; d++) { var e = w.Ba(a, d), h = this.sb(e); void 0 === h ? f.add(e) : null !== this.Gc.ja(h) ? f.add(e) : this.Gc.add(h, e) } for (d = f.i; d.next();)e = d.value, this.KA(e), f = this.sb(e), void 0 !== f && this.Gc.add(f, e); ug(this, "nodeDataArray", Of, "nodeDataArray", this, b, a); for (d = 0; d < c; d++)e = w.Ba(a, d), this.lq(e), this.kq(e); this.tE(); w.yI(a) || (this.hb = !0) } }); F.prototype.makeNodeDataKeyUnique = F.prototype.KA = function (a) { if (null !== a) { var b = this.fk; if ("" !== b) { var c = this.sb(a); if (void 0 === c || this.Gc.contains(c)) { var d = this.Zo; if (null !== d && (c = d(this, a), void 0 !== c && null !== c && !this.Gc.contains(c))) { w.La(a, b, c); return } if ("string" === typeof c) { for (d = 2; this.Gc.contains(c + d);)d++; w.La(a, b, c + d) } else if (void 0 === c || "number" === typeof c) { for (d = -this.Gc.count - 1; this.Gc.contains(d);)d--; w.La(a, b, d) } else w.k("Model.getKeyForNodeData returned something other than a string or a number: " + c) } } } }; F.prototype.addNodeData = F.prototype.Dl = function (a) { null !== a && (w.Vp(a), this.He(a) || xg(this, a, !0)) }; function xg(a, b, c) { var d = a.sb(b); if (void 0 === d || a.Gc.ja(d) !== b) a.KA(b), d = a.sb(b), void 0 === d ? w.k("Model.makeNodeDataKeyUnique failed on " + b + ". Data not added to Model.") : (a.Gc.add(d, b), d = null, c && (d = w.Za(a.De), w.sh(a.De, d, b)), ug(a, "nodeDataArray", Qf, "nodeDataArray", a, null, b, null, d), a.lq(b), a.kq(b)) } F.prototype.addNodeDataCollection = function (a) { if (w.isArray(a)) for (var b = w.Za(a), c = 0; c < b; c++)this.Dl(w.Ba(a, c)); else for (a = a.i; a.next();)this.Dl(a.value) }; F.prototype.removeNodeData = F.prototype.ay = function (a) { null !== a && yg(this, a, !0) }; function yg(a, b, c) { var d = a.sb(b); void 0 !== d && a.Gc.remove(d); d = null; if (c) { d = w.Gl(a.De, b); if (0 > d) return; w.Kg(a.De, d) } ug(a, "nodeDataArray", Rf, "nodeDataArray", a, b, null, d, null); a.Qu(b) } F.prototype.removeNodeDataCollection = function (a) { if (w.isArray(a)) for (var b = w.Za(a), c = 0; c < b; c++)this.ay(w.Ba(a, c)); else for (a = a.i; a.next();)this.ay(a.value) }; g = F.prototype; g.Bu = function (a, b) { var c = zg(this, a); c instanceof I && this.Gi.add(b, c) }; g.BB = function () { }; g.lq = function () { }; g.kq = function () { }; g.Qu = function () { }; function Sg(a, b, c) { if (void 0 !== b) { var d = a.Gi.ja(b); null === d && (d = new I(Object), a.Gi.add(b, d)); d.add(c) } } function Tg(a, b, c) { if (void 0 !== b) { var d = a.Gi.ja(b); d instanceof I && (void 0 === c || null === c ? a.Gi.remove(b) : (d.remove(c), 0 === d.count && a.Gi.remove(b))) } } function zg(a, b) { if (void 0 === b) return null; var c = a.Gi.ja(b); return c instanceof I ? c : null } F.prototype.clearUnresolvedReferences = F.prototype.tE = function (a) { void 0 === a ? this.Gi.clear() : this.Gi.remove(a) }; w.defineProperty(F, { FK: "copyNodeDataFunction" }, function () { return this.uo }, function (a) { var b = this.uo; b !== a && (null !== a && w.j(a, "function", F, "copyNodeDataFunction"), this.uo = a, this.h("copyNodeDataFunction", b, a)) }); w.defineProperty(F, { dA: "copiesArrays" }, function () { return this.Yq }, function (a) { var b = this.Yq; b !== a && (null !== a && w.j(a, "boolean", F, "copiesArrays"), this.Yq = a, this.h("copiesArrays", b, a)) }); w.defineProperty(F, { cA: "copiesArrayObjects" }, function () { return this.Xq }, function (a) { var b = this.Xq; b !== a && (null !== a && w.j(a, "boolean", F, "copiesArrayObjects"), this.Xq = a, this.h("copiesArrayObjects", b, a)) }); F.prototype.copyNodeData = function (a) { if (null === a) return null; var b = null, b = this.uo, b = null !== b ? b(a, this) : Ug(this, a, !0); w.Pa(b) && w.nc(b); return b }; function Ug(a, b, c) { if (a.dA && Array.isArray(b)) { var d = []; for (c = 0; c < b.length; c++) { var e = Ug(a, b[c], a.cA); d.push(e) } w.nc(d); return d } if (c && w.Pa(b)) { c = (c = b.constructor) ? new c : {}; for (d in b) if ("__gohashid" !== d) { var e = w.tb(b, d), f; f = e; f instanceof G || f instanceof D || f instanceof pg || f instanceof Vg || f instanceof Wg || f instanceof qg || f instanceof rg || f instanceof sg || f instanceof Bf || f instanceof Df ? ("_" !== d[0] && w.trace('Warning: found GraphObject or Diagram reference when copying model data on property "' + d + '" of data object: ' + b.toString() + " \nModel data should not have any references to a Diagram or any part of a diagram, such as: " + f.toString()), f = !0) : f = f instanceof F || f instanceof Tf || f instanceof bg || f instanceof Ef ? !0 : !1; f || (e = Ug(a, e, !1)); w.La(c, d, e) } w.nc(c); return c } return b instanceof z ? b.copy() : b instanceof ia ? b.copy() : b instanceof B ? b.copy() : b instanceof L ? b.copy() : b instanceof db ? b.copy() : b } w.defineProperty(F, { iH: "afterCopyFunction" }, function () { return this.Hq }, function (a) { var b = this.Hq; b !== a && (null !== a && w.j(a, "function", F, "afterCopyFunction"), this.Hq = a, this.h("afterCopyFunction", b, a)) }); var Xg = !1; F.prototype.setDataProperty = function (a, b, c) { if (this.He(a)) if (b === this.bm) this.ly(a, c); else { if (b === this.Tn) { this.jy(a, c); return } } else !Xg && a instanceof G && (Xg = !0, w.trace('Model.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), w.trace(" Is that really your intent?")); var d = w.tb(a, b); d !== c && (w.La(a, b, c), this.WA(a, b, d, c)) }; F.prototype.addArrayItem = function (a, b) { this.yA(a, -1, b) }; F.prototype.insertArrayItem = F.prototype.yA = function (a, b, c) { a === this.De && w.k("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray"); 0 > b && (b = w.Za(a)); w.sh(a, b, c); ug(this, "", Qf, "", a, null, c, null, b) }; F.prototype.removeArrayItem = F.prototype.SF = function (a, b) { void 0 === b && (b = -1); a === this.De && w.k("Model.removeArrayItem should not be called on the Model.nodeDataArray"); -1 === b && (b = w.Za(a) - 1); var c = w.Ba(a, b); w.Kg(a, b); ug(this, "", Rf, "", a, c, null, b, null) }; w.defineProperty(F, { Tn: "nodeCategoryProperty" }, function () { return this.Pm }, function (a) { var b = this.Pm; b !== a && (vg(a, F, "nodeCategoryProperty"), this.Pm = a, this.h("nodeCategoryProperty", b, a)) }); F.prototype.getCategoryForNodeData = F.prototype.qA = function (a) { if (null === a) return ""; var b = this.Pm; if ("" === b) return ""; b = w.tb(a, b); if (void 0 === b) return ""; if ("string" === typeof b) return b; w.k("getCategoryForNodeData found a non-string category for " + a + ": " + b); return "" }; F.prototype.setCategoryForNodeData = F.prototype.jy = function (a, b) { w.j(b, "string", F, "setCategoryForNodeData:cat"); if (null !== a) { var c = this.Pm; if ("" !== c) if (this.He(a)) { var d = w.tb(a, c); void 0 === d && (d = ""); d !== b && (w.La(a, c, b), ug(this, "nodeCategory", Of, c, a, d, b)) } else w.La(a, c, b) } }; function R(a, b) { F.call(this); 2 < arguments.length && w.k("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data."); this.ff = []; this.Qi = new I(Object); this.cd = new la(null, Object); this.ol = ""; this.rm = this.to = this.$o = null; this.Wh = "from"; this.Xh = "to"; this.Lm = this.Km = ""; this.Jm = "category"; this.zg = ""; this.dp = "isGroup"; this.lh = "group"; this.Zq = !1; void 0 !== a && (this.fg = a); void 0 !== b && (this.Qg = b) } w.Ka(R, F); w.ga("GraphLinksModel", R); R.prototype.cloneProtected = function (a) { F.prototype.cloneProtected.call(this, a); a.ol = this.ol; a.$o = this.$o; a.to = this.to; a.Wh = this.Wh; a.Xh = this.Xh; a.Km = this.Km; a.Lm = this.Lm; a.Jm = this.Jm; a.zg = this.zg; a.dp = this.dp; a.lh = this.lh; a.Zq = this.Zq }; R.prototype.clear = R.prototype.clear = function () { F.prototype.clear.call(this); this.ff = []; this.cd.clear(); this.Qi.clear() }; g = R.prototype; g.toString = function (a) { void 0 === a && (a = 0); if (2 <= a) return this.uB(); var b = ("" !== this.name ? this.name : "") + " GraphLinksModel"; if (0 < a) { b += "\n node data:"; a = this.fg; for (var c = w.Za(a), d = 0, d = 0; d < c; d++)var e = w.Ba(a, d), b = b + (" " + this.sb(e) + ":" + Sf(e)); b += "\n link data:"; a = this.Qg; c = w.Za(a); for (d = 0; d < c; d++)e = w.Ba(a, d), b += " " + this.Ul(e) + "--\x3e" + this.Vl(e) } return b }; g.eo = function () { var a = F.prototype.eo.call(this), b = ""; "category" !== this.lu && "string" === typeof this.lu && (b += ',\n "linkCategoryProperty": ' + this.quote(this.lu)); "" !== this.yj && "string" === typeof this.yj && (b += ',\n "linkKeyProperty": ' + this.quote(this.yj)); "from" !== this.Kn && "string" === typeof this.Kn && (b += ',\n "linkFromKeyProperty": ' + this.quote(this.Kn)); "to" !== this.Ln && "string" === typeof this.Ln && (b += ',\n "linkToKeyProperty": ' + this.quote(this.Ln)); "" !== this.mu && "string" === typeof this.mu && (b += ',\n "linkFromPortIdProperty": ' + this.quote(this.mu)); "" !== this.ou && "string" === typeof this.ou && (b += ',\n "linkToPortIdProperty": ' + this.quote(this.ou)); "" !== this.nu && "string" === typeof this.nu && (b += ',\n "linkLabelKeysProperty": ' + this.quote(this.nu)); "isGroup" !== this.hq && "string" === typeof this.hq && (b += ',\n "nodeIsGroupProperty": ' + this.quote(this.hq)); "group" !== this.vu && "string" === typeof this.vu && (b += ',\n "nodeGroupKeyProperty": ' + this.quote(this.vu)); return a + b }; g.zu = function (a) { F.prototype.zu.call(this, a); a.linkKeyProperty && (this.yj = a.linkKeyProperty); a.linkFromKeyProperty && (this.Kn = a.linkFromKeyProperty); a.linkToKeyProperty && (this.Ln = a.linkToKeyProperty); a.linkFromPortIdProperty && (this.mu = a.linkFromPortIdProperty); a.linkToPortIdProperty && (this.ou = a.linkToPortIdProperty); a.linkCategoryProperty && (this.lu = a.linkCategoryProperty); a.linkLabelKeysProperty && (this.nu = a.linkLabelKeysProperty); a.nodeIsGroupProperty && (this.hq = a.nodeIsGroupProperty); a.nodeGroupKeyProperty && (this.vu = a.nodeGroupKeyProperty) }; g.GB = function () { var a = F.prototype.GB.call(this), b = ',\n "linkDataArray": ' + Yf(this, this.Qg, !0); return a + b }; g.YA = function (a) { F.prototype.YA.call(this, a); a = a.linkDataArray; w.isArray(a) && (this.Cu(a), this.Qg = a) }; g.HB = function (a) { if (!(a instanceof R)) return w.k("Model.computeJsonDifference: newmodel must be a GraphLinksModel"), ""; "" === this.yj && w.k("GraphLinksModel.linkKeyProperty must not be an empty string for .computeJsonDifference() to succeed."); var b = F.prototype.HB.call(this, a); $f(this, a, "linkKeyProperty"); $f(this, a, "linkFromKeyProperty"); $f(this, a, "linkToKeyProperty"); $f(this, a, "linkLabelKeysProperty"); $f(this, a, "nodeIsGroupProperty"); $f(this, a, "nodeGroupKeyProperty"); for (var c = new I, d = new I, e = (new I).Jc(this.cd.xF), f = new la, h = a.Qg, k = 0; k < h.length; k++) { var l = h[k], m = a.xf(l); if (void 0 !== m) { e.remove(m); var n = this.Rp(m); null === n ? (c.add(m), d.add(l)) : Zf(this, n, l, f) || d.add(l) } else this.JA(l), m = this.xf(l), c.add(m), d.add(l) } a = b; 0 < c.count && (a += this.Cy + Yf(this, c.gc(), !0)); 0 < d.count && (a += this.OB + Yf(this, d.gc(), !0)); 0 < e.count && (a += this.Ey + Yf(this, e.gc(), !0)); return a }; g.Cy = ',\n "insertedLinkKeys": '; g.OB = ',\n "modifiedLinkData": '; g.Ey = ',\n "removedLinkKeys": '; g.FB = function (a, b) { "" === this.yj && w.k("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed."); var c = F.prototype.FB.call(this, a, b), d = this, e = new I, f = new I, h = new I; a.Uf.each(function (a) { a.ba === d && ("linkDataArray" === a.nf ? a.Ac === Qf ? e.add(a.newValue) : a.Ac === Rf && h.add(a.oldValue) : d.vh(a.object) && f.add(a.object)) }); var k = new I; e.each(function (a) { k.add(d.xf(a)); b || f.add(a) }); var l = new I; h.each(function (a) { l.add(d.xf(a)); b && f.add(a) }); 0 < k.count && (c += (b ? this.Ey : this.Cy) + Yf(this, k.gc(), !0)); 0 < f.count && (c += this.OB + Yf(this, f.gc(), !0)); 0 < l.count && (c += (b ? this.Cy : this.Ey) + Yf(this, l.gc(), !0)); return c }; g.XA = function (a) { F.prototype.XA.call(this, a); var b = a.insertedLinkKeys, c = a.modifiedLinkData, d = new la; if (w.isArray(c)) for (var e = 0; e < c.length; e++) { var f = w.Ba(c, e), h = this.xf(f); void 0 !== h && null !== h && d.set(h, f) } if (w.isArray(b)) for (var e = w.Za(b), k = 0; k < e; k++)f = w.Ba(b, k), h = this.Rp(f), null === h && (h = (h = d.get(f)) ? h : this.Zw({}), this.jG(h, f), this.wt(h)); if (w.isArray(c)) for (e = w.Za(c), k = 0; k < e; k++)if (f = w.Ba(c, k), h = this.xf(f), h = this.Rp(h), null !== h) for (var l in f) "__gohashid" !== l && l !== this.yj && this.setDataProperty(h, l, f[l]); a = a.removedLinkKeys; if (w.isArray(a)) for (e = w.Za(a), k = 0; k < e; k++)f = w.Ba(a, k), h = this.Rp(f), null !== h && this.$x(h) }; g.on = function (a, b) { if (a.Ac === Qf) { var c = a.zj; if ("linkDataArray" === a.nf) { var d = a.newValue; if (w.Pa(d) && "number" === typeof c) { var e = this.xf(d); b ? (this.Qi.remove(d), w.Ba(this.ff, c) === d && w.Kg(this.ff, c), void 0 !== e && this.cd.remove(e)) : (this.Qi.add(d), w.Ba(this.ff, c) !== d && w.sh(this.ff, c, d), void 0 !== e && this.cd.add(e, d)) } return } if ("linkLabelKeys" === a.nf) { d = this.Ck(a.object); w.isArray(d) && "number" === typeof c && (b ? (c = w.Gl(d, a.newValue), 0 <= c && w.Kg(d, c)) : 0 > w.Gl(d, a.newValue) && w.sh(d, c, a.newValue)); return } } else if (a.Ac === Rf) { c = a.Aj; if ("linkDataArray" === a.nf) { d = a.oldValue; w.Pa(d) && "number" === typeof c && (e = this.xf(d), b ? (this.Qi.add(d), w.Ba(this.ff, c) !== d && w.sh(this.ff, c, d), void 0 !== e && this.cd.add(e, d)) : (this.Qi.remove(d), w.Ba(this.ff, c) === d && w.Kg(this.ff, c), void 0 !== e && this.cd.remove(e))); return } if ("linkLabelKeys" === a.nf) { d = this.Ck(a.object); w.isArray(d) && "number" === typeof c && (b ? 0 > w.Gl(d, a.newValue) && w.sh(d, c, a.newValue) : (c = w.Gl(d, a.newValue), 0 <= c && w.Kg(d, c))); return } } F.prototype.on.call(this, a, b) }; w.defineProperty(R, { Uz: "archetypeNodeData" }, function () { return this.rm }, function (a) { var b = this.rm; b !== a && (null !== a && w.G(a, Object, R, "archetypeNodeData"), this.rm = a, this.h("archetypeNodeData", b, a)) }); R.prototype.Mn = function (a) { if (void 0 !== a) { var b = this.rm; if (null !== b) { var c = this.ve(a); null === c && (c = this.copyNodeData(b), w.La(c, this.fk, a), this.Dl(c)) } return a } }; w.defineProperty(R, { Kn: "linkFromKeyProperty" }, function () { return this.Wh }, function (a) { var b = this.Wh; b !== a && (vg(a, R, "linkFromKeyProperty"), this.Wh = a, this.h("linkFromKeyProperty", b, a)) }); R.prototype.getFromKeyForLinkData = R.prototype.Ul = function (a) { if (null !== a) { var b = this.Wh; if ("" !== b && (b = w.tb(a, b), void 0 !== b)) { if (wg(b)) return b; w.k("FromKey value for link data " + a + " is not a number or a string: " + b) } } }; R.prototype.setFromKeyForLinkData = R.prototype.hB = function (a, b) { null === b && (b = void 0); void 0 === b || wg(b) || w.Bd(b, "number or string", R, "setFromKeyForLinkData:key"); if (null !== a) { var c = this.Wh; if ("" !== c) if (b = this.Mn(b), this.vh(a)) { var d = w.tb(a, c); d !== b && (Tg(this, d, a), w.La(a, c, b), null === this.ve(b) && Sg(this, b, a), ug(this, "linkFromKey", Of, c, a, d, b), "string" === typeof c && this.Hb(a, c)) } else w.La(a, c, b) } }; w.defineProperty(R, { Ln: "linkToKeyProperty" }, function () { return this.Xh }, function (a) { var b = this.Xh; b !== a && (vg(a, R, "linkToKeyProperty"), this.Xh = a, this.h("linkToKeyProperty", b, a)) }); R.prototype.getToKeyForLinkData = R.prototype.Vl = function (a) { if (null !== a) { var b = this.Xh; if ("" !== b && (b = w.tb(a, b), void 0 !== b)) { if (wg(b)) return b; w.k("ToKey value for link data " + a + " is not a number or a string: " + b) } } }; R.prototype.setToKeyForLinkData = R.prototype.nB = function (a, b) { null === b && (b = void 0); void 0 === b || wg(b) || w.Bd(b, "number or string", R, "setToKeyForLinkData:key"); if (null !== a) { var c = this.Xh; if ("" !== c) if (b = this.Mn(b), this.vh(a)) { var d = w.tb(a, c); d !== b && (Tg(this, d, a), w.La(a, c, b), null === this.ve(b) && Sg(this, b, a), ug(this, "linkToKey", Of, c, a, d, b), "string" === typeof c && this.Hb(a, c)) } else w.La(a, c, b) } }; w.defineProperty(R, { mu: "linkFromPortIdProperty" }, function () { return this.Km }, function (a) { var b = this.Km; b !== a && (vg(a, R, "linkFromPortIdProperty"), a !== this.Kn && a !== this.Ln || w.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: " + a), this.Km = a, this.h("linkFromPortIdProperty", b, a)) }); R.prototype.getFromPortIdForLinkData = R.prototype.$H = function (a) { if (null === a) return ""; var b = this.Km; if ("" === b) return ""; a = w.tb(a, b); return void 0 === a ? "" : a }; R.prototype.setFromPortIdForLinkData = R.prototype.iB = function (a, b) { w.j(b, "string", R, "setFromPortIdForLinkData:portname"); if (null !== a) { var c = this.Km; if ("" !== c) if (this.vh(a)) { var d = w.tb(a, c); void 0 === d && (d = ""); d !== b && (w.La(a, c, b), ug(this, "linkFromPortId", Of, c, a, d, b), "string" === typeof c && this.Hb(a, c)) } else w.La(a, c, b) } }; w.defineProperty(R, { ou: "linkToPortIdProperty" }, function () { return this.Lm }, function (a) { var b = this.Lm; b !== a && (vg(a, R, "linkToPortIdProperty"), a !== this.Kn && a !== this.Ln || w.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: " + a), this.Lm = a, this.h("linkToPortIdProperty", b, a)) }); R.prototype.getToPortIdForLinkData = R.prototype.dI = function (a) { if (null === a) return ""; var b = this.Lm; if ("" === b) return ""; a = w.tb(a, b); return void 0 === a ? "" : a }; R.prototype.setToPortIdForLinkData = R.prototype.oB = function (a, b) { w.j(b, "string", R, "setToPortIdForLinkData:portname"); if (null !== a) { var c = this.Lm; if ("" !== c) if (this.vh(a)) { var d = w.tb(a, c); void 0 === d && (d = ""); d !== b && (w.La(a, c, b), ug(this, "linkToPortId", Of, c, a, d, b), "string" === typeof c && this.Hb(a, c)) } else w.La(a, c, b) } }; w.defineProperty(R, { nu: "linkLabelKeysProperty" }, function () { return this.zg }, function (a) { var b = this.zg; b !== a && (vg(a, R, "linkLabelKeysProperty"), this.zg = a, this.h("linkLabelKeysProperty", b, a)) }); R.prototype.getLabelKeysForLinkData = R.prototype.Ck = function (a) { if (null === a) return w.io; var b = this.zg; if ("" === b) return w.io; a = w.tb(a, b); return void 0 === a ? w.io : a }; R.prototype.setLabelKeysForLinkData = R.prototype.kG = function (a, b) { w.Wz(b, R, "setLabelKeysForLinkData:arr"); if (null !== a) { var c = this.zg; if ("" !== c) if (this.vh(a)) { var d = w.tb(a, c); void 0 === d && (d = w.io); if (d !== b) { for (var e = w.Za(d), f = 0; f < e; f++) { var h = w.Ba(d, f); Tg(this, h, a) } w.La(a, c, b); e = w.Za(b); for (f = 0; f < e; f++)h = w.Ba(b, f), null === this.ve(h) && Sg(this, h, a); ug(this, "linkLabelKeys", Of, c, a, d, b); "string" === typeof c && this.Hb(a, c) } } else w.La(a, c, b) } }; R.prototype.addLabelKeyForLinkData = R.prototype.jE = function (a, b) { if (null !== b && void 0 !== b && (wg(b) || w.Bd(b, "number or string", R, "addLabelKeyForLinkData:key"), null !== a)) { var c = this.zg; if ("" !== c) { var d = w.tb(a, c); if (void 0 === d) c = [], c.push(b), this.kG(a, c); else if (w.isArray(d)) { var e = w.Gl(d, b); 0 <= e || (e = w.Za(d), w.sh(d, Infinity, b), this.vh(a) && (null === this.ve(b) && Sg(this, b, a), ug(this, "linkLabelKeys", Qf, c, a, null, b, null, e))) } else w.k(c + " property is not an Array; cannot addLabelKeyForLinkData: " + a) } } }; R.prototype.removeLabelKeyForLinkData = R.prototype.oJ = function (a, b) { if (null !== b && void 0 !== b && (wg(b) || w.Bd(b, "number or string", R, "removeLabelKeyForLinkData:key"), null !== a)) { var c = this.zg; if ("" !== c) { var d = w.tb(a, c); if (w.isArray(d)) { var e = w.Gl(d, b); 0 > e || (w.Kg(d, e), this.vh(a) && (Tg(this, b, a), ug(this, "linkLabelKeys", Rf, c, a, b, null, e, null))) } else void 0 !== d && w.k(c + " property is not an Array; cannot removeLabelKeyforLinkData: " + a) } } }; w.defineProperty(R, { Qg: "linkDataArray" }, function () { return this.ff }, function (a) { var b = this.ff; if (b !== a) { w.Wz(a, R, "linkDataArray"); this.cd.clear(); for (var c = w.Za(a), d = 0; d < c; d++) { var e = w.Ba(a, d); if (!w.Pa(e)) { w.k("GraphLinksModel.linkDataArray must only contain Objects, not: " + e); return } w.Vp(e) } this.ff = a; if ("" !== this.yj) { for (var f = new H(Object), d = 0; d < c; d++) { var e = w.Ba(a, d), h = this.xf(e); void 0 === h ? f.add(e) : null !== this.cd.ja(h) ? f.add(e) : this.cd.add(h, e) } for (d = f.i; d.next();)e = d.value, this.JA(e), f = this.xf(e), void 0 !== f && this.cd.add(f, e) } f = new I(Object); for (d = 0; d < c; d++)e = w.Ba(a, d), f.add(e); this.Qi = f; ug(this, "linkDataArray", Of, "linkDataArray", this, b, a); for (d = 0; d < c; d++)e = w.Ba(a, d), Yg(this, e) } }); w.defineProperty(R, { yj: "linkKeyProperty" }, function () { return this.ol }, function (a) { var b = this.ol; if (b !== a) { vg(a, R, "linkKeyProperty"); this.ol = a; this.cd.clear(); for (var c = w.Za(this.Qg), d = 0; d < c; d++) { var e = w.Ba(this.Qg, d), f = this.xf(e); void 0 !== f && this.cd.add(f, e) } this.h("linkKeyProperty", b, a) } }); R.prototype.getKeyForLinkData = R.prototype.xf = function (a) { if (null !== a) { var b = this.ol; if ("" !== b && (b = w.tb(a, b), void 0 !== b)) { if (wg(b)) return b; w.k("Key value for link data " + a + " is not a number or a string: " + b) } } }; R.prototype.setKeyForLinkData = R.prototype.jG = function (a, b) { void 0 !== b && null !== b && wg(b) || w.Bd(b, "number or string", R, "setKeyForLinkData:key"); if (null !== a) { var c = this.ol; if ("" !== c) if (this.vh(a)) { var d = w.tb(a, c); d !== b && null === this.Rp(b) && (w.La(a, c, b), this.cd.remove(d), this.cd.add(b, a), ug(this, "linkKey", Of, c, a, d, b), "string" === typeof c && this.Hb(a, c)) } else w.La(a, c, b) } }; w.defineProperty(R, { lL: "makeUniqueLinkKeyFunction" }, function () { return this.$o }, function (a) { var b = this.$o; b !== a && (null !== a && w.j(a, "function", R, "makeUniqueLinkKeyFunction"), this.$o = a, this.h("makeUniqueLinkKeyFunction", b, a)) }); R.prototype.findLinkDataForKey = R.prototype.Rp = function (a) { null === a && w.k("GraphLinksModel.findLinkDataForKey:key must not be null"); return void 0 !== a && wg(a) ? this.cd.ja(a) : null }; R.prototype.makeLinkDataKeyUnique = R.prototype.JA = function (a) { if (null !== a) { var b = this.ol; if ("" !== b) { var c = this.xf(a); if (void 0 === c || this.cd.contains(c)) { var d = this.$o; if (null !== d && (c = d(this, a), void 0 !== c && null !== c && !this.cd.contains(c))) { w.La(a, b, c); return } if ("string" === typeof c) { for (d = 2; this.cd.contains(c + d);)d++; w.La(a, b, c + d) } else if (void 0 === c || "number" === typeof c) { for (d = -this.cd.count - 1; this.cd.contains(d);)d--; w.La(a, b, d) } else w.k("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: " + c) } } } }; R.prototype.containsLinkData = R.prototype.vh = function (a) { return null === a ? !1 : this.Qi.contains(a) }; R.prototype.addLinkData = R.prototype.wt = function (a) { null !== a && (w.Vp(a), this.vh(a) || Zg(this, a, !0)) }; function Zg(a, b, c) { if ("" !== a.yj) { var d = a.xf(b); if (void 0 !== d && a.cd.ja(d) === b) return; a.JA(b); d = a.xf(b); if (void 0 === d) { w.k("GraphLinksModel.makeLinkDataKeyUnique failed on " + b + ". Data not added to model."); return } a.cd.add(d, b) } a.Qi.add(b); d = null; c && (d = w.Za(a.ff), w.sh(a.ff, d, b)); ug(a, "linkDataArray", Qf, "linkDataArray", a, null, b, null, d); Yg(a, b) } R.prototype.addLinkDataCollection = function (a) { if (w.isArray(a)) for (var b = w.Za(a), c = 0; c < b; c++)this.wt(w.Ba(a, c)); else for (a = a.i; a.next();)this.wt(a.value) }; R.prototype.removeLinkData = R.prototype.$x = function (a) { null !== a && $g(this, a, !0) }; function $g(a, b, c) { a.Qi.remove(b); var d = a.xf(b); void 0 !== d && a.cd.remove(d); d = null; if (c) { d = w.Gl(a.ff, b); if (0 > d) return; w.Kg(a.ff, d) } ug(a, "linkDataArray", Rf, "linkDataArray", a, b, null, d, null); c = a.Ul(b); Tg(a, c, b); c = a.Vl(b); Tg(a, c, b); d = a.Ck(b); if (w.isArray(d)) for (var e = w.Za(d), f = 0; f < e; f++)c = w.Ba(d, f), Tg(a, c, b) } R.prototype.removeLinkDataCollection = function (a) { if (w.isArray(a)) for (var b = w.Za(a), c = 0; c < b; c++)this.$x(w.Ba(a, c)); else for (a = a.i; a.next();)this.$x(a.value) }; function Yg(a, b) { var c = a.Ul(b), c = a.Mn(c); null === a.ve(c) && Sg(a, c, b); c = a.Vl(b); c = a.Mn(c); null === a.ve(c) && Sg(a, c, b); var d = a.Ck(b); if (w.isArray(d)) for (var e = w.Za(d), f = 0; f < e; f++)c = w.Ba(d, f), null === a.ve(c) && Sg(a, c, b) } w.defineProperty(R, { EK: "copyLinkDataFunction" }, function () { return this.to }, function (a) { var b = this.to; b !== a && (null !== a && w.j(a, "function", R, "copyLinkDataFunction"), this.to = a, this.h("copyLinkDataFunction", b, a)) }); R.prototype.copyLinkData = R.prototype.Zw = function (a) { if (null === a) return null; var b = null, b = this.to, b = null !== b ? b(a, this) : Ug(this, a, !0); w.Pa(b) && (w.nc(b), "" !== this.Wh && w.La(b, this.Wh, void 0), "" !== this.Xh && w.La(b, this.Xh, void 0), "" !== this.zg && w.La(b, this.zg, [])); return b }; w.defineProperty(R, { hq: "nodeIsGroupProperty" }, function () { return this.dp }, function (a) { var b = this.dp; b !== a && (vg(a, R, "nodeIsGroupProperty"), this.dp = a, this.h("nodeIsGroupProperty", b, a)) }); R.prototype.isGroupForNodeData = R.prototype.CA = function (a) { if (null === a) return !1; var b = this.dp; return "" === b ? !1 : w.tb(a, b) ? !0 : !1 }; w.defineProperty(R, { vu: "nodeGroupKeyProperty" }, function () { return this.lh }, function (a) { var b = this.lh; b !== a && (vg(a, R, "nodeGroupKeyProperty"), this.lh = a, this.h("nodeGroupKeyProperty", b, a)) }); w.defineProperty(R, { sn: "copiesGroupKeyOfNodeData" }, function () { return this.Zq }, function (a) { this.Zq !== a && (w.j(a, "boolean", R, "copiesGroupKeyOfNodeData"), this.Zq = a) }); R.prototype.getGroupKeyForNodeData = R.prototype.An = function (a) { if (null !== a) { var b = this.lh; if ("" !== b && (b = w.tb(a, b), void 0 !== b)) { if (wg(b)) return b; w.k("GroupKey value for node data " + a + " is not a number or a string: " + b) } } }; R.prototype.setGroupKeyForNodeData = R.prototype.jB = function (a, b) { null === b && (b = void 0); void 0 === b || wg(b) || w.Bd(b, "number or string", R, "setGroupKeyForNodeData:key"); if (null !== a) { var c = this.lh; if ("" !== c) if (this.He(a)) { var d = w.tb(a, c); d !== b && (Tg(this, d, a), w.La(a, c, b), null === this.ve(b) && Sg(this, b, a), ug(this, "nodeGroupKey", Of, c, a, d, b), "string" === typeof c && this.Hb(a, c)) } else w.La(a, c, b) } }; R.prototype.copyNodeData = function (a) { if (null === a) return null; a = F.prototype.copyNodeData.call(this, a); this.sn || "" === this.lh || void 0 === w.tb(a, this.lh) || w.La(a, this.lh, void 0); return a }; R.prototype.setDataProperty = function (a, b, c) { if (this.He(a)) if (b === this.bm) this.ly(a, c); else { if (b === this.Tn) { this.jy(a, c); return } if (b === this.vu) { this.jB(a, c); return } b === this.hq && w.k("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: " + b) } else if (this.vh(a)) { if (b === this.Kn) { this.hB(a, c); return } if (b === this.Ln) { this.nB(a, c); return } if (b === this.mu) { this.iB(a, c); return } if (b === this.ou) { this.oB(a, c); return } if (b === this.yj) { this.jG(a, c); return } if (b === this.lu) { this.iG(a, c); return } if (b === this.nu) { this.kG(a, c); return } } else !Xg && a instanceof G && (Xg = !0, w.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), w.trace(" Is that really your intent?")); var d = w.tb(a, b); d !== c && (w.La(a, b, c), this.WA(a, b, d, c)) }; g = R.prototype; g.Bu = function (a, b) { F.prototype.Bu.call(this, a, b); for (var c = this.Gc.i; c.next();)this.bB(c.value, a, b); for (c = this.Qi.i; c.next();) { var d = c.value, e = a, f = b; if (this.Ul(d) === e) { var h = this.Wh; w.La(d, h, f); ug(this, "linkFromKey", Of, h, d, e, f); "string" === typeof h && this.Hb(d, h) } this.Vl(d) === e && (h = this.Xh, w.La(d, h, f), ug(this, "linkToKey", Of, h, d, e, f), "string" === typeof h && this.Hb(d, h)); h = this.Ck(d); if (w.isArray(h)) for (var k = w.Za(h), l = this.zg, m = 0; m < k; m++)w.Ba(h, m) === e && (w.qE(h, m, f), ug(this, "linkLabelKeys", Qf, l, d, e, f, m, m)) } }; g.bB = function (a, b, c) { if (this.An(a) === b) { var d = this.lh; w.La(a, d, c); ug(this, "nodeGroupKey", Of, d, a, b, c); "string" === typeof d && this.Hb(a, d) } }; g.BB = function () { F.prototype.BB.call(this); for (var a = this.Qg, b = w.Za(a), c = 0; c < b; c++) { var d = w.Ba(a, c); Yg(this, d) } }; g.lq = function (a) { F.prototype.lq.call(this, a); a = this.sb(a); var b = zg(this, a); if (null !== b) { for (var c = new H(Object), b = b.i; b.next();) { var d = b.value; if (this.He(d)) { if (this.An(d) === a) { var e = this.lh; ug(this, "nodeGroupKey", Of, e, d, a, a); "string" === typeof e && this.Hb(d, e); c.add(d) } } else if (this.Ul(d) === a && (e = this.Wh, ug(this, "linkFromKey", Of, e, d, a, a), "string" === typeof e && this.Hb(d, e), c.add(d)), this.Vl(d) === a && (e = this.Xh, ug(this, "linkToKey", Of, e, d, a, a), "string" === typeof e && this.Hb(d, e), c.add(d)), e = this.Ck(d), w.isArray(e)) for (var f = w.Za(e), h = this.zg, k = 0; k < f; k++)w.Ba(e, k) === a && (ug(this, "linkLabelKeys", Qf, h, d, a, a, k, k), c.add(d)) } for (c = c.i; c.next();)Tg(this, a, c.value) } }; g.kq = function (a) { F.prototype.kq.call(this, a); var b = this.An(a); null === this.ve(b) && Sg(this, b, a) }; g.Qu = function (a) { F.prototype.Qu.call(this, a); var b = this.An(a); Tg(this, b, a) }; w.defineProperty(R, { lu: "linkCategoryProperty" }, function () { return this.Jm }, function (a) { var b = this.Jm; b !== a && (vg(a, R, "linkCategoryProperty"), this.Jm = a, this.h("linkCategoryProperty", b, a)) }); R.prototype.getCategoryForLinkData = R.prototype.sx = function (a) { if (null === a) return ""; var b = this.Jm; if ("" === b) return ""; b = w.tb(a, b); if (void 0 === b) return ""; if ("string" === typeof b) return b; w.k("getCategoryForLinkData found a non-string category for " + a + ": " + b); return "" }; R.prototype.setCategoryForLinkData = R.prototype.iG = function (a, b) { w.j(b, "string", R, "setCategoryForLinkData:cat"); if (null !== a) { var c = this.Jm; if ("" !== c) if (this.vh(a)) { var d = w.tb(a, c); void 0 === d && (d = ""); d !== b && (w.La(a, c, b), ug(this, "linkCategory", Of, c, a, d, b), "string" === typeof c && this.Hb(a, c)) } else w.La(a, c, b) } }; function ag(a) { 1 < arguments.length && w.k("TreeModel constructor can only take one optional argument, the Array of node data."); F.call(this); this.mh = "parent"; this.$q = !1; this.Sm = "parentLinkCategory"; void 0 !== a && (this.fg = a) } w.Ka(ag, F); w.ga("TreeModel", ag); ag.prototype.cloneProtected = function (a) { F.prototype.cloneProtected.call(this, a); a.mh = this.mh; a.$q = this.$q; a.Sm = this.Sm }; ag.prototype.toString = function (a) { void 0 === a && (a = 0); if (2 <= a) return this.uB(); var b = ("" !== this.name ? this.name : "") + " TreeModel"; if (0 < a) { b += "\n node data:"; a = this.fg; for (var c = w.Za(a), d = 0; d < c; d++)var e = w.Ba(a, d), b = b + (" " + this.sb(e) + ":" + Sf(e)) } return b }; ag.prototype.eo = function () { var a = F.prototype.eo.call(this), b = ""; "parent" !== this.wu && "string" === typeof this.wu && (b += ',\n "nodeParentKeyProperty": ' + this.quote(this.wu)); return a + b }; ag.prototype.zu = function (a) { F.prototype.zu.call(this, a); a.nodeParentKeyProperty && (this.wu = a.nodeParentKeyProperty) }; ag.prototype.Mn = function (a) { return a }; w.defineProperty(ag, { wu: "nodeParentKeyProperty" }, function () { return this.mh }, function (a) { var b = this.mh; b !== a && (vg(a, ag, "nodeParentKeyProperty"), this.mh = a, this.h("nodeParentKeyProperty", b, a)) }); w.defineProperty(ag, { tn: "copiesParentKeyOfNodeData" }, function () { return this.$q }, function (a) { this.$q !== a && (w.j(a, "boolean", ag, "copiesParentKeyOfNodeData"), this.$q = a) }); ag.prototype.getParentKeyForNodeData = ag.prototype.Cn = function (a) { if (null !== a) { var b = this.mh; if ("" !== b && (b = w.tb(a, b), void 0 !== b)) { if (wg(b)) return b; w.k("ParentKey value for node data " + a + " is not a number or a string: " + b) } } }; ag.prototype.setParentKeyForNodeData = ag.prototype.si = function (a, b) { null === b && (b = void 0); void 0 === b || wg(b) || w.Bd(b, "number or string", ag, "setParentKeyForNodeData:key"); if (null !== a) { var c = this.mh; if ("" !== c) if (b = this.Mn(b), this.He(a)) { var d = w.tb(a, c); d !== b && (Tg(this, d, a), w.La(a, c, b), null === this.ve(b) && Sg(this, b, a), ug(this, "nodeParentKey", Of, c, a, d, b), "string" === typeof c && this.Hb(a, c)) } else w.La(a, c, b) } }; w.defineProperty(ag, { DL: "parentLinkCategoryProperty" }, function () { return this.Sm }, function (a) { var b = this.Sm; b !== a && (vg(a, ag, "parentLinkCategoryProperty"), this.Sm = a, this.h("parentLinkCategoryProperty", b, a)) }); ag.prototype.getParentLinkCategoryForNodeData = ag.prototype.bI = function (a) { if (null === a) return ""; var b = this.Sm; if ("" === b) return ""; b = w.tb(a, b); if (void 0 === b) return ""; if ("string" === typeof b) return b; w.k("getParentLinkCategoryForNodeData found a non-string category for " + a + ": " + b); return "" }; ag.prototype.setParentLinkCategoryForNodeData = ag.prototype.EJ = function (a, b) { w.j(b, "string", ag, "setParentLinkCategoryForNodeData:cat"); if (null !== a) { var c = this.Sm; if ("" !== c) if (this.He(a)) { var d = w.tb(a, c); void 0 === d && (d = ""); d !== b && (w.La(a, c, b), ug(this, "parentLinkCategory", Of, c, a, d, b), "string" === typeof c && this.Hb(a, c)) } else w.La(a, c, b) } }; ag.prototype.copyNodeData = function (a) { if (null === a) return null; a = F.prototype.copyNodeData.call(this, a); this.tn || "" === this.mh || void 0 === w.tb(a, this.mh) || w.La(a, this.mh, void 0); return a }; ag.prototype.setDataProperty = function (a, b, c) { if (this.He(a)) if (b === this.bm) this.ly(a, c); else { if (b === this.Tn) { this.jy(a, c); return } if (b === this.wu) { this.si(a, c); return } } else !Xg && a instanceof G && (Xg = !0, w.trace('TreeModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), w.trace(" Is that really your intent?")); var d = w.tb(a, b); d !== c && (w.La(a, b, c), this.WA(a, b, d, c)) }; g = ag.prototype; g.Bu = function (a, b) { F.prototype.Bu.call(this, a, b); for (var c = this.Gc.i; c.next();)this.bB(c.value, a, b) }; g.bB = function (a, b, c) { if (this.Cn(a) === b) { var d = this.mh; w.La(a, d, c); ug(this, "nodeParentKey", Of, d, a, b, c); "string" === typeof d && this.Hb(a, d) } }; g.lq = function (a) { F.prototype.lq.call(this, a); a = this.sb(a); var b = zg(this, a); if (null !== b) { for (var c = new H(Object), b = b.i; b.next();) { var d = b.value; if (this.He(d) && this.Cn(d) === a) { var e = this.mh; ug(this, "nodeParentKey", Of, e, d, a, a); "string" === typeof e && this.Hb(d, e); c.add(d) } } for (c = c.i; c.next();)Tg(this, a, c.value) } }; g.kq = function (a) { F.prototype.kq.call(this, a); var b = this.Cn(a), b = this.Mn(b); null === this.ve(b) && Sg(this, b, a) }; g.Qu = function (a) { F.prototype.Qu.call(this, a); var b = this.Cn(a); Tg(this, b, a) }; function ah(a, b, c) { w.nc(this); this.Q = !1; void 0 === a ? a = "" : w.j(a, "string", ah, "constructor:targetprop"); void 0 === b ? b = a : w.j(b, "string", ah, "constructor:sourceprop"); void 0 === c ? c = null : null !== c && w.j(c, "function", ah, "constructor:conv"); this.LD = -1; this.Gg = null; this.xp = a; this.wp = this.jt = 0; this.Aw = null; this.Qr = !1; this.np = b; this.Wq = c; this.js = bh; this.Pq = null; this.dz = new I } w.ga("Binding", ah); ah.prototype.copy = function () { var a = new ah; a.xp = this.xp; a.jt = this.jt; a.wp = this.wp; a.Aw = this.Aw; a.Qr = this.Qr; a.np = this.np; a.Wq = this.Wq; a.js = this.js; a.Pq = this.Pq; return a }; var bh; ah.OneWay = bh = w.p(ah, "OneWay", 1); var ch; ah.TwoWay = ch = w.p(ah, "TwoWay", 2); ah.parseEnum = function (a, b) { w.j(a, "function", ah, "parseEnum:ctor"); w.mb(b, a, ah, "parseEnum:defval"); return function (c) { c = pa(a, c); return null === c ? b : c } }; ah.prototype.ic = function (a) { a.Ee === ah ? this.mode = a : w.Ej(this, a) }; var Sf; ah.toString = Sf = function (a) { var b = a; w.Pa(a) && (a.text ? b = a.text : a.name ? b = a.name : void 0 !== a.key ? b = a.key : void 0 !== a.id ? b = a.id : a.constructor === Object && (a.Text ? b = a.Text : a.Name ? b = a.Name : void 0 !== a.Key ? b = a.Key : void 0 !== a.Id ? b = a.Id : void 0 !== a.ID && (b = a.ID))); return void 0 === b ? "undefined" : null === b ? "null" : b.toString() }; ah.prototype.toString = function () { return "Binding(" + this.oy + ":" + this.nG + (-1 !== this.im ? " " + this.im : "") + " " + this.mode.name + ")" }; ah.prototype.freeze = function () { this.Q = !0; return this }; ah.prototype.Qa = function () { this.Q = !1; return this }; w.defineProperty(ah, { im: null }, function () { return this.LD }, function (a) { this.Q && w.la(this); w.j(a, "number", ah, "targetId"); this.LD = a }); w.defineProperty(ah, { oy: "targetProperty" }, function () { return this.xp }, function (a) { this.Q && w.la(this); w.j(a, "string", ah, "targetProperty"); this.xp = a }); w.defineProperty(ah, { xq: "sourceName" }, function () { return this.Aw }, function (a) { this.Q && w.la(this); null !== a && w.j(a, "string", ah, "sourceName"); this.Aw = a; null !== a && (this.Qr = !1) }); w.defineProperty(ah, { Dx: "isToModel" }, function () { return this.Qr }, function (a) { this.Q && w.la(this); w.j(a, "boolean", ah, "isToModel"); this.Qr = a }); w.defineProperty(ah, { nG: "sourceProperty" }, function () { return this.np }, function (a) { this.Q && w.la(this); w.j(a, "string", ah, "sourceProperty"); this.np = a }); w.defineProperty(ah, { AH: "converter" }, function () { return this.Wq }, function (a) { this.Q && w.la(this); null !== a && w.j(a, "function", ah, "converter"); this.Wq = a }); w.defineProperty(ah, { oH: "backConverter" }, function () { return this.Pq }, function (a) { this.Q && w.la(this); null !== a && w.j(a, "function", ah, "backConverter"); this.Pq = a }); w.defineProperty(ah, { mode: "mode" }, function () { return this.js }, function (a) { this.Q && w.la(this); w.mb(a, ah, ah, "mode"); this.js = a }); ah.prototype.makeTwoWay = ah.prototype.QI = function (a) { void 0 === a && (a = null); null !== a && w.j(a, "function", ah, "makeTwoWay"); this.mode = ch; this.oH = a; return this }; ah.prototype.ofObject = ah.prototype.Ox = function (a) { void 0 === a && (a = ""); this.xq = a; this.Dx = !1; return this }; ah.prototype.ofModel = function () { this.xq = null; this.Dx = !0; return this }; function dh(a, b, c) { a = a.xq; var d = null; return d = null === a || "" === a ? b : "/" === a ? c.U : "." === a ? c : ".." === a ? c.O : b.xd(a) } ah.prototype.updateTarget = ah.prototype.CG = function (a, b, c) { var d = this.np; if (void 0 === c || "" === d || d === c) { c = this.xp; var e = this.Wq; if (null === e && "" === c) w.trace("Binding error: target property is the empty string: " + this.toString()); else { var f = b; "" !== d && (f = w.tb(b, d)); if (void 0 !== f) if (null === e) "" !== c && w.La(a, c, f); else try { if ("" !== c) { var h = e(f, a); w.La(a, c, h) } else e(f, a) } catch (k) { } } } }; ah.prototype.updateSource = ah.prototype.py = function (a, b, c, d) { if (this.js === ch) { var e = this.xp; if (void 0 === c || e === c) { c = this.np; var f = this.Pq, h = a; "" !== e && (h = w.tb(a, e)); if (void 0 !== h && !this.dz.contains(a)) try { this.dz.add(a); var k = null !== d ? d.g : null, l = null !== k ? k.ba : null; if (null === f) if ("" !== c) null !== l ? l.setDataProperty(b, c, h) : w.La(b, c, h); else { if (null !== l && null !== d && 0 <= d.ju && null !== d.O && Array.isArray(d.O.cq)) { var m = d.ju, n = d.O.cq; l.SF(n, m); l.yA(n, m, h) } } else try { if ("" !== c) { var p = f(h, b, l); null !== l ? l.setDataProperty(b, c, p) : w.La(b, c, p) } else p = f(h, b, l), void 0 !== p && null !== l && null !== d && 0 <= d.ju && null !== d.O && Array.isArray(d.O.cq) && (m = d.ju, n = d.O.cq, l.SF(n, m), l.yA(n, m, p)) } catch (q) { } } finally { this.dz.remove(a) } } } }; function bg() { this.IG = (new H(Ef)).freeze(); this.Sb = ""; this.OC = !1 } w.ga("Transaction", bg); bg.prototype.toString = function (a) { var b = "Transaction: " + this.name + " " + this.Uf.count.toString() + (this.du ? "" : ", incomplete"); if (void 0 !== a && 0 < a) { a = this.Uf.count; for (var c = 0; c < a; c++) { var d = this.Uf.ea(c); null !== d && (b += "\n " + d.toString()) } } return b }; bg.prototype.clear = bg.prototype.clear = function () { var a = this.Uf; a.Qa(); for (var b = a.count - 1; 0 <= b; b--) { var c = a.ea(b); null !== c && c.clear() } a.clear(); a.freeze() }; bg.prototype.canUndo = bg.prototype.canUndo = function () { return this.du }; bg.prototype.undo = bg.prototype.undo = function () { if (this.canUndo()) for (var a = this.Uf.count - 1; 0 <= a; a--) { var b = this.Uf.ea(a); null !== b && b.undo() } }; bg.prototype.canRedo = bg.prototype.canRedo = function () { return this.du }; bg.prototype.redo = bg.prototype.redo = function () { if (this.canRedo()) for (var a = this.Uf.count, b = 0; b < a; b++) { var c = this.Uf.ea(b); null !== c && c.redo() } }; w.u(bg, { Uf: "changes" }, function () { return this.IG }); w.defineProperty(bg, { name: "name" }, function () { return this.Sb }, function (a) { this.Sb = a }); w.defineProperty(bg, { du: "isComplete" }, function () { return this.OC }, function (a) { this.OC = a }); function Tf() { this.uz = new I(F); this.ef = !1; this.MG = (new H(bg)).freeze(); this.fh = -1; this.cD = 999; this.Nf = !1; this.rv = null; this.Al = 0; this.ZB = !1; this.kh = (new H("string")).freeze(); this.cp = new H("number"); this.ez = !0; this.oz = !1 } w.ga("UndoManager", Tf); Tf.prototype.toString = function (a) { for (var b = "UndoManager " + this.rj + "<" + this.history.count + "<=" + this.CF, b = b + "[", c = this.HF.count, d = 0; d < c; d++)0 < d && (b += " "), b += this.HF.ea(d); b += "]"; if (void 0 !== a && 0 < a) for (c = this.history.count, d = 0; d < c; d++)b += "\n " + this.history.ea(d).toString(a - 1); return b }; Tf.prototype.clear = Tf.prototype.clear = function () { var a = this.history; a.Qa(); for (var b = a.count - 1; 0 <= b; b--) { var c = a.ea(b); null !== c && c.clear() } a.clear(); this.fh = -1; a.freeze(); this.Nf = !1; this.rv = null; this.Al = 0; this.kh.Qa(); this.kh.clear(); this.kh.freeze(); this.cp.clear() }; Tf.prototype.addModel = Tf.prototype.gH = function (a) { this.uz.add(a) }; Tf.prototype.removeModel = Tf.prototype.pJ = function (a) { this.uz.remove(a) }; Tf.prototype.startTransaction = Tf.prototype.Pb = function (a) { void 0 === a && (a = ""); null === a && (a = ""); if (this.ab) return !1; !0 === this.ez && (this.ez = !1, this.Al++ , this.ed("StartingFirstTransaction", a, this.mj), 0 < this.Al && this.Al--); this.isEnabled && (this.kh.Qa(), this.kh.add(a), this.kh.freeze(), null === this.mj ? this.cp.add(0) : this.cp.add(this.mj.Uf.count)); this.Al++; var b = 1 === this.Jh; b && this.ed("StartedTransaction", a, this.mj); return b }; Tf.prototype.commitTransaction = Tf.prototype.wd = function (a) { void 0 === a && (a = ""); return eh(this, !0, a) }; Tf.prototype.rollbackTransaction = Tf.prototype.mq = function () { return eh(this, !1, "") }; function eh(a, b, c) { if (a.ab) return !1; a.Xz && 1 > a.Jh && w.trace("Ending transaction without having started a transaction: " + c); var d = 1 === a.Jh; d && b && a.ed("CommittingTransaction", c, a.mj); var e = 0; if (0 < a.Jh && (a.Al-- , a.isEnabled)) { var f = a.kh.count; 0 < f && ("" === c && (c = a.kh.ea(0)), a.kh.Qa(), a.kh.$c(f - 1), a.kh.freeze()); f = a.cp.count; 0 < f && (e = a.cp.ea(f - 1), a.cp.$c(f - 1)) } f = a.mj; if (d) { if (b) { a.oz = !1; if (a.isEnabled && null !== f) { b = f; b.du = !0; b.name = c; d = a.history; d.Qa(); for (e = d.count - 1; e > a.rj; e--)f = d.ea(e), null !== f && f.clear(), d.$c(e), a.oz = !0; e = a.CF; 0 === e && (e = 1); 0 < e && d.count >= e && (f = d.ea(0), null !== f && f.clear(), d.$c(0), a.fh--); d.add(b); a.fh++; d.freeze(); f = b } a.ed("CommittedTransaction", c, f) } else { a.Nf = !0; try { a.isEnabled && null !== f && (f.du = !0, f.undo()) } finally { a.ed("RolledBackTransaction", c, f), a.Nf = !1 } null !== f && f.clear() } a.rv = null; return !0 } if (a.isEnabled && !b && null !== f) { a = e; c = f.Uf; for (b = c.count - 1; b >= a; b--)d = c.ea(b), null !== d && d.undo(), c.Qa(), c.$c(b); c.freeze() } return !1 } Tf.prototype.canUndo = Tf.prototype.canUndo = function () { if (!this.isEnabled || 0 < this.Jh || this.ab) return !1; var a = this.xG; return null !== a && a.canUndo() ? !0 : !1 }; Tf.prototype.undo = Tf.prototype.undo = function () { if (this.canUndo()) { var a = this.xG; try { this.ed("StartingUndo", "Undo", a), this.Nf = !0, this.fh-- , a.undo() } catch (b) { w.trace("undo error: " + b.toString()) } finally { this.Nf = !1, this.ed("FinishedUndo", "Undo", a) } } }; Tf.prototype.canRedo = Tf.prototype.canRedo = function () { if (!this.isEnabled || 0 < this.Jh || this.ab) return !1; var a = this.wG; return null !== a && a.canRedo() ? !0 : !1 }; Tf.prototype.redo = Tf.prototype.redo = function () { if (this.canRedo()) { var a = this.wG; try { this.ed("StartingRedo", "Redo", a), this.Nf = !0, this.fh++ , a.redo() } catch (b) { w.trace("redo error: " + b.toString()) } finally { this.Nf = !1, this.ed("FinishedRedo", "Redo", a) } } }; Tf.prototype.ed = function (a, b, c) { void 0 === c && (c = null); var d = new Ef; d.Ac = Pf; d.propertyName = a; d.object = c; d.oldValue = b; for (a = this.$I; a.next();)b = a.value, d.ba = b, b.Ww(d) }; Tf.prototype.handleChanged = Tf.prototype.eF = function (a) { if (this.isEnabled && !this.ab && !this.skipsEvent(a)) { var b = this.mj; null === b && (this.rv = b = new bg); var c = a.copy(), b = b.Uf; b.Qa(); b.add(c); b.freeze(); this.Xz && 0 >= this.Jh && !this.ez && (a = a.g, null !== a && !1 === a.Hn || w.trace("Change not within a transaction: " + c.toString())) } }; Tf.prototype.skipsEvent = function (a) { if (null === a || 0 > a.Ac.value) return !0; a = a.object; if (a instanceof G) { if (a = a.layer, null !== a && a.Mc) return !0 } else if (a instanceof pg && a.Mc) return !0; return !1 }; w.u(Tf, { $I: "models" }, function () { return this.uz.i }); w.defineProperty(Tf, { isEnabled: "isEnabled" }, function () { return this.ef }, function (a) { this.ef = a }); w.u(Tf, { xG: "transactionToUndo" }, function () { return 0 <= this.rj && this.rj <= this.history.count - 1 ? this.history.ea(this.rj) : null }); w.u(Tf, { wG: "transactionToRedo" }, function () { return this.rj < this.history.count - 1 ? this.history.ea(this.rj + 1) : null }); w.u(Tf, { ab: "isUndoingRedoing" }, function () { return this.Nf }); w.u(Tf, { history: "history" }, function () { return this.MG }); w.defineProperty(Tf, { CF: "maxHistoryLength" }, function () { return this.cD }, function (a) { this.cD = a }); w.u(Tf, { rj: "historyIndex" }, function () { return this.fh }); w.u(Tf, { mj: "currentTransaction" }, function () { return this.rv }); w.u(Tf, { Jh: "transactionLevel" }, function () { return this.Al }); w.u(Tf, { rF: "isInTransaction" }, function () { return 0 < this.Al }); w.defineProperty(Tf, { Xz: "checksTransactionLevel" }, function () { return this.ZB }, function (a) { this.ZB = a }); w.u(Tf, { HF: "nestedTransactionNames" }, function () { return this.kh }); function rg() { 0 < arguments.length && w.jd(rg); w.nc(this); this.$ = null; this.bC = !1; this.wC = this.cC = !0; this.eC = this.fC = this.xC = this.gC = !1; this.rl = this.SB = null; this.dE = 1.05; this.tC = 1; this.pz = NaN; this.ZC = null; this.Rz = NaN; this.Qz = fd; this.cj = null; this.AD = 0 } w.ga("CommandHandler", rg); var fh = null, gh = ""; rg.prototype.toString = function () { return "CommandHandler" }; w.u(rg, { g: "diagram" }, function () { return this.$ }); rg.prototype.Rc = function (a) { this.$ = a }; rg.prototype.doKeyDown = function () { var a = this.g; if (null !== a) { var b = a.R, c = w.Gk ? b.qu : b.control, d = b.shift, e = b.alt, f = b.key; !c || "C" !== f && "Insert" !== f ? c && "X" === f || d && "Del" === f ? this.canCutSelection() && this.cutSelection() : c && "V" === f || d && "Insert" === f ? this.canPasteSelection() && this.pasteSelection() : c && "Y" === f || e && d && "Backspace" === f ? this.canRedo() && this.redo() : c && "Z" === f || e && "Backspace" === f ? this.canUndo() && this.undo() : "Del" === f || "Backspace" === f ? this.canDeleteSelection() && this.deleteSelection() : c && "A" === f ? this.canSelectAll() && this.selectAll() : "Esc" === f ? this.canStopCommand() && this.stopCommand() : "Up" === f ? a.pe && (c ? a.scroll("pixel", "up") : a.scroll("line", "up")) : "Down" === f ? a.pe && (c ? a.scroll("pixel", "down") : a.scroll("line", "down")) : "Left" === f ? a.oe && (c ? a.scroll("pixel", "left") : a.scroll("line", "left")) : "Right" === f ? a.oe && (c ? a.scroll("pixel", "right") : a.scroll("line", "right")) : "PageUp" === f ? d && a.oe ? a.scroll("page", "left") : a.pe && a.scroll("page", "up") : "PageDown" === f ? d && a.oe ? a.scroll("page", "right") : a.pe && a.scroll("page", "down") : "Home" === f ? c && a.pe ? a.scroll("document", "up") : !c && a.oe && a.scroll("document", "left") : "End" === f ? c && a.pe ? a.scroll("document", "down") : !c && a.oe && a.scroll("document", "right") : " " === f ? this.canScrollToPart() && this.scrollToPart() : "Subtract" === f ? this.canDecreaseZoom() && this.decreaseZoom() : "Add" === f ? this.canIncreaseZoom() && this.increaseZoom() : c && "0" === f ? this.canResetZoom() && this.resetZoom() : d && "Z" === f ? this.canZoomToFit() && this.zoomToFit() : c && !d && "G" === f ? this.canGroupSelection() && this.groupSelection() : c && d && "G" === f ? this.canUngroupSelection() && this.ungroupSelection() : b.event && 113 === b.event.which ? this.canEditTextBlock() && this.editTextBlock() : b.event && 93 === b.event.which ? this.canShowContextMenu() && this.showContextMenu() : b.bubbles = !0 : this.canCopySelection() && this.copySelection() } }; rg.prototype.doKeyUp = function () { var a = this.g; null !== a && (a.R.bubbles = !0) }; rg.prototype.stopCommand = function () { var a = this.g; if (null !== a) { var b = a.$a; b instanceof hh && a.vf && a.Xw(); null !== b && b.doCancel() } }; rg.prototype.canStopCommand = function () { return !0 }; rg.prototype.selectAll = function () { var a = this.g; if (null !== a) { a.na(); try { a.ec = "wait"; a.Aa("ChangingSelection"); for (var b = a.Kk; b.next();)b.value.ib = !0; for (var c = a.gg; c.next();)c.value.ib = !0; for (var d = a.links; d.next();)d.value.ib = !0 } finally { a.Aa("ChangedSelection"), a.ec = "" } } }; rg.prototype.canSelectAll = function () { var a = this.g; return null !== a && a.vf }; rg.prototype.deleteSelection = function () { var a = this.g; if (null !== a && !a.Aa("SelectionDeleting", a.selection)) try { a.ec = "wait"; a.Pb("Delete"); a.Aa("ChangingSelection"); for (var b = new I(T), c = a.selection.i; c.next();)ih(b, c.value, !0, this.LH ? Infinity : 0, this.GE, function (a) { return a.canDelete() }); a.aB(b, !0); a.Aa("SelectionDeleted", b) } finally { a.Aa("ChangedSelection"), a.wd("Delete"), a.ec = "" } }; rg.prototype.canDeleteSelection = function () { var a = this.g; return null === a || a.hb || a.Bf || !a.hn || 0 === a.selection.count ? !1 : !0 }; function ih(a, b, c, d, e, f) { void 0 === f && (f = null); if (!(a.contains(b) || null !== f && !f(b) || b instanceof jh)) if (a.add(b), b instanceof U) { if (c && b instanceof V) for (var h = b.Oc; h.next();)ih(a, h.value, c, d, e, f); if (e) for (h = b.ge; h.next();) { var k = h.value; if (!a.contains(k)) { var l = k.V, m = k.Z; null !== l && a.contains(l) && null !== m && a.contains(m) ? ih(a, k, c, d, e, f) : null !== l && null !== m || ih(a, k, c, d, e, f) } } if (1 < d) for (b = b.RE(); b.next();)ih(a, b.value, c, d - 1, e, f) } else if (b instanceof W) for (b = b.Df; b.next();)ih(a, b.value, c, d, e, f) } rg.prototype.Kp = function (a, b, c) { var d = new la(T, T); for (a = a.i; a.next();)kh(this, a.value, b, d, c); if (null !== b) { c = b.ba; a = !1; null !== b.eb.te && (a = b.eb.te.oj); for (var e = new I(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.Z || e.add(l) } else if (c instanceof ag && k instanceof U && null !== k.data) { var l = c, m = k, k = h.key, n = k.Ak(); null !== n && (n = d.ja(n), null !== n ? (l.si(m.data, l.sb(n.data)), l = b.Vf(m.data), k = k.yn(), null !== k && null !== l && f.add(k, l)) : l.si(m.data, void 0)) } } 0 < e.count && b.aB(e, !1); if (0 < f.count) for (c = f.i; c.next();)d.add(c.key, c.value) } if (null !== b && null !== this.g && (b = b.ba, c = b.iH, null !== c)) { var p = new la; d.each(function (a) { null !== a.key.data && p.add(a.key.data, a.value.data) }); c(p, b, this.g.ba) } for (b = d.i; b.next();)b.value.Hb(); return d }; function kh(a, b, c, d, e) { if (null === b || e && !b.canCopy()) return null; if (d.contains(b)) return d.ja(b); var f = null, h = b.data; if (null !== h && null !== c) { var k = c.ba; b instanceof W ? k instanceof R && (h = k.Zw(h), w.Pa(h) && (k.wt(h), f = c.Vf(h))) : (h = k.copyNodeData(h), w.Pa(h) && (k.Dl(h), f = c.xh(h))) } else lh(b), f = b.copy(), null !== f && (null !== c ? c.add(f) : null !== h && null !== a.g && a.BH && (k = a.g.ba, h = f instanceof W && k instanceof R ? k.Zw(h) : k.copyNodeData(h), w.Pa(h) && (f.data = h))); if (!(f instanceof T)) return null; f.ib = !1; f.Pg = !1; d.add(b, f); if (b instanceof U) { for (h = b.ge; h.next();) { k = h.value; if (k.V === b) { var l = d.ja(k); null !== l && (l.V = f) } k.Z === b && (l = d.ja(k), null !== l && (l.Z = f)) } if (b instanceof V && f instanceof V) for (h = f, b = b.Oc; b.next();)k = kh(a, b.value, c, d, e), k instanceof W || null === k || (k.Da = h) } else if (b instanceof W && f instanceof W) for (h = b.V, null !== h && (h = d.ja(h), null !== h && (f.V = h)), h = b.Z, null !== h && (h = d.ja(h), null !== h && (f.Z = h)), b = b.Df; b.next();)h = kh(a, b.value, c, d, e), null !== h && h instanceof U && (h.Wb = f); return f } rg.prototype.copySelection = function () { var a = this.g; if (null !== a) { for (var b = new I(T), a = a.selection.i; a.next();)ih(b, a.value, !0, this.EH ? Infinity : 0, this.CH, function (a) { return a.canCopy() }); this.copyToClipboard(b) } }; rg.prototype.canCopySelection = function () { var a = this.g; return null !== a && a.tk && a.Sz && 0 !== a.selection.count ? !0 : !1 }; rg.prototype.cutSelection = function () { this.copySelection(); this.deleteSelection() }; rg.prototype.canCutSelection = function () { var a = this.g; return null !== a && !a.hb && !a.Bf && a.tk && a.hn && a.Sz && 0 !== a.selection.count ? !0 : !1 }; rg.prototype.copyToClipboard = function (a) { var b = this.g; if (null !== b) { var c = null; if (null === a) fh = null, gh = ""; else { var c = b.ba, d = !1, e = !1, f = null; try { if (c instanceof ag) { var h = c, d = h.tn; h.tn = this.zE } c instanceof R && (h = c, e = h.sn, h.sn = this.yE); f = b.Kp(a, null, !0) } finally { c instanceof ag && (c.tn = d), c instanceof R && (c.sn = e), c = new H(T), c.Jc(f), fh = c, gh = b.ba.Ml } } b.Aa("ClipboardChanged", c) } }; rg.prototype.pasteFromClipboard = function () { var a = new I(T), b = fh; if (null === b) return a; var c = this.g; if (null === c || gh !== c.ba.Ml) return a; var d = c.ba, e = !1, f = !1, h = null; try { if (d instanceof ag) { var k = d, e = k.tn; k.tn = this.zE } d instanceof R && (k = d, f = k.sn, k.sn = this.yE); h = c.Kp(b, c, !1) } finally { for (d instanceof ag && (d.tn = e), d instanceof R && (d.sn = 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 }; rg.prototype.pasteSelection = function (a) { void 0 === a && (a = null); var b = this.g; if (null !== b) try { b.ec = "wait"; b.Pb("Paste"); b.Aa("ChangingSelection"); var c = this.pasteFromClipboard(); 0 < c.count && mh(b); for (var d = c.i; d.next();)d.value.ib = !0; b.Aa("ChangedSelection"); if (null !== a) { var e = b.computePartsBounds(b.selection); if (e.I()) { var f = b.eb.te; null === f && (f = new nh, f.Rc(b)); var h = f.computeEffectiveCollection(b.selection); f.moveParts(h, new z(a.x - e.ka, a.y - e.ra), !1) } } b.Aa("ClipboardPasted", c) } finally { b.wd("Paste"), b.ec = "" } }; rg.prototype.canPasteSelection = function () { var a = this.g; return null === a || a.hb || a.Bf || !a.Dp || !a.Sz || null === fh || gh !== a.ba.Ml ? !1 : !0 }; rg.prototype.undo = function () { var a = this.g; null !== a && a.oa.undo() }; rg.prototype.canUndo = function () { var a = this.g; return null === a || a.hb || a.Bf ? !1 : a.mE && a.oa.canUndo() }; rg.prototype.redo = function () { var a = this.g; null !== a && a.oa.redo() }; rg.prototype.canRedo = function () { var a = this.g; return null === a || a.hb || a.Bf ? !1 : a.mE && a.oa.canRedo() }; rg.prototype.decreaseZoom = function (a) { void 0 === a && (a = 1 / this.uy); w.vd(a, rg, "decreaseZoom:factor"); var b = this.g; null !== b && b.Hl === oh && (a *= b.scale, a < b.Ah || a > b.zh || (b.scale = a)) }; rg.prototype.canDecreaseZoom = function (a) { void 0 === a && (a = 1 / this.uy); w.vd(a, rg, "canDecreaseZoom:factor"); var b = this.g; if (null === b || b.Hl !== oh) return !1; a *= b.scale; return a < b.Ah || a > b.zh ? !1 : b.Vw }; rg.prototype.increaseZoom = function (a) { void 0 === a && (a = this.uy); w.vd(a, rg, "increaseZoom:factor"); var b = this.g; null !== b && b.Hl === oh && (a *= b.scale, a < b.Ah || a > b.zh || (b.scale = a)) }; rg.prototype.canIncreaseZoom = function (a) { void 0 === a && (a = this.uy); w.vd(a, rg, "canIncreaseZoom:factor"); var b = this.g; if (null === b || b.Hl !== oh) return !1; a *= b.scale; return a < b.Ah || a > b.zh ? !1 : b.Vw }; rg.prototype.resetZoom = function (a) { void 0 === a && (a = this.ex); w.vd(a, rg, "resetZoom:newscale"); var b = this.g; null === b || a < b.Ah || a > b.zh || (b.scale = a) }; rg.prototype.canResetZoom = function (a) { void 0 === a && (a = this.ex); w.vd(a, rg, "canResetZoom:newscale"); var b = this.g; return null === b || a < b.Ah || a > b.zh ? !1 : b.Vw }; rg.prototype.zoomToFit = function () { var a = this.g; if (null !== a) { var b = a.scale, c = a.position; b === this.Rz && !isNaN(this.pz) && a.se.L(this.Qz) ? (a.scale = this.pz, a.position = this.ZC, this.Rz = NaN, this.Qz = fd) : (this.pz = b, this.ZC = c.copy(), a.zoomToFit(), this.Rz = a.scale, this.Qz = a.se.copy()) } }; rg.prototype.canZoomToFit = function () { var a = this.g; return null === a ? !1 : a.Vw }; rg.prototype.scrollToPart = function (a) { void 0 === a && (a = null); null !== a && w.G(a, T, rg, "part"); var b = this.g; if (null !== b) { if (null === a) { try { null !== this.cj && (this.cj.next() ? a = this.cj.value : this.cj = null) } catch (c) { this.cj = null } null === a && (0 < b.Wl.count ? this.cj = b.Wl.i : 0 < b.selection.count && (this.cj = b.selection.i), null !== this.cj && this.cj.next() && (a = this.cj.value)) } if (null !== a) { var d = b.Oa; d.Un("Scroll To Part"); var e = this.AJ; if (0 < e) { var f = Fh(this, a, [a]), h = function () { b.Pb(); for (var a = f.pop(); 0 < f.length && a instanceof U && a.tc && (!(a instanceof V) || a.hd);)a = f.pop(); 0 < f.length ? (a instanceof T && b.dG(a.Y), a instanceof U && !a.tc && (a.tc = !0), a instanceof V && !a.hd && (a.hd = !0)) : (a instanceof T && b.sE(a.Y), b.$A("LayoutCompleted", k)); b.wd("Scroll To Part") }, k = function () { setTimeout(h, (d.isEnabled ? d.duration : 0) + e) }; b.Nw("LayoutCompleted", k); h() } else { var l = b.position.copy(); b.sE(a.Y); l.Kc(b.position) && d.Hh() } } } }; function Fh(a, b, c) { if (b.isVisible()) return c; if (b instanceof jh) Fh(a, b.uf, c); else if (b instanceof W) { var d = b.V; null !== d && Fh(a, d, c); b = b.Z; null !== b && Fh(a, b, c) } else b instanceof U && (d = b.Wb, null !== d && Fh(a, d, c), d = b.Ak(), null !== d && (d.tc || d.zq || c.push(d), Fh(a, d, c))), b = b.Da, null !== b && (b.hd || b.ty || c.push(b), Fh(a, b, c)); return c } rg.prototype.canScrollToPart = function (a) { void 0 === a && (a = null); if (null !== a && !(a instanceof T)) return !1; a = this.g; return null === a || 0 === a.selection.count && 0 === a.Wl.count ? !1 : a.oe && a.pe }; rg.prototype.collapseTree = function (a) { void 0 === a && (a = null); var b = this.g; if (null !== b) try { b.Pb("Collapse Tree"); b.Oa.Un("Collapse Tree"); var c = new H(U); if (null !== a && a.tc) a.collapseTree(), c.add(a); else for (var d = b.selection.i; d.next();) { var e = d.value; e instanceof U && (a = e, a.tc && (a.collapseTree(), c.add(a))) } b.Aa("TreeCollapsed", c) } finally { b.wd("Collapse Tree") } }; rg.prototype.canCollapseTree = function (a) { void 0 === a && (a = null); var b = this.g; if (null === b || b.hb) return !1; if (null !== a) { if (!(a instanceof U && a.tc)) return !1; if (0 < a.px().count) return !0 } else for (a = b.selection.i; a.next();)if (b = a.value, b instanceof U && b.tc && 0 < b.px().count) return !0; return !1 }; rg.prototype.expandTree = function (a) { void 0 === a && (a = null); var b = this.g; if (null !== b) try { b.Pb("Expand Tree"); b.Oa.Un("Expand Tree"); var c = new H(U); if (null === a || a.tc) for (var d = b.selection.i; d.next();) { var e = d.value; e instanceof U && (a = e, a.tc || (a.expandTree(), c.add(a))) } else a.expandTree(), c.add(a); b.Aa("TreeExpanded", c) } finally { b.wd("Expand Tree") } }; rg.prototype.canExpandTree = function (a) { void 0 === a && (a = null); var b = this.g; if (null === b || b.hb) return !1; if (null !== a) { if (!(a instanceof U) || a.tc) return !1; if (0 < a.px().count) return !0 } else for (a = b.selection.i; a.next();)if (b = a.value, b instanceof U && !b.tc && 0 < b.px().count) return !0; return !1 }; rg.prototype.groupSelection = function () { var a = this.g; if (null !== a) { var b = a.ba; if (b instanceof R) { var c = this.nE; if (null !== c) { var d = null; try { a.ec = "wait"; a.Pb("Group"); a.Aa("ChangingSelection"); for (var e = new H(T), f = a.selection.i; f.next();) { var h = f.value; h.ee() && h.canGroup() && e.add(h) } for (var k = new H(T), l = e.i; l.next();) { for (var m = l.value, f = !1, n = e.i; n.next();)if (m.qi(n.value)) { f = !0; break } f || k.add(m) } if (0 < k.count) { var p = k.first().Da; if (null !== p) for (; null !== p;) { for (var e = !1, q = k.i; q.next();)if (!q.value.qi(p)) { e = !0; break } if (e) p = p.Da; else break } if (c instanceof V) lh(c), d = c.copy(), null !== d && a.add(d); else if (b.CA(c)) { var r = b.copyNodeData(c); w.Pa(r) && (b.Dl(r), d = a.ox(r)) } if (null !== d) { null !== p && this.isValidMember(p, d) && (d.Da = p); for (var s = k.i; s.next();) { var u = s.value; this.isValidMember(d, u) && (u.Da = d) } a.select(d) } } a.Aa("ChangedSelection"); a.Aa("SelectionGrouped", d) } finally { a.wd("Group"), a.ec = "" } } } } }; rg.prototype.canGroupSelection = function () { var a = this.g; if (null === a || a.hb || a.Bf || !a.Dp || !a.Qw || !(a.ba instanceof R) || null === this.nE) return !1; for (a = a.selection.i; a.next();) { var b = a.value; if (b.ee() && b.canGroup()) return !0 } return !1 }; function Gh(a) { var b = w.cb(); for (a = a.i; a.next();) { var c = a.value; c instanceof W || b.push(c) } a = new I(T); for (var c = b.length, d = 0; d < c; d++) { for (var e = b[d], f = !0, h = 0; h < c; h++)if (e.qi(b[h])) { f = !1; break } f && a.add(e) } w.ua(b); return a } rg.prototype.isValidMember = function (a, b) { if (null === b || a === b || b instanceof W) return !1; if (null !== a) { if (a === b || a.qi(b)) return !1; var c = a.MA; if (null !== c && !c(a, b) || null === a.data && null !== b.data || null !== a.data && null === b.data) return !1 } c = this.MA; return null !== c ? c(a, b) : !0 }; rg.prototype.ungroupSelection = function (a) { void 0 === a && (a = null); var b = this.g; if (null !== b) { var c = b.ba; if (c instanceof R) try { b.ec = "wait"; b.Pb("Ungroup"); b.Aa("ChangingSelection"); var d = new H(V); if (null !== a) d.add(a); else for (var e = b.selection.i; e.next();) { var f = e.value; f instanceof V && (a = f, a.canUngroup() && d.add(a)) } if (0 < d.count) { b.Xw(); for (var h = d.i; h.next();) { var k = h.value; k.expandSubGraph(); var l = k.Da, m = null !== l && null !== l.data ? c.sb(l.data) : void 0, n = new H(T); n.Jc(k.Oc); for (var p = n.i; p.next();) { var q = p.value; q.ib = !0; if (!(q instanceof W)) { var r = q.data; null !== r ? c.jB(r, m) : q.Da = l } } b.remove(k) } } b.Aa("ChangedSelection"); b.Aa("SelectionUngrouped", d, n) } finally { b.wd("Ungroup"), b.ec = "" } } }; rg.prototype.canUngroupSelection = function (a) { void 0 === a && (a = null); var b = this.g; if (null === b || b.hb || b.Bf || !b.hn || !b.Uw || !(b.ba instanceof R)) return !1; if (null !== a) { if (!(a instanceof V)) return !1; if (a.canUngroup()) return !0 } else for (a = b.selection.i; a.next();)if (b = a.value, b instanceof V && b.canUngroup()) return !0; return !1 }; rg.prototype.addTopLevelParts = function (a, b) { for (var c = !0, d = Gh(a).i; d.next();) { var e = d.value; null !== e.Da && (!b || this.isValidMember(null, e) ? e.Da = null : c = !1) } return c }; rg.prototype.collapseSubGraph = function (a) { void 0 === a && (a = null); var b = this.g; if (null !== b) try { b.Pb("Collapse SubGraph"); b.Oa.Un("Collapse SubGraph"); var c = new H(V); if (null !== a && a.hd) a.collapseSubGraph(), c.add(a); else for (var d = b.selection.i; d.next();) { var e = d.value; e instanceof V && (a = e, a.hd && (a.collapseSubGraph(), c.add(a))) } b.Aa("SubGraphCollapsed", c) } finally { b.wd("Collapse SubGraph") } }; rg.prototype.canCollapseSubGraph = function (a) { void 0 === a && (a = null); var b = this.g; if (null === b || b.hb) return !1; if (null !== a) return a instanceof V && a.hd ? !0 : !1; for (a = b.selection.i; a.next();)if (b = a.value, b instanceof V && b.hd) return !0; return !1 }; rg.prototype.expandSubGraph = function (a) { void 0 === a && (a = null); var b = this.g; if (null !== b) try { b.Pb("Expand SubGraph"); b.Oa.Un("Expand SubGraph"); var c = new H(V); if (null === a || a.hd) for (var d = b.selection.i; d.next();) { var e = d.value; e instanceof V && (a = e, a.hd || (a.expandSubGraph(), c.add(a))) } else a.expandSubGraph(), c.add(a); b.Aa("SubGraphExpanded", c) } finally { b.wd("Expand SubGraph") } }; rg.prototype.canExpandSubGraph = function (a) { void 0 === a && (a = null); var b = this.g; if (null === b || b.hb) return !1; if (null !== a) return a instanceof V && !a.hd ? !0 : !1; for (a = b.selection.i; a.next();)if (b = a.value, b instanceof V && !b.hd) return !0; return !1 }; rg.prototype.editTextBlock = function (a) { void 0 === a && (a = null); null !== a && w.G(a, Hh, rg, "editTextBlock"); var b = this.g; if (null !== b) { var c = b.eb.sB; 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.Lt(function (a) { return a instanceof Hh && a.jA }) } null !== a && (b.$a = null, c.$g = a, b.$a = c) } } }; rg.prototype.canEditTextBlock = function (a) { void 0 === a && (a = null); var b = this.g; if (null === b || b.hb || b.Bf || !b.Tw || null === b.eb.sB) return !1; if (null !== a) { if (!(a instanceof Hh)) return !1; a = a.U; if (null !== a && a.canEdit()) return !0 } else for (b = b.selection.i; b.next();)if (a = b.value, a.canEdit() && (a = a.Lt(function (a) { return a instanceof Hh && a.jA }), null !== a)) return !0; return !1 }; rg.prototype.showContextMenu = function (a) { var b = this.g; if (null !== b) { var c = b.eb.bA; if (null !== c && (void 0 === a && (a = 0 < b.selection.count ? b.selection.first() : b), a = c.findObjectWithContextMenu(a), null !== a)) { var d = new Bf, e = null; a instanceof G ? e = a.Wa(Hb) : b.zI || (e = b.pb, e = new z(e.x + e.width / 2, e.y + e.height / 2)); null !== e && (d.g = b, d.df = b.yG(e), d.da = e, d.left = !1, d.right = !0, d.up = !0, b.R = d); b.$a = c; Ih(c, !1, a) } } }; rg.prototype.canShowContextMenu = function (a) { var b = this.g; if (null === b) return !1; var c = b.eb.bA; if (null === c) return !1; void 0 === a && (a = 0 < b.selection.count ? b.selection.first() : b); return null === c.findObjectWithContextMenu(a) ? !1 : !0 }; w.defineProperty(rg, { BH: "copiesClipboardData" }, function () { return this.bC }, function (a) { w.j(a, "boolean", rg, "copiesClipboardData"); this.bC = a }); w.defineProperty(rg, { CH: "copiesConnectedLinks" }, function () { return this.cC }, function (a) { w.j(a, "boolean", rg, "copiesConnectedLinks"); this.cC = a }); w.defineProperty(rg, { GE: "deletesConnectedLinks" }, function () { return this.wC }, function (a) { w.j(a, "boolean", rg, "deletesConnectedLinks"); this.wC = a }); w.defineProperty(rg, { EH: "copiesTree" }, function () { return this.gC }, function (a) { w.j(a, "boolean", rg, "copiesTree"); this.gC = a }); w.defineProperty(rg, { LH: "deletesTree" }, function () { return this.xC }, function (a) { w.j(a, "boolean", rg, "deletesTree"); this.xC = a }); w.defineProperty(rg, { zE: "copiesParentKey" }, function () { return this.fC }, function (a) { w.j(a, "boolean", rg, "copiesParentKey"); this.fC = a }); w.defineProperty(rg, { yE: "copiesGroupKey" }, function () { return this.eC }, function (a) { w.j(a, "boolean", rg, "copiesGroupKey"); this.eC = a }); w.defineProperty(rg, { nE: "archetypeGroupData" }, function () { return this.SB }, function (a) { null !== a && w.G(a, Object, rg, "archetypeGroupData"); var b = this.g; null !== b && (b = b.ba, b instanceof R && (a instanceof V || b.CA(a) || w.k("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: " + a))); this.SB = a }); w.defineProperty(rg, { MA: "memberValidation" }, function () { return this.rl }, function (a) { null !== a && w.j(a, "function", rg, "memberValidation"); this.rl = a }); w.defineProperty(rg, { ex: "defaultScale" }, function () { return this.tC }, function (a) { w.vd(a, rg, "defaultScale"); 0 < a || w.k("defaultScale must be larger than zero, not: " + a); this.tC = a }); w.defineProperty(rg, { uy: "zoomFactor" }, function () { return this.dE }, function (a) { w.vd(a, rg, "zoomFactor"); 1 < a || w.k("zoomFactor must be larger than 1.0, not: " + a); this.dE = a }); w.defineProperty(rg, { AJ: "scrollToPartPause" }, function () { return this.AD }, function (a) { w.vd(a, rg, "scrollToPartPause"); this.AD = a }); function qg() { 0 < arguments.length && w.jd(qg); w.nc(this); this.$ = null; this.Sb = ""; this.ef = !0; this.MC = !1; this.YD = null; this.Lw = -1 } w.ga("Tool", qg); qg.prototype.Rc = function (a) { this.$ = a }; qg.prototype.toString = function () { return "" !== this.name ? this.name + " Tool" : w.kf(Object.getPrototypeOf(this)) }; qg.prototype.updateAdornments = function () { }; qg.prototype.canStart = function () { return this.isEnabled }; qg.prototype.doStart = function () { }; qg.prototype.doActivate = function () { this.sa = !0 }; qg.prototype.doDeactivate = function () { this.sa = !1 }; qg.prototype.doStop = function () { }; qg.prototype.doCancel = function () { this.stopTool() }; qg.prototype.stopTool = function () { var a = this.g; null !== a && a.$a === this && (a.$a = null, a.ec = "") }; qg.prototype.doMouseDown = function () { !this.sa && this.canStart() && this.doActivate() }; qg.prototype.doMouseMove = function () { }; qg.prototype.doMouseUp = function () { this.stopTool() }; qg.prototype.doMouseWheel = function () { }; qg.prototype.canStartMultiTouch = function () { return !0 }; qg.prototype.standardPinchZoomStart = function () { var a = this.g; if (null !== a) { var b = a.R, c = b.tx(0, w.xb(NaN, NaN)), d = b.tx(1, w.xb(NaN, NaN)); if (c.I() && d.I() && (this.doCancel(), a.Xt("hasGestureZoom"))) { a.mD = a.scale; var e = d.x - c.x, f = d.y - c.y; a.FD = Math.sqrt(e * e + f * f); b.bubbles = !1 } w.v(c); w.v(d) } }; qg.prototype.standardPinchZoomMove = function () { var a = this.g; if (null !== a) { var b = a.R, c = b.tx(0, w.xb(NaN, NaN)), d = b.tx(1, w.xb(NaN, NaN)); if (c.I() && d.I() && (this.doCancel(), a.Xt("hasGestureZoom"))) { var e = d.x - c.x, f = d.y - c.y, f = Math.sqrt(e * e + f * f) / a.FD, e = new z((Math.min(d.x, c.x) + Math.max(d.x, c.x)) / 2, (Math.min(d.y, c.y) + Math.max(d.y, c.y)) / 2), f = a.mD * f, h = a.ob; if (f !== a.scale && h.canResetZoom(f)) { var k = a.mm; a.mm = e; h.resetZoom(f); a.mm = k } b.bubbles = !1 } w.v(c); w.v(d) } }; qg.prototype.doKeyDown = function () { var a = this.g; null !== a && "Esc" === a.R.key && this.doCancel() }; qg.prototype.doKeyUp = function () { }; qg.prototype.startTransaction = qg.prototype.Pb = function (a) { void 0 === a && (a = this.name); this.Kf = null; var b = this.g; return null === b ? !1 : b.Pb(a) }; qg.prototype.stopTransaction = qg.prototype.Mk = function () { var a = this.g; return null === a ? !1 : null === this.Kf ? a.mq() : a.wd(this.Kf) }; qg.prototype.standardMouseSelect = function () { var a = this.g; if (null !== a && a.vf) { var b = a.R, c = a.Ot(b.da, !1); if (null !== c) if (w.Gk ? b.qu : b.control) { a.Aa("ChangingSelection"); for (b = c; null !== b && !b.canSelect();)b = b.Da; null !== b && (b.ib = !b.ib); a.Aa("ChangedSelection") } else if (b.shift) { if (!c.ib) { a.Aa("ChangingSelection"); for (b = c; null !== b && !b.canSelect();)b = b.Da; null !== b && (b.ib = !0); a.Aa("ChangedSelection") } } else { if (!c.ib) { for (b = c; null !== b && !b.canSelect();)b = b.Da; null !== b && a.select(b) } } else !b.left || (w.Gk ? b.qu : b.control) || b.shift || a.Xw() } }; qg.prototype.standardMouseClick = function (a, b) { void 0 === a && (a = null); void 0 === b && (b = function (a) { return !a.layer.Mc }); var c = this.g; if (null === c) return !1; var d = c.R, e = c.Ke(d.da, a, b); d.Qe = e; Jh(e, d, c); return d.Cc }; function Jh(a, b, c) { b.Cc = !1; if (null === a || a.eu()) { var d = 0; b.left ? d = 1 === b.Ge ? 1 : 2 === b.Ge ? 2 : 1 : b.right && 1 === b.Ge && (d = 3); var e = ""; if (null !== a) { switch (d) { case 1: e = "ObjectSingleClicked"; break; case 2: e = "ObjectDoubleClicked"; break; case 3: e = "ObjectContextClicked" }0 !== d && c.Aa(e, a) } else { switch (d) { case 1: e = "BackgroundSingleClicked"; break; case 2: e = "BackgroundDoubleClicked"; break; case 3: e = "BackgroundContextClicked" }0 !== d && c.Aa(e) } if (null !== a) for (; null !== a;) { c = null; switch (d) { case 1: c = a.click; break; case 2: c = a.It ? a.It : a.click; break; case 3: c = a.aA }if (null !== c && (c(b, a), b.Cc)) break; a = a.O } else { a = null; switch (d) { case 1: a = c.click; break; case 2: a = c.It ? c.It : c.click; break; case 3: a = c.aA }null !== a && a(b) } } } qg.prototype.standardMouseOver = function () { var a = this.g; if (null !== a) { var b = a.R; if (null !== b.g && !0 !== a.Oa.qc) { var c = a.wb; a.wb = !0; var d = a.Ke(b.da, null, null); b.Qe = d; var e = !1; if (d !== a.vo) { var f = a.vo, h = f; a.vo = d; this.doCurrentObjectChanged(f, d); for (b.Cc = !1; null !== f;) { var k = f.su; if (null !== k) { if (d === f) break; if (null !== d && d.Zl(f)) break; k(b, f, d); e = !0; if (b.Cc) break } f = f.O } f = h; for (b.Cc = !1; null !== d;) { k = d.ru; if (null !== k) { if (f === d) break; if (null !== f && f.Zl(d)) break; k(b, d, f); e = !0; if (b.Cc) break } d = d.O } d = a.vo } if (null !== d) { f = d; for (h = ""; null !== f;) { h = f.cursor; if ("" !== h) break; f = f.O } a.ec = h; b.Cc = !1; for (f = d; null !== f;) { d = f.QA; if (null !== d && (d(b, f), e = !0, b.Cc)) break; f = f.O } } else a.ec = "", d = a.QA, null !== d && (d(b), e = !0); e && a.Me(); a.wb = c } } }; qg.prototype.doCurrentObjectChanged = function () { }; qg.prototype.standardMouseWheel = function () { var a = this.g; if (null !== a) { var b = a.R, c = b.Ol; if (0 !== c && a.se.I()) { var d = a.ob, e = a.eb.tu; if ((e === Kh && !b.shift || e === Lh && b.control) && (0 < c ? d.canIncreaseZoom() : d.canDecreaseZoom())) e = a.mm, a.mm = b.df, 0 < c ? d.increaseZoom() : d.decreaseZoom(), a.mm = e, b.bubbles = !1; else if (e === Kh && b.shift || e === Lh && !b.control) { var d = a.position.copy(), e = 0 < c ? c : -c, f = b.event.deltaX, h = b.event.deltaY; void 0 === f || void 0 === h || 0 === f && 0 === h || b.shift ? !b.shift && a.pe ? (f = a.Gu, e = e / 40 * f, 0 < c ? a.scroll("pixel", "up", e) : a.scroll("pixel", "down", e)) : b.shift && a.oe && (f = a.Fu, e = e / 40 * f, 0 < c ? a.scroll("pixel", "left", e) : a.scroll("pixel", "right", e)) : (0 !== f && a.oe && (0 < f ? a.scroll("pixel", "left", -f) : a.scroll("pixel", "right", f)), 0 !== h && a.pe && (0 < h ? a.scroll("pixel", "up", -h) : a.scroll("pixel", "down", h))); a.position.L(d) || (b.bubbles = !1) } } } }; qg.prototype.standardWaitAfter = function (a, b) { w.j(a, "number", qg, "standardWaitAfter:delay"); this.cancelWaitAfter(); var c = this, d = b.copy(); this.Lw = w.setTimeout(function () { c.doWaitAfter(d) }, a) }; qg.prototype.cancelWaitAfter = function () { -1 !== this.Lw && w.clearTimeout(this.Lw); this.Lw = -1 }; qg.prototype.doWaitAfter = function () { }; qg.prototype.findToolHandleAt = function (a, b) { var c = this.g; if (null === c) return null; c = c.Ke(a, function (a) { for (; null !== a && !(a.O instanceof jh);)a = a.O; return a }); return null === c ? null : c.U.ud === b ? c : null }; qg.prototype.isBeyondDragSize = function (a, b) { var c = this.g; if (null === c) return !1; void 0 === a && (a = c.Bc.df); void 0 === b && (b = c.R.df); var d = c.eb.PH, e = d.width, d = d.height; c.Bc.vj && (e += 6, d += 6); return Math.abs(b.x - a.x) > e || Math.abs(b.y - a.y) > d }; w.u(qg, { g: "diagram" }, function () { return this.$ }); w.defineProperty(qg, { name: "name" }, function () { return this.Sb }, function (a) { w.j(a, "string", qg, "name"); this.Sb = a }); w.defineProperty(qg, { isEnabled: "isEnabled" }, function () { return this.ef }, function (a) { w.j(a, "boolean", qg, "isEnabled"); this.ef = a }); w.defineProperty(qg, { sa: "isActive" }, function () { return this.MC }, function (a) { w.j(a, "boolean", qg, "isActive"); this.MC = a }); w.defineProperty(qg, { Kf: "transactionResult" }, function () { return this.YD }, function (a) { null !== a && w.j(a, "string", qg, "transactionResult"); this.YD = a }); function nh() { qg.call(this); 0 < arguments.length && w.jd(nh); this.name = "Dragging"; this.dC = this.QC = !0; this.Kr = this.CC = !1; this.UC = !0; this.fz = (new ia(NaN, NaN)).freeze(); this.gz = xb; this.hz = (new z(NaN, NaN)).freeze(); this.BC = !1; this.hw = this.gw = this.Wy = this.aC = this.AC = this.lC = this.aj = null; this.qr = this.SC = !1; this.qp = new z(NaN, NaN); this.Bw = new z; this.Ew = !1; this.PC = !0; this.Bo = 100; this.Mj = []; this.LG = (new I(T)).freeze() } w.Ka(nh, qg); w.ga("DraggingTool", nh); w.defineProperty(nh, { mF: "isCopyEnabled" }, function () { return this.QC }, function (a) { w.j(a, "boolean", nh, "isCopyEnabled"); this.QC = a }); w.defineProperty(nh, { DH: "copiesEffectiveCollection" }, function () { return this.dC }, function (a) { w.j(a, "boolean", nh, "copiesEffectiveCollection"); this.dC = a }); w.defineProperty(nh, { QH: "dragsTree" }, function () { return this.CC }, function (a) { w.j(a, "boolean", nh, "dragsTree"); this.CC = a }); w.defineProperty(nh, { zx: "isGridSnapEnabled" }, function () { return this.Kr }, function (a) { w.j(a, "boolean", nh, "isGridSnapEnabled"); this.Kr = a }); w.defineProperty(nh, { tI: "isComplexRoutingRealtime" }, function () { return this.PC }, function (a) { w.j(a, "boolean", nh, "isComplexRoutingRealtime"); this.PC = a }); w.defineProperty(nh, { vI: "isGridSnapRealtime" }, function () { return this.UC }, function (a) { w.j(a, "boolean", nh, "isGridSnapRealtime"); this.UC = a }); w.defineProperty(nh, { dF: "gridSnapCellSize" }, function () { return this.fz }, function (a) { w.G(a, ia, nh, "gridSnapCellSize"); this.fz.L(a) || (this.fz = a = a.S()) }); w.defineProperty(nh, { eI: "gridSnapCellSpot" }, function () { return this.gz }, function (a) { w.G(a, L, nh, "gridSnapCellSpot"); this.gz.L(a) || (this.gz = a = a.S()) }); w.defineProperty(nh, { fI: "gridSnapOrigin" }, function () { return this.hz }, function (a) { w.G(a, z, nh, "gridSnapOrigin"); this.hz.L(a) || (this.hz = a = a.S()) }); w.defineProperty(nh, { oj: "dragsLink" }, function () { return this.BC }, function (a) { w.j(a, "boolean", nh, "dragsLink"); this.BC = a }); w.defineProperty(nh, { vn: "currentPart" }, function () { return this.lC }, function (a) { null !== a && w.G(a, T, nh, "currentPart"); this.lC = a }); w.defineProperty(nh, { dc: "copiedParts" }, function () { return this.aC }, function (a) { this.aC = a }); w.defineProperty(nh, { Zb: "draggedParts" }, function () { return this.AC }, function (a) { this.AC = a }); w.u(nh, { UK: "draggingParts" }, function () { return null !== this.dc ? this.dc.Fj() : null !== this.Zb ? this.Zb.Fj() : this.LG }); w.defineProperty(nh, { gd: "draggedLink" }, function () { return this.Wy }, function (a) { null !== a && w.G(a, W, nh, "draggedLink"); this.Wy !== a && (this.Wy = a, null !== a ? (this.gw = a.Lc, this.hw = a.kd) : this.hw = this.gw = null) }); w.defineProperty(nh, { yx: "isDragOutStarted" }, function () { return this.SC }, function (a) { this.SC = a }); w.defineProperty(nh, { Lk: "startPoint" }, function () { return this.Bw }, function (a) { w.G(a, z, nh, "startPoint"); this.Bw.L(a) || (this.Bw = a = a.S()) }); w.defineProperty(nh, { CE: "delay" }, function () { return this.Bo }, function (a) { w.j(a, "number", nh, "delay"); this.Bo = a }); nh.prototype.canStart = function () { if (!this.isEnabled) return !1; var a = this.g; if (null === a || a.hb && !a.At || !a.Fl && !a.tk && !a.At || !a.vf) return !1; var b = a.R; return !b.left || a.$a !== this && (!this.isBeyondDragSize() || b.vj && b.timestamp - a.Bc.timestamp < this.Bo) ? !1 : null !== this.findDraggablePart() }; nh.prototype.findDraggablePart = function () { var a = this.g; if (null === a) return null; a = a.Ot(a.Bc.da, !1); if (null === a) return null; for (; null !== a && !a.canSelect();)a = a.Da; return null !== a && (a.canMove() || a.canCopy()) ? a : null }; nh.prototype.standardMouseSelect = function () { var a = this.g; if (null !== a && a.vf) { var b = a.Ot(a.Bc.da, !1); if (null !== b) { for (; null !== b && !b.canSelect();)b = b.Da; this.vn = b; this.vn.ib || (a.Aa("ChangingSelection"), b = a.R, (w.Gk ? b.qu : b.control) || b.shift || mh(a), this.vn.ib = !0, a.Aa("ChangedSelection")) } } }; nh.prototype.doActivate = function () { var a = this.g; if (null !== a) { null === this.vn && this.standardMouseSelect(); var b = this.vn; null !== b && (b.canMove() || b.canCopy()) && (this.sa = !0, this.qp.set(a.position), Mh(this, a.selection), this.Mj.length = 0, this.Zb = this.computeEffectiveCollection(a.selection), a.Mu = !0, Nh(this, this.Zb), this.Pb("Drag"), this.Lk = a.Bc.da, a.bf = !0, a.At && (this.yx = !0, this.qr = !1, Oh = this, Ph = this.g, this.doSimulatedDragOut())) } }; function Mh(a, b) { if (a.oj) { var c = a.g; null !== c && c.jn && (c.ba instanceof R && 1 === b.count && b.first() instanceof W ? (a.gd = b.first(), a.gd.canRelinkFrom() && a.gd.canRelinkTo() && a.gd.Dt(), a.aj = c.eb.RF, null === a.aj && (a.aj = new Qh, a.aj.Rc(c))) : (a.gd = null, a.aj = null)) } } nh.prototype.computeEffectiveCollection = function (a) { var b = null !== this.g && this.g.$a === this, c = new la(T); if (null === a) return c; for (var d = a.i; d.next();)Rh(this, c, d.value, b); if (null !== this.gd && this.oj) return c; for (d = a.i; d.next();)a = d.value, a instanceof W && (b = a.V, null === b || c.contains(b) ? (b = a.Z, null === b || c.contains(b) || c.remove(a)) : c.remove(a)); return c }; function Sh(a) { return void 0 === a ? new Th(ed) : new Th(a.copy()) } function Rh(a, b, c, d) { if (!b.contains(c) && (!d || c.canMove() || c.canCopy())) if (c instanceof U) { b.add(c, Sh(c.location)); if (c instanceof V) for (var e = c.Oc; e.next();)Rh(a, b, e.value, d); for (e = c.ge; e.next();) { var f = e.value; if (!b.contains(f)) { var h = f.V, k = f.Z; null !== h && b.contains(h) && null !== k && b.contains(k) && Rh(a, b, f, d) } } if (a.QH) for (c = c.RE(); c.next();)Rh(a, b, c.value, d) } else if (c instanceof W) for (f = c, b.add(f, Sh()), c = f.Df; c.next();)Rh(a, b, c.value, d); else c instanceof jh || b.add(c, Sh(c.location)) } nh.prototype.doDeactivate = function () { this.sa = !1; var a = this.g; null !== a && Uh(a); Vh(this); Wh(this, this.Zb); this.Zb = this.vn = null; this.qr = this.yx = !1; if (0 < Xh.count) { for (var b = Xh.length, c = 0; c < b; c++) { var d = Xh.ea(c); Yh(d); Zh(d); Vh(d); null !== d.g && Uh(d.g) } Xh.clear() } Yh(this); this.qp.m(NaN, NaN); Oh = Ph = null; Zh(this); a.bf = !1; a.ec = ""; a.Mu = !1; this.Mk() }; function Vh(a) { var b = a.g; if (null !== b) { var c = b.wb; b.wb = !0; $h(a, b.R, null); b.wb = c } a.Mj.length = 0 } function ni() { var a = Oh; Zh(a); Ai(a); var b = a.g; null !== b && a.qp.I() && (b.position = a.qp); null !== b && Uh(b) } nh.prototype.doCancel = function () { Zh(this); Ai(this); var a = this.g; null !== a && this.qp.I() && (a.position = this.qp); this.stopTool() }; function Nh(a, b) { if (null !== b) { a.Ew = !0; for (var c = b.i; c.next();) { var d = c.key; d instanceof W && (d.gm = !0) } } } function Wh(a, b) { if (null !== b) { for (var c = b.i; c.next();) { var d = c.key; d instanceof W && (d.gm = !1, Bi(d) && d.$b()) } a.Ew = !1 } } nh.prototype.doKeyDown = function () { var a = this.g; null !== a && (a = a.R, null !== a && this.sa && ("Esc" === a.key ? this.doCancel() : this.doMouseMove())) }; nh.prototype.doKeyUp = function () { var a = this.g; null !== a && null !== a.R && this.sa && this.doMouseMove() }; function Ci(a, b) { for (var c = Infinity, d = Infinity, e = -Infinity, f = -Infinity, h = a.i; h.next();) { var k = h.value; if (k.ee() && k.isVisible()) { var l = k.location, k = l.x, l = l.y; isNaN(k) || isNaN(l) || (k < c && (c = k), l < d && (d = l), k > e && (e = k), l > f && (f = l)) } } Infinity === c ? b.m(0, 0, 0, 0) : b.m(c, d, e - c, f - d) } function Di(a, b) { if (null === a.dc) { var c = a.g; if (!(null === c || b && (c.hb || c.Bf)) && null !== a.Zb) { var d = c.oa; d.isEnabled && d.rF ? null !== d.mj && 0 < d.mj.Uf.count && (c.oa.mq(), c.Pb("Drag")) : Ai(a); c.wb = !b; c.Fq = !b; a.Lk = c.Bc.da; d = a.DH ? a.Zb.Fj() : c.selection; d = c.Kp(d, c, !0); for (c = d.i; c.next();)c.value.location = c.key.location; c = w.If(); Ci(d, c); w.Db(c); for (var c = new la(T), e = a.Zb.i; e.next();) { var f = e.key; f.ee() && f.canCopy() && (f = d.ja(f), null !== f && (f.af(), c.add(f, Sh(f.location)))) } for (d = d.i; d.next();)e = d.value, e instanceof W && e.canCopy() && c.add(e, Sh()); a.dc = c; Mh(a, c.Fj()); null !== a.gd && (c = a.gd, d = c.Wn, c.Ik(a.Lk.x - (d.x + d.width / 2), a.Lk.y - (d.y + d.height / 2))) } } } function Zh(a) { var b = a.g; if (null !== b) { if (null !== a.dc && (b.aB(a.dc.Fj(), !1), a.dc = null, null !== a.Zb)) for (var c = a.Zb.i; c.next();)c.key instanceof W && (c.value.point = new z(0, 0)); b.wb = !1; b.Fq = !1; a.Lk = b.Bc.da } } function Yh(a) { if (null !== a.gd) { if (a.oj && null !== a.aj) { var b = a.aj; null !== b.g && (b.g.remove(b.Ud), b.g.remove(b.Vd)) } a.gd = null; a.aj = null } } function Ei(a, b, c) { var d = a.g; if (null !== d) { var e = a.Lk, f = w.K(); f.assign(d.R.da); a.moveParts(b, f.$n(e), c); w.v(f) } } nh.prototype.moveParts = function (a, b, c) { if (null !== a && (w.G(a, la, nh, "moveParts:parts"), 0 !== a.count)) { var d = w.K(), e = w.K(); e.assign(b); isNaN(e.x) && (e.x = 0); isNaN(e.y) && (e.y = 0); (b = this.Ew) || Nh(this, a); for (var f = new H(Fi), h = new H(Ca), k = a.i; k.next();) { var l = k.key; if (l.ee()) { var m = Gi(this, l, a); if (null !== m) f.add(new Fi(l, k.value, m)); else if (!c || l.canMove()) { m = k.value.point; d.assign(m); var n = w.K(), p = this.computeMove(l, d.add(e), a, n); l.location = p; k.value.lG = n.$n(m); w.v(n) } } else k.key instanceof W && h.add(k.Va) } for (c = f.i; c.next();)f = c.value, m = f.info.point, d.assign(m), f.Pc.location = d.add(f.gI.lG); c = w.K(); m = w.K(); for (h = h.i; h.next();)if (k = h.value, f = k.key, f instanceof W) if (f.gm) l = f.V, n = f.Z, null !== this.gd && this.oj ? (k = k.value.point, a.add(f, Sh(e)), l = e.x - k.x, k = e.y - k.y, f.Ik(l, k)) : (null !== l && (c.assign(l.location), p = a.ja(l), null !== p && c.$n(p.point)), null !== n && (m.assign(n.location), p = a.ja(n), null !== p && m.$n(p.point)), null !== l && null !== n ? c.Kc(m) ? (k = k.value.point, l = d, l.assign(c), l.$n(k), a.add(f, Sh(c)), f.Ik(l.x, l.y)) : (f.gm = !1, f.$b()) : (k = k.value.point, n = null !== l ? c : null !== n ? m : e, a.add(f, Sh(n)), l = n.x - k.x, k = n.y - k.y, f.Ik(l, k))); else if (null === f.V || null === f.Z) k = k.value.point, a.add(f, Sh(e)), l = e.x - k.x, k = e.y - k.y, f.Ik(l, k); w.v(d); w.v(e); w.v(c); w.v(m); b || (Hi(this.g), Wh(this, a)) } }; function Gi(a, b, c) { b = b.Da; if (null !== b) { a = Gi(a, b, c); if (null !== a) return a; a = c.ja(b); if (null !== a) return a } return null } function Ai(a) { if (null !== a.Zb) { for (var b = a.g, c = a.Zb.i; c.next();) { var d = c.key; d.ee() && (d.location = c.value.point) } for (c = a.Zb.i; c.next();)if (d = c.key, d instanceof W && d.gm) { var e = c.value.point; a.Zb.add(d, Sh()); d.Ik(-e.x, -e.y) } b.ag() } } nh.prototype.computeMove = function (a, b, c, d) { void 0 === d && (d = new z); d.assign(b); if (null === a) return d; void 0 === c && (c = null); var e = b; if (this.zx && (this.vI || null === c || null !== this.g && this.g.R.up) && (e = w.K(), c = e, c.assign(b), null !== a)) { var f = this.g; if (null !== f) { var h = f.Dn, k = this.dF, f = k.width, k = k.height, l = this.fI, m = l.x, l = l.y, n = this.eI; if (null !== h) { var p = h.ux; isNaN(f) && (f = p.width); isNaN(k) && (k = p.height); h = h.cF; isNaN(m) && (m = h.x); isNaN(l) && (l = h.y) } h = w.xb(0, 0); h.Ku(0, 0, f, k, n); Ka(b.x, b.y, m + h.x, l + h.y, f, k, c); w.v(h) } } c = null !== a.HE ? a.HE(a, b, e) : e; k = a.ZI; f = k.x; isNaN(f) && (f = a.location.x); k = k.y; isNaN(k) && (k = a.location.y); h = a.TI; m = h.x; isNaN(m) && (m = a.location.x); h = h.y; isNaN(h) && (h = a.location.y); d.m(Math.max(f, Math.min(c.x, m)), Math.max(k, Math.min(c.y, h))); e !== b && w.v(e); return d }; function Ii(a, b) { if (null === b) return !0; var c = b.U; return null === c || c instanceof jh || c.layer.Mc || a.Zb && a.Zb.contains(c) || a.dc && a.dc.contains(c) ? !0 : !1 } function Ji(a, b) { var c = a.g; if (null !== c) { a.oj && (null !== a.gd && (a.gd.V = null, a.gd.Z = null), Ki(a, !1)); var d = Li(c, b, null, function (b) { return !Ii(a, b) }), e = c.R; e.Qe = d; var f = c.wb, h = !1; try { c.wb = !0; h = $h(a, e, d); if (!a.sa && null === Oh) return; if (null === d) { var k = c.cJ; null !== k && (k(e), h = !0) } if (!a.sa && null === Oh) return; a.doDragOver(b, d); if (!a.sa && null === Oh) return } finally { c.wb = f, h && c.ag() } (c.oe || c.pe) && c.iA(e.df) } } function $h(a, b, c) { var d = !1, e = a.Mj.length, f = 0 < e ? a.Mj[0] : null; if (c === f) return !1; b.Cc = !1; for (var h = 0; h < e; h++) { var k = a.Mj[h], l = k.bJ; if (null !== l && (l(b, k, c), d = !0, b.Cc)) break } a.Mj.length = 0; if (!a.sa && null === Oh || null === c) return d; for (b.Cc = !1; null !== c;)a.Mj.push(c), c = Mi(c); e = a.Mj.length; for (h = 0; h < e && (k = a.Mj[h], l = k.aJ, null === l || (l(b, k, f), d = !0, !b.Cc)); h++); return d } function Mi(a) { var b = a.O; return null !== b ? b : a instanceof T && !(a instanceof V) && (a = a.Da, null !== a && a.jI) ? a : null } function Ni(a, b, c) { var d = a.aj; if (null === d) return null; var e = a.g.xn(b, d.PF, function (a) { return d.findValidLinkablePort(a, c) }); a = w.K(); for (var f = Infinity, h = null, e = e.i; e.next();) { var k = e.value; if (null !== k.U) { var l = k.Wa(Hb, a), l = b.wf(l); l < f && (h = k, f = l) } } w.v(a); return h } function Ki(a, b) { var c = a.gd; if (null !== c && !(2 > c.qa)) { var d = a.g; if (null !== d && !d.hb) { var e = a.aj; if (null !== e) { var f = null, h = null; null === c.V && (f = Ni(a, c.l(0), !1), null !== f && (h = f.U)); var k = null, l = null; null === c.Z && (k = Ni(a, c.l(c.qa - 1), !0), null !== k && (l = k.U)); e.isValidLink(h, f, l, k) ? b ? (c.Lp = c.l(0), c.Mp = c.l(c.qa - 1), c.gm = !1, c.V = h, null !== f && (c.Og = f.Td), c.Z = l, null !== k && (c.Ih = k.Td), c.Lc !== a.gw && d.Aa("LinkRelinked", c, a.gw), c.kd !== a.hw && d.Aa("LinkRelinked", c, a.hw)) : Oi(e, h, f, l, k) : Oi(e, null, null, null, null) } } } } nh.prototype.doDragOver = function () { }; function Pi(a, b) { var c = a.g; if (null !== c) { a.oj && Ki(a, !0); Vh(a); var d = Li(c, b, null, function (b) { return !Ii(a, b) }), e = c.R; e.Qe = d; if (null !== d) { e.Cc = !1; for (var f = d; null !== f;) { var h = f.NA; if (null !== h && (h(e, f), e.Cc)) break; f = Mi(f) } } else f = c.NA, null !== f && f(e); if (a.sa || null !== Oh) { for (e = (a.dc || a.Zb).i; e.next();)f = e.key, f instanceof U && f.ge.each(function (a) { a.gm = !1 }); a.doDropOnto(b, d); if (a.sa || null !== Oh) { d = w.If(); for (e = c.selection.i; e.next();)f = e.value, f instanceof U && Qi(c, f.getAvoidableRect(d)); w.Db(d) } } } } function Qi(a, b) { var c = !1; a.pb.wk(b) && (c = !0); c = a.mA(b, function (a) { return a.U }, function (a) { return a instanceof W }, !0, function (a) { return a instanceof W }, c); if (0 !== c.count) for (c = c.i; c.next();) { var d = c.value; d.Xl && d.$b() } } nh.prototype.doDropOnto = function () { }; nh.prototype.doMouseMove = function () { if (this.sa) { var a = this.g; null !== a && null !== this.vn && null !== this.Zb && (this.mayCopy() ? (a.ec = "copy", Di(this, !1), Nh(this, this.dc), Ei(this, this.dc, !1), Wh(this, this.dc)) : this.mayMove() ? (a.ec = "default", Zh(this), Ei(this, this.Zb, !0)) : this.mayDragOut() ? (a.ec = "no-drop", Di(this, !1), Ei(this, this.dc, !1)) : Zh(this), Ji(this, a.R.da)) } }; nh.prototype.doMouseUp = function () { if (this.sa) { var a = this.g; if (null !== a) { var b = !1, c = this.mayCopy(); c && null !== this.dc ? (Zh(this), Di(this, !0), Nh(this, this.dc), Ei(this, this.dc, !1), Wh(this, this.dc), null !== this.dc && a.gG(this.dc.Fj())) : (b = !0, Zh(this), this.mayMove() && (Ei(this, this.Zb, !0), Ji(this, a.R.da))); this.qr = !0; Pi(this, a.R.da); if (this.sa) { this.dc = null; if (b && null !== this.Zb) for (b = this.Zb.i; b.next();) { var d = b.key; d instanceof U && (d = d.Da, null === d || null === d.placeholder || this.Zb.contains(d) || d.placeholder.H()) } a.sc(); Wh(this, this.Zb); this.Kf = c ? "Copy" : "Move"; a.Aa(c ? "SelectionCopied" : "SelectionMoved", a.selection) } this.stopTool() } } }; nh.prototype.mayCopy = function () { if (!this.mF) return !1; var a = this.g; if (null === a || a.hb || a.Bf || !a.Dp || !a.tk || (w.Gk ? !a.R.alt : !a.R.control)) return !1; for (a = a.selection.i; a.next();) { var b = a.value; if (b.ee() && b.canCopy()) return !0 } return null !== this.gd && this.oj && this.gd.canCopy() ? !0 : !1 }; nh.prototype.mayDragOut = function () { if (!this.mF) return !1; var a = this.g; if (null === a || !a.At || !a.tk || a.Fl) return !1; for (a = a.selection.i; a.next();) { var b = a.value; if (b.ee() && b.canCopy()) return !0 } return null !== this.gd && this.oj && this.gd.canCopy() ? !0 : !1 }; nh.prototype.mayMove = function () { var a = this.g; if (null === a || a.hb || !a.Fl) return !1; for (a = a.selection.i; a.next();) { var b = a.value; if (b.ee() && b.canMove()) return !0 } return null !== this.gd && this.oj && this.gd.canMove() ? !0 : !1 }; var Xh = new H(nh), Oh = null, Ph = null; nh.prototype.getDraggingSource = function () { return Oh }; nh.prototype.mayDragIn = function () { var a = this.g; if (null === a || !a.lE || a.hb || a.Bf || !a.Dp) return !1; var b = Oh; return null === b || null === b.g || b.g.ba.Ml !== a.ba.Ml ? !1 : !0 }; nh.prototype.doSimulatedDragEnter = function () { if (this.mayDragIn()) { var a = this.g; a.Oa.Hh(); Ri(a); a.Oa.Hh(); a = Oh; null !== a && null !== a.g && (a.g.ec = "copy") } }; nh.prototype.doSimulatedDragLeave = function () { var a = Oh; null !== a && a.doSimulatedDragOut(); this.doCancel() }; nh.prototype.doSimulatedDragOver = function () { var a = this.g; if (null !== a) { var b = Oh; null !== b && null !== b.Zb && this.mayDragIn() && (a.ec = "copy", Si(this, b.Zb.Fj(), !1), Ei(this, this.dc, !1), Ji(this, a.R.da)) } }; nh.prototype.doSimulatedDrop = function () { var a = this.g; if (null !== a) { var b = Oh; if (null !== b) { var c = b.g; b.qr = !0; Zh(this); this.mayDragIn() && (this.Pb("Drop"), Si(this, b.Zb.Fj(), !0), Ei(this, this.dc, !1), null !== this.dc && a.gG(this.dc.Fj()), Pi(this, a.R.da), a.sc(), b = a.selection, null !== this.dc ? this.Kf = "ExternalCopy" : b = new I(T), this.dc = null, a.doFocus(), a.Aa("ExternalObjectsDropped", b, c), this.Mk()) } } }; function Si(a, b, c) { if (null === a.dc) { var d = a.g; if (null !== d && !d.hb && !d.Bf) { d.wb = !c; d.Fq = !c; a.Lk = d.R.da; c = d.Kp(b, d, !0); var e = w.If(); Ci(b, e); var d = e.x + e.width / 2, f = e.y + e.height / 2; w.Db(e); var e = a.Bw, h = new la(T), k = w.K(); for (b = b.i; b.next();) { var l = b.value, m = c.ja(l); l.ee() && l.canCopy() ? (l = l.location, k.m(e.x - (d - l.x), e.y - (f - l.y)), m.location = k, m.af(), h.add(m, Sh(k))) : l instanceof W && l.canCopy() && (m.Ik(e.x - d, e.y - f), h.add(m, Sh())) } w.v(k); a.dc = h; Mh(a, h.Fj()); null !== a.gd && (c = a.gd, d = c.Wn, c.Ik(a.Lk.x - (d.x + d.width / 2), a.Lk.y - (d.y + d.height / 2))) } } } nh.prototype.doSimulatedDragOut = function () { var a = this.g; null !== a && (this.mayCopy() || this.mayMove() ? a.ec = "" : a.ec = "no-drop") }; function Th(a) { this.point = a; this.lG = ed } w.ga("DraggingInfo", Th); function Fi(a, b, c) { this.Pc = a; this.info = b; this.gI = c } function Ti() { 0 < arguments.length && w.jd(Ti); qg.call(this); this.wD = 100; this.XC = !1; var a = new W, b = new Y; b.Yf = !0; b.stroke = "blue"; a.add(b); b = new Y; b.yq = "Standard"; b.fill = "blue"; b.stroke = "blue"; a.add(b); a.Zf = "Tool"; this.RD = a; a = new U; b = new Y; b.Td = ""; b.Cb = "Rectangle"; b.fill = null; b.stroke = "magenta"; b.lb = 2; b.Ca = Ad; a.add(b); a.dm = !1; a.Zf = "Tool"; this.PD = a; this.QD = b; a = new U; b = new Y; b.Td = ""; b.Cb = "Rectangle"; b.fill = null; b.stroke = "magenta"; b.lb = 2; b.Ca = Ad; a.add(b); a.dm = !1; a.Zf = "Tool"; this.SD = a; this.TD = b; this.uD = this.tD = this.pD = this.oD = this.qD = null; this.TC = !0; this.ZG = new la(G, "boolean"); this.xD = this.pl = this.MD = null } w.Ka(Ti, qg); w.ga("LinkingBaseTool", Ti); Ti.prototype.doStop = function () { var a = this.g; null !== a && Uh(a); this.Vg = this.Ug = this.Tg = this.Sg = this.lc = null; this.qy.clear(); this.Hf = null }; w.defineProperty(Ti, { PF: "portGravity" }, function () { return this.wD }, function (a) { w.j(a, "number", Ti, "portGravity"); 0 <= a && (this.wD = a) }); w.defineProperty(Ti, { aq: "isUnconnectedLinkValid" }, function () { return this.XC }, function (a) { w.j(a, "boolean", Ti, "isUnconnectedLinkValid"); this.XC = a }); w.defineProperty(Ti, { Zg: "temporaryLink" }, function () { return this.RD }, function (a) { w.G(a, W, Ti, "temporaryLink"); this.RD = a }); w.defineProperty(Ti, { Ud: "temporaryFromNode" }, function () { return this.PD }, function (a) { w.G(a, U, Ti, "temporaryFromNode"); this.PD = a }); w.defineProperty(Ti, { ao: "temporaryFromPort" }, function () { return this.QD }, function (a) { w.G(a, G, Ti, "temporaryFromPort"); this.QD = a }); w.defineProperty(Ti, { Vd: "temporaryToNode" }, function () { return this.SD }, function (a) { w.G(a, U, Ti, "temporaryToNode"); this.SD = a }); w.defineProperty(Ti, { bo: "temporaryToPort" }, function () { return this.TD }, function (a) { w.G(a, G, Ti, "temporaryToPort"); this.TD = a }); w.defineProperty(Ti, { lc: "originalLink" }, function () { return this.qD }, function (a) { null !== a && w.G(a, W, Ti, "originalLink"); this.qD = a }); w.defineProperty(Ti, { Sg: "originalFromNode" }, function () { return this.oD }, function (a) { null !== a && w.G(a, U, Ti, "originalFromNode"); this.oD = a }); w.defineProperty(Ti, { Tg: "originalFromPort" }, function () { return this.pD }, function (a) { null !== a && w.G(a, G, Ti, "originalFromPort"); this.pD = a }); w.defineProperty(Ti, { Ug: "originalToNode" }, function () { return this.tD }, function (a) { null !== a && w.G(a, U, Ti, "originalToNode"); this.tD = a }); w.defineProperty(Ti, { Vg: "originalToPort" }, function () { return this.uD }, function (a) { null !== a && w.G(a, G, Ti, "originalToPort"); this.uD = a }); w.defineProperty(Ti, { Qd: "isForwards" }, function () { return this.TC }, function (a) { w.j(a, "boolean", Ti, "isForwards"); this.TC = a }); w.u(Ti, { qy: "validPortsCache" }, function () { return this.ZG }); w.defineProperty(Ti, { Hf: "targetPort" }, function () { return this.MD }, function (a) { null !== a && w.G(a, G, Ti, "targetPort"); this.MD = a }); Ti.prototype.copyPortProperties = function (a, b, c, d, e) { if (null !== a && null !== b && null !== c && null !== d) { d.Ca = b.Y.size; e ? (d.Bb = b.Bb, d.km = b.km) : (d.Ab = b.Ab, d.Sl = b.Sl); c.Ef = Hb; var f = w.K(); c.location = b.Wa(Hb, f); w.v(f); d.angle = b.Tl(); null !== this.Ux && this.Ux(a, b, c, d, e) } }; Ti.prototype.setNoTargetPortProperties = function (a, b, c) { null !== b && (b.Ca = Ad, b.Ab = tb, b.Bb = tb); null !== a && null !== this.g && (a.location = this.g.R.da); null !== this.Ux && this.Ux(null, null, a, b, c) }; Ti.prototype.doMouseDown = function () { this.sa && this.doMouseMove() }; Ti.prototype.doMouseMove = function () { if (this.sa) { var a = this.g; if (null !== a) { this.Hf = this.findTargetPort(this.Qd); if (null !== this.Hf && this.Hf.U instanceof U) { var b = this.Hf.U; this.Qd ? this.copyPortProperties(b, this.Hf, this.Vd, this.bo, !0) : this.copyPortProperties(b, this.Hf, this.Ud, this.ao, !1) } else this.Qd ? this.setNoTargetPortProperties(this.Vd, this.bo, !0) : this.setNoTargetPortProperties(this.Ud, this.ao, !1); (a.oe || a.pe) && a.iA(a.R.df) } } }; Ti.prototype.findValidLinkablePort = function (a, b) { if (null === a) return null; var c = a.U; if (!(c instanceof U)) return null; for (; null !== a;) { var d = b ? a.tG : a.TE; if (!0 === d && (null !== a.Td || a instanceof U) && (b ? this.isValidTo(c, a) : this.isValidFrom(c, a))) return a; if (!1 === d) break; a = a.O } return null }; Ti.prototype.findTargetPort = function (a) { var b = this.g, c = b.R.da, d = this.PF; 0 >= d && (d = .1); for (var e = this, f = b.xn(c, d, function (b) { return e.findValidLinkablePort(b, a) }, null, !0), d = Infinity, b = null, f = f.i; f.next();) { var h = f.value, k = h.U; if (k instanceof U) { var l = h.Wa(Hb, w.K()), m = c.x - l.x, n = c.y - l.y; w.v(l); l = m * m + n * n; l < d && (m = this.qy.ja(h), null !== m ? m && (b = h, d = l) : a && this.isValidLink(this.Sg, this.Tg, k, h) || !a && this.isValidLink(k, h, this.Ug, this.Vg) ? (this.qy.add(h, !0), b = h, d = l) : this.qy.add(h, !1)) } } return null !== b && (c = b.U, c instanceof U && (null === c.layer || c.layer.Bt)) ? b : null }; Ti.prototype.isValidFrom = function (a, b) { if (null === a || null === b) return this.aq; if (null !== this.g && this.g.$a === this && (null !== a.layer && !a.layer.Bt || !0 !== b.TE)) return !1; var c = b.oA; if (Infinity > c) { if (null !== this.lc && a === this.Sg && b === this.Tg) return !0; var d = b.Td; null === d && (d = ""); if (a.nx(d).count >= c) return !1 } return !0 }; Ti.prototype.isValidTo = function (a, b) { if (null === a || null === b) return this.aq; if (null !== this.g && this.g.$a === this && (null !== a.layer && !a.layer.Bt || !0 !== b.tG)) return !1; var c = b.SJ; if (Infinity > c) { if (null !== this.lc && a === this.Ug && b === this.Vg) return !0; var d = b.Td; null === d && (d = ""); if (a.Ng(d).count >= c) return !1 } return !0 }; Ti.prototype.isInSameNode = function (a, b) { if (null === a || null === b) return !1; if (a === b) return !0; var c = a.U, d = b.U; return null !== c && c === d }; Ti.prototype.isLinked = function (a, b) { if (null === a || null === b) return !1; var c = a.U; if (!(c instanceof U)) return !1; var d = a.Td; null === d && (d = ""); var e = b.U; if (!(e instanceof U)) return !1; var f = b.Td; null === f && (f = ""); for (e = e.Ng(f); e.next();)if (f = e.value, f.V === c && f.Og === d) return !0; return !1 }; Ti.prototype.isValidLink = function (a, b, c, d) { if (!this.isValidFrom(a, b) || !this.isValidTo(c, d) || !(null === b || null === d || (b.XH && d.RJ || !this.isInSameNode(b, d)) && (b.WH && d.QJ || !this.isLinked(b, d))) || null !== this.lc && (null !== a && this.isLabelDependentOnLink(a, this.lc) || null !== c && this.isLabelDependentOnLink(c, this.lc)) || null !== a && null !== c && (null === a.data && null !== c.data || null !== a.data && null === c.data) || !this.isValidCycle(a, c, this.lc)) return !1; if (null !== a) { var e = a.Kx; if (null !== e && !e(a, b, c, d, this.lc)) return !1 } if (null !== c && (e = c.Kx, null !== e && !e(a, b, c, d, this.lc))) return !1; e = this.Kx; return null !== e ? e(a, b, c, d, this.lc) : !0 }; Ti.prototype.isLabelDependentOnLink = function (a, b) { if (null === a) return !1; var c = a.Wb; if (null === c) return !1; if (c === b) return !0; var d = new I(U); d.add(a); return Ui(this, c, b, d) }; function Ui(a, b, c, d) { if (b === c) return !0; var e = b.V; if (null !== e && e.Af && (d.add(e), Ui(a, e.Wb, c, d))) return !0; b = b.Z; return null !== b && b.Af && (d.add(b), Ui(a, b.Wb, c, d)) ? !0 : !1 } Ti.prototype.isValidCycle = function (a, b, c) { void 0 === c && (c = null); if (null === a || null === b) return this.aq; var d = null !== this.g ? this.g.YJ : Vi; if (d !== Vi) { if (d === Wi) { if (null !== c && !c.Nc) return !0; for (d = b.ge; d.next();) { var e = d.value; if (e !== c && e.Nc && e.Z === b) return !1 } return !Xi(this, a, b, c, !0) } if (d === Yi) { if (null !== c && !c.Nc) return !0; for (d = a.ge; d.next();)if (e = d.value, e !== c && e.Nc && e.V === a) return !1; return !Xi(this, a, b, c, !0) } if (d === Zi) return a === b ? a = !0 : (d = new I(U), d.add(b), a = $i(this, d, a, b, c)), !a; if (d === aj) return !Xi(this, a, b, c, !1); if (d === bj) return a === b ? a = !0 : (d = new I(U), d.add(b), a = cj(this, d, a, b, c)), !a } return !0 }; function Xi(a, b, c, d, e) { if (b === c) return !0; if (null === b || null === c) return !1; for (var f = b.ge; f.next();) { var h = f.value; if (h !== d && (!e || h.Nc) && h.Z === b && (h = h.V, h !== b && Xi(a, h, c, d, e))) return !0 } return !1 } function $i(a, b, c, d, e) { if (c === d) return !0; if (null === c || null === d || b.contains(c)) return !1; b.add(c); for (var f = c.ge; f.next();) { var h = f.value; if (h !== e && h.Z === c && (h = h.V, h !== c && $i(a, b, h, d, e))) return !0 } return !1 } function cj(a, b, c, d, e) { if (c === d) return !0; if (null === c || null === d || b.contains(c)) return !1; b.add(c); for (var f = c.ge; f.next();) { var h = f.value; if (h !== e) { var k = h.V, h = h.Z, k = k === c ? h : k; if (k !== c && cj(a, b, k, d, e)) return !0 } } return !1 } w.defineProperty(Ti, { Kx: "linkValidation" }, function () { return this.pl }, function (a) { null !== a && w.j(a, "function", Ti, "linkValidation"); this.pl = a }); w.defineProperty(Ti, { Ux: "portTargeted" }, function () { return this.xD }, function (a) { null !== a && w.j(a, "function", Ti, "portTargeted"); this.xD = a }); function dj() { 0 < arguments.length && w.jd(dj); Ti.call(this); this.name = "Linking"; this.UB = {}; this.TB = null; this.aa = ej; this.GD = null } w.Ka(dj, Ti); w.ga("LinkingTool", dj); var ej; dj.Either = ej = w.p(dj, "Either", 0); var fj; dj.ForwardsOnly = fj = w.p(dj, "ForwardsOnly", 0); var gj; dj.BackwardsOnly = gj = w.p(dj, "BackwardsOnly", 0); w.defineProperty(dj, { kH: "archetypeLinkData" }, function () { return this.UB }, function (a) { null !== a && w.G(a, Object, dj, "archetypeLinkData"); a instanceof G && w.G(a, W, dj, "archetypeLinkData"); this.UB = a }); w.defineProperty(dj, { oE: "archetypeLabelNodeData" }, function () { return this.TB }, function (a) { null !== a && w.G(a, Object, dj, "archetypeLabelNodeData"); a instanceof G && w.G(a, U, dj, "archetypeLabelNodeData"); this.TB = a }); w.defineProperty(dj, { direction: "direction" }, function () { return this.aa }, function (a) { w.mb(a, dj, dj, "direction"); this.aa = a }); w.defineProperty(dj, { oG: "startObject" }, function () { return this.GD }, function (a) { null !== a && w.G(a, G, dj, "startObject"); this.GD = a }); dj.prototype.canStart = function () { if (!this.isEnabled) return !1; var a = this.g; if (null === a || a.hb || a.Bf || !a.Bt) return !1; var b = a.ba; return (b instanceof R || b instanceof ag) && a.R.left && (a.$a === this || this.isBeyondDragSize()) ? null !== this.findLinkablePort() : !1 }; dj.prototype.findLinkablePort = function () { var a = this.g; if (null === a) return null; var b = this.oG; null === b && (b = a.Ke(a.Bc.da, null, null)); if (null === b || !(b.U instanceof U)) return null; a = this.direction; if (a === ej || a === fj) { var c = this.findValidLinkablePort(b, !1); if (null !== c) return this.Qd = !0, c } if (a === ej || a === gj) if (c = this.findValidLinkablePort(b, !0), null !== c) return this.Qd = !1, c; return null }; dj.prototype.doActivate = function () { var a = this.g; if (null !== a) { var b = this.findLinkablePort(); null !== b && (this.Pb(this.name), a.bf = !0, a.ec = "pointer", this.Qd ? (null === this.Vd || this.Vd.location.I() || (this.Vd.location = a.R.da), this.Tg = b, b = this.Tg.U, b instanceof U && (this.Sg = b), this.copyPortProperties(this.Sg, this.Tg, this.Ud, this.ao, !1)) : (null === this.Ud || this.Ud.location.I() || (this.Ud.location = a.R.da), this.Vg = b, b = this.Vg.U, b instanceof U && (this.Ug = b), this.copyPortProperties(this.Ug, this.Vg, this.Vd, this.bo, !0)), a.add(this.Ud), a.add(this.Vd), null !== this.Zg && (null !== this.Ud && (this.Zg.V = this.Ud), null !== this.Vd && (this.Zg.Z = this.Vd), this.Zg.$b(), a.add(this.Zg)), this.sa = !0) } }; dj.prototype.doDeactivate = function () { this.sa = !1; var a = this.g; null !== a && (a.remove(this.Zg), a.remove(this.Ud), a.remove(this.Vd), a.bf = !1, a.ec = "", this.Mk()) }; dj.prototype.doStop = function () { Ti.prototype.doStop.call(this); this.oG = null }; dj.prototype.doMouseUp = function () { if (this.sa) { var a = this.g; if (null === a) return; var b = this.Kf = null, c = null, d = null, e = null, f = this.Hf = this.findTargetPort(this.Qd); if (null !== f) { var h = f.U; h instanceof U && (this.Qd ? (null !== this.Sg && (b = this.Sg, c = this.Tg), d = h, e = f) : (b = h, c = f, null !== this.Ug && (d = this.Ug, e = this.Vg))) } else this.Qd ? null !== this.Sg && this.aq && (b = this.Sg, c = this.Tg) : null !== this.Ug && this.aq && (d = this.Ug, e = this.Vg); null !== b || null !== d ? (h = this.insertLink(b, c, d, e), null !== h ? (null === f && (this.Qd ? h.Mp = a.R.da : h.Lp = a.R.da), a.vf && a.select(h), this.Kf = this.name, a.Aa("LinkDrawn", h)) : (a.ba.tE(), this.doNoLink(b, c, d, e))) : this.Qd ? this.doNoLink(this.Sg, this.Tg, null, null) : this.doNoLink(null, null, this.Ug, this.Vg) } this.stopTool() }; dj.prototype.insertLink = function (a, b, c, d) { var e = this.g; if (null === e) return null; var f = e.ba; if (f instanceof ag) { var h = a; b = c; e.Sd || (h = c, b = a); if (null !== h && null !== b) return f.si(b.data, f.sb(h.data)), b.yn() } else if (f instanceof R) if (h = "", null !== a && (null === b && (b = a), h = b.Td, null === h && (h = "")), b = "", null !== c && (null === d && (d = c), b = d.Td, null === b && (b = "")), d = this.kH, d instanceof W) { if (lh(d), f = d.copy(), null !== f) return f.V = a, f.Og = h, f.Z = c, f.Ih = b, e.add(f), a = this.oE, a instanceof U && (lh(a), a = a.copy(), null !== a && (a.Wb = f, e.add(a))), f } else if (null !== d && (d = f.Zw(d), w.Pa(d))) return null !== a && f.hB(d, f.sb(a.data)), f.iB(d, h), null !== c && f.nB(d, f.sb(c.data)), f.oB(d, b), f.wt(d), a = this.oE, null === a || a instanceof U || (a = f.copyNodeData(a), w.Pa(a) && (f.Dl(a), a = f.sb(a), void 0 !== a && f.jE(d, a))), f = e.Vf(d); return null }; dj.prototype.doNoLink = function () { }; function Qh() { 0 < arguments.length && w.jd(Qh); Ti.call(this); this.name = "Relinking"; var a = new Y; a.Cb = "Diamond"; a.Ca = Cd; a.fill = "lightblue"; a.stroke = "dodgerblue"; a.cursor = "pointer"; a.Ne = 0; this.GC = a; a = new Y; a.Cb = "Diamond"; a.Ca = Cd; a.fill = "lightblue"; a.stroke = "dodgerblue"; a.cursor = "pointer"; a.Ne = -1; this.UD = a; this.hc = null; this.rD = new B } w.Ka(Qh, Ti); w.ga("RelinkingTool", Qh); Qh.prototype.updateAdornments = function (a) { if (null !== a && a instanceof W) { var b = "RelinkFrom", c = null; if (a.ib && null !== this.g && !this.g.hb) { var d = a.Hu; null !== d && a.canRelinkFrom() && a.Y.I() && a.isVisible() && d.Y.I() && d.xj() && (c = a.Qp(b), null === c && (c = this.makeAdornment(d, !1), a.Cl(b, c))) } null === c && a.Bj(b); b = "RelinkTo"; c = null; a.ib && null !== this.g && !this.g.hb && (d = a.Hu, null !== d && a.canRelinkTo() && a.Y.I() && a.isVisible() && d.Y.I() && d.xj() && (c = a.Qp(b), null === c && (c = this.makeAdornment(d, !0), a.Cl(b, c)))); null === c && a.Bj(b) } }; Qh.prototype.makeAdornment = function (a, b) { var c = new jh; c.type = hj; var d = b ? this.PJ : this.VH; null !== d && c.add(d.copy()); c.rb = a; return c }; w.defineProperty(Qh, { VH: "fromHandleArchetype" }, function () { return this.GC }, function (a) { null !== a && w.G(a, G, Qh, "fromHandleArchetype"); this.GC = a }); w.defineProperty(Qh, { PJ: "toHandleArchetype" }, function () { return this.UD }, function (a) { null !== a && w.G(a, G, Qh, "toHandleArchetype"); this.UD = a }); w.u(Qh, { handle: "handle" }, function () { return this.hc }); Qh.prototype.canStart = function () { if (!this.isEnabled) return !1; var a = this.g; if (null === a || a.hb || a.Bf || !a.jn) return !1; var b = a.ba; if (!(b instanceof R || b instanceof ag) || !a.R.left) return !1; b = this.findToolHandleAt(a.Bc.da, "RelinkFrom"); null === b && (b = this.findToolHandleAt(a.Bc.da, "RelinkTo")); return null !== b }; Qh.prototype.doActivate = function () { var a = this.g; if (null !== a) { if (null === this.lc) { var b = this.findToolHandleAt(a.Bc.da, "RelinkFrom"); null === b && (b = this.findToolHandleAt(a.Bc.da, "RelinkTo")); if (null === b) return; var c = b.U; if (!(c instanceof jh && c.uf instanceof W)) return; this.hc = b; this.Qd = null === c || "RelinkTo" === c.ud; this.lc = c.uf } this.Pb(this.name); a.bf = !0; a.ec = "pointer"; this.Tg = this.lc.Lc; this.Sg = this.lc.V; this.Vg = this.lc.kd; this.Ug = this.lc.Z; this.rD.set(this.lc.Y); null !== this.lc && 0 < this.lc.qa && (null === this.lc.V && (null !== this.ao && (this.ao.Ca = rd), null !== this.Ud && (this.Ud.location = this.lc.l(0))), null === this.lc.Z && (null !== this.bo && (this.bo.Ca = rd), null !== this.Vd && (this.Vd.location = this.lc.l(this.lc.qa - 1)))); this.copyPortProperties(this.Sg, this.Tg, this.Ud, this.ao, !1); this.copyPortProperties(this.Ug, this.Vg, this.Vd, this.bo, !0); a.add(this.Ud); a.add(this.Vd); null !== this.Zg && (null !== this.Ud && (this.Zg.V = this.Ud), null !== this.Vd && (this.Zg.Z = this.Vd), this.copyLinkProperties(this.lc, this.Zg), this.Zg.$b(), a.add(this.Zg)); this.sa = !0 } }; Qh.prototype.copyLinkProperties = function (a, b) { if (null !== a && null !== b) { b.yt = a.yt; b.eA = a.eA; var c = a.$e; if (c === ij || c === jj) c = kj; b.$e = c; b.bx = a.bx; b.ey = a.ey; b.vq = a.vq; b.Ab = a.Ab; b.Sl = a.Sl; b.Vt = a.Vt; b.Wt = a.Wt; b.Bb = a.Bb; b.km = a.km; b.Ou = a.Ou; b.Pu = a.Pu } }; Qh.prototype.doDeactivate = function () { this.sa = !1; var a = this.g; null !== a && (a.remove(this.Zg), a.remove(this.Ud), a.remove(this.Vd), a.bf = !1, a.ec = "", this.Mk()) }; Qh.prototype.doStop = function () { Ti.prototype.doStop.call(this); this.hc = null }; Qh.prototype.doMouseUp = function () { if (this.sa) { var a = this.g; if (null === a) return; this.Kf = null; var b = this.Sg, c = this.Tg, d = this.Ug, e = this.Vg, f = this.lc; this.Hf = this.findTargetPort(this.Qd); if (null !== this.Hf) { var h = this.Hf.U; h instanceof U && (this.Qd ? (d = h, e = this.Hf) : (b = h, c = this.Hf)) } else this.aq ? this.Qd ? e = d = null : c = b = null : f = null; null !== f ? (this.reconnectLink(f, this.Qd ? d : b, this.Qd ? e : c, this.Qd), null === this.Hf && (this.Qd ? f.Mp = a.R.da : f.Lp = a.R.da, f.$b()), a.vf && (f.ib = !0), this.Kf = this.name, a.Aa("LinkRelinked", f, this.Qd ? this.Vg : this.Tg)) : this.doNoRelink(this.lc, this.Qd); lj(this.lc, this.rD) } this.stopTool() }; Qh.prototype.reconnectLink = function (a, b, c, d) { if (null === this.g) return !1; c = null !== c && null !== c.Td ? c.Td : ""; d ? (a.Z = b, a.Ih = c) : (a.V = b, a.Og = c); return !0 }; Qh.prototype.doNoRelink = function () { }; function Oi(a, b, c, d, e) { null !== a.g && (null !== b ? (a.copyPortProperties(b, c, a.Ud, a.ao, !1), a.g.add(a.Ud)) : a.g.remove(a.Ud), null !== d ? (a.copyPortProperties(d, e, a.Vd, a.bo, !0), a.g.add(a.Vd)) : a.g.remove(a.Vd)) } function mj() { 0 < arguments.length && w.jd(mj); qg.call(this); this.name = "LinkReshaping"; var a = new Y; a.Cb = "Rectangle"; a.Ca = Bd; a.fill = "lightblue"; a.stroke = "dodgerblue"; this.el = a; a = new Y; a.Cb = "Diamond"; a.Ca = Bd; a.fill = "lightblue"; a.stroke = "dodgerblue"; this.dD = a; this.yD = 3; this.Gy = this.hc = null; this.fp = new z; this.jw = null } w.Ka(mj, qg); w.ga("LinkReshapingTool", mj); var nj; mj.None = nj = w.p(mj, "None", 0); var oj; mj.Horizontal = oj = w.p(mj, "Horizontal", 1); var Hj; mj.Vertical = Hj = w.p(mj, "Vertical", 2); var Ij; mj.All = Ij = w.p(mj, "All", 3); mj.prototype.getReshapingBehavior = mj.prototype.YE = function (a) { return a && a.zz ? a.zz : nj }; mj.prototype.setReshapingBehavior = mj.prototype.Ju = function (a, b) { w.G(a, G, mj, "setReshapingBehavior:obj"); w.mb(b, mj, mj, "setReshapingBehavior:behavior"); a.zz = b }; mj.prototype.updateAdornments = function (a) { if (null !== a && a instanceof W) { if (a.ib && null !== this.g && !this.g.hb) { var b = a.path; if (null !== b && a.canReshape() && a.Y.I() && a.isVisible() && b.Y.I() && b.xj()) { var c = a.Qp(this.name); if (null === c || c.lD !== a.qa || c.cE !== a.Du) c = this.makeAdornment(b), null !== c && (c.lD = a.qa, c.cE = a.Du, a.Cl(this.name, c)); if (null !== c) { c.location = a.position; return } } } a.Bj(this.name) } }; mj.prototype.makeAdornment = function (a) { var b = a.U, c = b.qa, d = b.ac, e = null; if (null !== b.points && 1 < c) { e = new jh; e.type = hj; var c = b.Pt, f = b.Gx, h = d ? 1 : 0; if (b.Du && b.$e !== Jj) for (var k = c + h; k < f - h; k++) { var l = this.makeResegmentHandle(a, k); null !== l && (l.Ne = k, l.eB = .5, l.oA = 999, e.add(l)) } for (k = c + 1; k < f; k++)if (l = this.makeHandle(a, k), null !== l) { l.Ne = k; if (k !== c) if (k === c + 1 && d) { var h = b.l(c), m = b.l(c + 1); J(h.x, m.x) && J(h.y, m.y) && (m = b.l(c - 1)); J(h.x, m.x) ? (this.Ju(l, Hj), l.cursor = "n-resize") : J(h.y, m.y) && (this.Ju(l, oj), l.cursor = "w-resize") } else k === f - 1 && d ? (h = b.l(f - 1), m = b.l(f), J(h.x, m.x) && J(h.y, m.y) && (h = b.l(f + 1)), J(h.x, m.x) ? (this.Ju(l, Hj), l.cursor = "n-resize") : J(h.y, m.y) && (this.Ju(l, oj), l.cursor = "w-resize")) : k !== f && (this.Ju(l, Ij), l.cursor = "move"); e.add(l) } e.rb = a } return e }; mj.prototype.makeHandle = function () { var a = this.Zt; return null === a ? null : a.copy() }; w.defineProperty(mj, { Zt: "handleArchetype" }, function () { return this.el }, function (a) { null !== a && w.G(a, G, mj, "handleArchetype"); this.el = a }); mj.prototype.makeResegmentHandle = function () { var a = this.YI; return null === a ? null : a.copy() }; w.defineProperty(mj, { YI: "midHandleArchetype" }, function () { return this.dD }, function (a) { null !== a && w.G(a, G, mj, "midHandleArchetype"); this.dD = a }); w.u(mj, { handle: "handle" }, function () { return this.hc }); w.u(mj, { zt: "adornedLink" }, function () { return this.Gy }); mj.prototype.canStart = function () { if (!this.isEnabled) return !1; var a = this.g; return null !== a && !a.hb && a.Rw && a.R.left ? null !== this.findToolHandleAt(a.Bc.da, this.name) : !1 }; mj.prototype.doActivate = function () { var a = this.g; if (null !== a && (this.hc = this.findToolHandleAt(a.Bc.da, this.name), null !== this.hc)) { var b = this.hc.U.uf; if (b instanceof W) { this.Gy = b; a.bf = !0; this.Pb(this.name); if (b.Du && 999 === this.hc.oA) { var c = b.points.copy(), d = this.hc.Wa(Hb); c.Pd(this.hc.Ne + 1, d); b.ac && c.Pd(this.hc.Ne + 1, d); b.points = c; b.de(); this.hc = this.findToolHandleAt(a.Bc.da, this.name); if (null === this.hc) { this.doDeactivate(); return } } this.fp = b.l(this.hc.Ne); this.jw = b.points.copy(); this.sa = !0 } } }; mj.prototype.doDeactivate = function () { this.Mk(); this.Gy = this.hc = null; var a = this.g; null !== a && (a.bf = !1); this.sa = !1 }; mj.prototype.doCancel = function () { var a = this.zt; null !== a && (a.points = this.jw); this.stopTool() }; mj.prototype.doMouseMove = function () { var a = this.g; this.sa && null !== a && (a = this.computeReshape(a.R.da), this.reshape(a)) }; mj.prototype.doMouseUp = function () { var a = this.g; if (this.sa && null !== a) { var b = this.computeReshape(a.R.da); this.reshape(b); b = this.zt; if (null !== b && b.Du) { var c = this.handle.Ne, d = b.l(c - 1), e = b.l(c), f = b.l(c + 1); if (b.ac) { if (c > b.Pt + 1 && c < b.Gx - 1) { var h = b.l(c - 2); if (Math.abs(d.x - e.x) < this.Fh && Math.abs(d.y - e.y) < this.Fh && (Kj(this, h, d, e, f, !0) || Kj(this, h, d, e, f, !1))) { var k = b.points.copy(); Kj(this, h, d, e, f, !0) ? (k.ig(c - 2, new z(h.x, (f.y + h.y) / 2)), k.ig(c + 1, new z(f.x, (f.y + h.y) / 2))) : (k.ig(c - 2, new z((f.x + h.x) / 2, h.y)), k.ig(c + 1, new z((f.x + h.x) / 2, f.y))); k.$c(c); k.$c(c - 1); b.points = k; b.de() } else h = b.l(c + 2), Math.abs(e.x - f.x) < this.Fh && Math.abs(e.y - f.y) < this.Fh && (Kj(this, d, e, f, h, !0) || Kj(this, d, e, f, h, !1)) && (k = b.points.copy(), Kj(this, d, e, f, h, !0) ? (k.ig(c - 1, new z(d.x, (d.y + h.y) / 2)), k.ig(c + 2, new z(h.x, (d.y + h.y) / 2))) : (k.ig(c - 1, new z((d.x + h.x) / 2, d.y)), k.ig(c + 2, new z((d.x + h.x) / 2, h.y))), k.$c(c + 1), k.$c(c), b.points = k, b.de()) } } else h = w.K(), Ia(d.x, d.y, f.x, f.y, e.x, e.y, h) && h.wf(e) < this.Fh * this.Fh && (k = b.points.copy(), k.$c(c), b.points = k, b.de()), w.v(h) } a.sc(); this.Kf = this.name; a.Aa("LinkReshaped", this.zt, this.jw) } this.stopTool() }; function Kj(a, b, c, d, e, f) { return f ? Math.abs(b.y - c.y) < a.Fh && Math.abs(c.y - d.y) < a.Fh && Math.abs(d.y - e.y) < a.Fh : Math.abs(b.x - c.x) < a.Fh && Math.abs(c.x - d.x) < a.Fh && Math.abs(d.x - e.x) < a.Fh } w.defineProperty(mj, { Fh: "resegmentingDistance" }, function () { return this.yD }, function (a) { w.j(a, "number", mj, "resegmentingDistance"); this.yD = a }); mj.prototype.reshape = function (a) { var b = this.zt; b.fm(); var c = this.handle.Ne, d = this.YE(this.handle); if (b.ac) if (c === b.Pt + 1) c = b.Pt + 1, d === Hj ? (b.ca(c, b.l(c - 1).x, a.y), b.ca(c + 1, b.l(c + 2).x, a.y)) : d === oj && (b.ca(c, a.x, b.l(c - 1).y), b.ca(c + 1, a.x, b.l(c + 2).y)); else if (c === b.Gx - 1) c = b.Gx - 1, d === Hj ? (b.ca(c - 1, b.l(c - 2).x, a.y), b.ca(c, b.l(c + 1).x, a.y)) : d === oj && (b.ca(c - 1, a.x, b.l(c - 2).y), b.ca(c, a.x, b.l(c + 1).y)); else { var d = c, e = b.l(d), f = b.l(d - 1), h = b.l(d + 1); J(f.x, e.x) && J(e.y, h.y) ? (J(f.x, b.l(d - 2).x) && !J(f.y, b.l(d - 2).y) ? (b.w(d, a.x, f.y), c++ , d++) : b.ca(d - 1, a.x, f.y), J(h.y, b.l(d + 2).y) && !J(h.x, b.l(d + 2).x) ? b.w(d + 1, h.x, a.y) : b.ca(d + 1, h.x, a.y)) : J(f.y, e.y) && J(e.x, h.x) ? (J(f.y, b.l(d - 2).y) && !J(f.x, b.l(d - 2).x) ? (b.w(d, f.x, a.y), c++ , d++) : b.ca(d - 1, f.x, a.y), J(h.x, b.l(d + 2).x) && !J(h.y, b.l(d + 2).y) ? b.w(d + 1, a.x, h.y) : b.ca(d + 1, a.x, h.y)) : J(f.x, e.x) && J(e.x, h.x) ? (J(f.x, b.l(d - 2).x) && !J(f.y, b.l(d - 2).y) ? (b.w(d, a.x, f.y), c++ , d++) : b.ca(d - 1, a.x, f.y), J(h.x, b.l(d + 2).x) && !J(h.y, b.l(d + 2).y) ? b.w(d + 1, a.x, h.y) : b.ca(d + 1, a.x, h.y)) : J(f.y, e.y) && J(e.y, h.y) && (J(f.y, b.l(d - 2).y) && !J(f.x, b.l(d - 2).x) ? (b.w(d, f.x, a.y), c++ , d++) : b.ca(d - 1, f.x, a.y), J(h.y, b.l(d + 2).y) && !J(h.x, b.l(d + 2).x) ? b.w(d + 1, h.x, a.y) : b.ca(d + 1, h.x, a.y)); b.ca(c, a.x, a.y) } else b.ca(c, a.x, a.y), 1 === c && b.computeSpot(!0).Rd() && (e = b.V, f = b.Lc, null === e || e.isVisible() || (e = e.findVisibleNode(), e !== b.V && (f = e.Ql(""))), d = f.Wa(Hb, w.K()), e = b.getLinkPointFromPoint(e, f, d, a, !0, w.K()), b.ca(0, e.x, e.y), w.v(d), w.v(e)), c === b.qa - 2 && b.computeSpot(!1).Rd() && (c = b.Z, e = b.kd, null === c || c.isVisible() || (c = c.findVisibleNode(), c !== b.Z && (e = c.Ql(""))), d = e.Wa(Hb, w.K()), e = b.getLinkPointFromPoint(c, e, d, a, !1, w.K()), b.ca(b.qa - 1, e.x, e.y), w.v(d), w.v(e)); b.kj() }; mj.prototype.computeReshape = function (a) { var b = this.zt, c = this.handle.Ne; switch (this.YE(this.handle)) { case Ij: return a; case Hj: return b = b.l(c), new z(b.x, a.y); case oj: return b = b.l(c), new z(a.x, b.y); default: case nj: return b.l(c) } }; w.u(mj, { zL: "originalPoint" }, function () { return this.fp }); w.u(mj, { AL: "originalPoints" }, function () { return this.jw }); function Lj() { 0 < arguments.length && w.jd(Lj); qg.call(this); this.name = "Resizing"; this.Zh = (new ia(1, 1)).freeze(); this.Yh = (new ia(9999, 9999)).freeze(); this.Jj = (new ia(NaN, NaN)).freeze(); this.Kr = !1; this.Fc = null; var a = new Y; a.qh = Hb; a.Cb = "Rectangle"; a.Ca = Bd; a.fill = "lightblue"; a.stroke = "dodgerblue"; a.lb = 1; a.cursor = "pointer"; this.el = a; this.hc = null; this.fp = new z; this.nD = new ia; this.sD = new z; this.cz = new ia(0, 0); this.bz = new ia(Infinity, Infinity); this.az = new ia(1, 1); this.kD = !0 } w.Ka(Lj, qg); w.ga("ResizingTool", Lj); Lj.prototype.updateAdornments = function (a) { if (!(null === a || a instanceof W)) { if (a.ib && null !== this.g && !this.g.hb) { var b = a.ZF; if (null !== b && a.canResize() && a.Y.I() && a.isVisible() && b.Y.I() && b.xj()) { var c = a.Qp(this.name); if (null === c || c.rb !== b) c = this.makeAdornment(b); if (null !== c) { var d = b.Tl(); c.angle = d; var e = b.Wa(c.Ef, w.K()), f = b.pj(); c.location = e; w.v(e); e = c.placeholder; if (null !== e) { var b = b.Ja, h = w.jm(); h.m(b.width * f, b.height * f); e.Ca = h; w.Bk(h) } this.updateResizeHandles(c, d); a.Cl(this.name, c); return } } } a.Bj(this.name) } }; Lj.prototype.makeAdornment = function (a) { var b = null, b = a.U.YF; if (null === b) { b = new jh; b.type = Mj; b.Ef = Hb; var c = new Nj; c.Yf = !0; b.add(c); b.add(this.makeHandle(a, xb)); b.add(this.makeHandle(a, Db)); b.add(this.makeHandle(a, Nb)); b.add(this.makeHandle(a, Lb)); b.add(this.makeHandle(a, Hc)); b.add(this.makeHandle(a, Jc)); b.add(this.makeHandle(a, Kc)); b.add(this.makeHandle(a, Ic)) } else if (lh(b), b = b.copy(), null === b) return null; b.rb = a; return b }; Lj.prototype.makeHandle = function (a, b) { var c = this.Zt; if (null === c) return null; c = c.copy(); c.alignment = b; return c }; Lj.prototype.updateResizeHandles = function (a, b) { if (null !== a) if (!a.alignment.Wc() && ("pointer" === a.cursor || 0 < a.cursor.indexOf("resize"))) a: { var c = a.alignment; c.Rd() && (c = Hb); var d = b; if (0 >= c.x) d = 0 >= c.y ? d + 225 : 1 <= c.y ? d + 135 : d + 180; else if (1 <= c.x) 0 >= c.y ? d += 315 : 1 <= c.y && (d += 45); else if (0 >= c.y) d += 270; else if (1 <= c.y) d += 90; else break a; 0 > d ? d += 360 : 360 <= d && (d -= 360); a.cursor = 22.5 > d ? "e-resize" : 67.5 > d ? "se-resize" : 112.5 > d ? "s-resize" : 157.5 > d ? "sw-resize" : 202.5 > d ? "w-resize" : 247.5 > d ? "nw-resize" : 292.5 > d ? "n-resize" : 337.5 > d ? "ne-resize" : "e-resize" } else if (a instanceof C) for (c = a.elements; c.next();)this.updateResizeHandles(c.value, b) }; w.defineProperty(Lj, { Zt: "handleArchetype" }, function () { return this.el }, function (a) { null !== a && w.G(a, G, Lj, "handleArchetype"); this.el = a }); w.u(Lj, { handle: "handle" }, function () { return this.hc }); w.defineProperty(Lj, { rb: "adornedObject" }, function () { return this.Fc }, function (a) { null !== a && w.G(a, G, Lj, "adornedObject"); this.Fc = a }); Lj.prototype.canStart = function () { if (!this.isEnabled) return !1; var a = this.g; return null !== a && !a.hb && a.Ct && a.R.left ? null !== this.findToolHandleAt(a.Bc.da, this.name) : !1 }; Lj.prototype.doActivate = function () { var a = this.g; null !== a && (this.hc = this.findToolHandleAt(a.Bc.da, this.name), null !== this.hc && (this.Fc = this.hc.U.rb, this.fp.set(this.rb.Wa(this.handle.alignment.KF())), this.sD.set(this.Fc.U.location), this.nD.set(this.Fc.Ca), this.az = this.computeCellSize(), this.cz = this.computeMinSize(), this.bz = this.computeMaxSize(), a.bf = !0, this.kD = a.Oa.isEnabled, a.Oa.isEnabled = !1, this.Pb(this.name), this.sa = !0)) }; Lj.prototype.doDeactivate = function () { var a = this.g; null !== a && (this.Mk(), this.Fc = this.hc = null, this.sa = a.bf = !1, a.Oa.isEnabled = this.kD) }; Lj.prototype.doCancel = function () { null !== this.rb && (this.rb.Ca = this.LF, this.rb.U.location = this.hJ); this.stopTool() }; Lj.prototype.doMouseMove = function () { var a = this.g; if (this.sa && null !== a) { var b = this.cz, c = this.bz, d = this.az, e = this.rb.WE(a.R.da, w.K()), f = this.computeReshape(), b = this.computeResize(e, this.handle.alignment, b, c, d, f); this.resize(b); a.ag(); w.v(e) } }; Lj.prototype.doMouseUp = function () { var a = this.g; if (this.sa && null !== a) { var b = this.cz, c = this.bz, d = this.az, e = this.rb.WE(a.R.da, w.K()), f = this.computeReshape(), b = this.computeResize(e, this.handle.alignment, b, c, d, f); this.resize(b); w.v(e); a.sc(); this.Kf = this.name; a.Aa("PartResized", this.rb, this.LF) } this.stopTool() }; Lj.prototype.resize = function (a) { if (null !== this.g) { var b = this.rb, c = b.U; b.Ca = a.size; c.af(); a = this.rb.Wa(this.handle.alignment.KF()); c instanceof V ? (a = c.position.copy().$n(a).add(this.fp), c.move(a)) : c.location = c.location.copy().$n(a).add(this.fp) } }; Lj.prototype.computeResize = function (a, b, c, d, e, f) { b.Rd() && (b = Hb); var h = this.rb.Ja, k = h.x, l = h.y, m = h.x + h.width, n = h.y + h.height, p = 1; if (!f) { var p = h.width, q = h.height; 0 >= p && (p = 1); 0 >= q && (q = 1); p = q / p } q = w.K(); Ka(a.x, a.y, k, l, e.width, e.height, q); a = h.copy(); 0 >= b.x ? 0 >= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = Math.max(n - a.y, c.height), f || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) : (a.width = a.height / p, a.x = m - a.width))) : 1 <= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), f || (b = a.height / a.width, p < b ? a.height = p * a.width : (a.width = a.height / p, a.x = m - a.width))) : (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = m - a.x, f || (a.height = p * a.width, a.y = l + .5 * (n - l - a.height))) : 1 <= b.x ? 0 >= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = Math.max(n - a.y, c.height), f || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) : a.width = a.height / p)) : 1 <= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), f || (b = a.height / a.width, p < b ? a.height = p * a.width : a.width = a.height / p)) : (a.width = Math.max(Math.min(q.x - k, d.width), c.width), f || (a.height = p * a.width, a.y = l + .5 * (n - l - a.height))) : 0 >= b.y ? (a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = n - a.y, f || (a.width = a.height / p, a.x = k + .5 * (m - k - a.width))) : 1 <= b.y && (a.height = Math.max(Math.min(q.y - l, d.height), c.height), f || (a.width = a.height / p, a.x = k + .5 * (m - k - a.width))); w.v(q); return a }; Lj.prototype.computeReshape = function () { var a = Oj; this.rb instanceof Y && (a = Pj(this.rb)); return !(a === Qj || a === Rj || null !== this.g && this.g.R.shift) }; Lj.prototype.computeMinSize = function () { var a = this.rb.Bh.copy(), b = this.Bh; !isNaN(b.width) && b.width > a.width && (a.width = b.width); !isNaN(b.height) && b.height > a.height && (a.height = b.height); return a }; Lj.prototype.computeMaxSize = function () { var a = this.rb.Ff.copy(), b = this.Ff; !isNaN(b.width) && b.width < a.width && (a.width = b.width); !isNaN(b.height) && b.height < a.height && (a.height = b.height); return a }; Lj.prototype.computeCellSize = function () { var a = new ia(NaN, NaN), b = this.rb.U; if (null !== b) { var c = b.sJ; !isNaN(c.width) && 0 < c.width && (a.width = c.width); !isNaN(c.height) && 0 < c.height && (a.height = c.height) } c = this.Fp; isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width); isNaN(a.height) && !isNaN(c.height) && 0 < c.height && (a.height = c.height); b = this.g; (isNaN(a.width) || isNaN(a.height)) && b && (c = b.eb.te, null !== c && c.zx && (c = c.dF, 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.Dn, null !== b && b.visible && this.zx && (c = b.ux, isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width), isNaN(a.height) && !isNaN(c.height) && 0 < c.height && (a.height = c.height))); if (isNaN(a.width) || 0 === a.width || Infinity === a.width) a.width = 1; if (isNaN(a.height) || 0 === a.height || Infinity === a.height) a.height = 1; return a }; w.defineProperty(Lj, { Bh: "minSize" }, function () { return this.Zh }, function (a) { w.G(a, ia, Lj, "minSize"); if (!this.Zh.L(a)) { var b = a.width; isNaN(b) && (b = 0); a = a.height; isNaN(a) && (a = 0); this.Zh.m(b, a) } }); w.defineProperty(Lj, { Ff: "maxSize" }, function () { return this.Yh }, function (a) { w.G(a, ia, Lj, "maxSize"); if (!this.Yh.L(a)) { var b = a.width; isNaN(b) && (b = Infinity); a = a.height; isNaN(a) && (a = Infinity); this.Yh.m(b, a) } }); w.defineProperty(Lj, { Fp: "cellSize" }, function () { return this.Jj }, function (a) { w.G(a, ia, Lj, "cellSize"); this.Jj.L(a) || this.Jj.assign(a) }); w.defineProperty(Lj, { zx: "isGridSnapEnabled" }, function () { return this.Kr }, function (a) { w.j(a, "boolean", Lj, "isGridSnapEnabled"); this.Kr = a }); w.u(Lj, { LF: "originalDesiredSize" }, function () { return this.nD }); w.u(Lj, { hJ: "originalLocation" }, function () { return this.sD }); function Sj() { 0 < arguments.length && w.jd(Sj); qg.call(this); this.name = "Rotating"; this.ED = 45; this.DD = 2; this.Fc = null; var a = new Y; a.Cb = "Ellipse"; a.Ca = Cd; a.fill = "lightblue"; a.stroke = "dodgerblue"; a.lb = 1; a.cursor = "pointer"; this.el = a; this.hc = null; this.iw = 0; this.zD = new z } w.Ka(Sj, qg); w.ga("RotatingTool", Sj); Sj.prototype.updateAdornments = function (a) { if (!(null === a || a instanceof W)) { if (a.ib && null !== this.g && !this.g.hb) { var b = a.bG; if (null !== b && a.canRotate() && a.Y.I() && a.isVisible() && b.Y.I() && b.xj()) { var c = a.Qp(this.name); if (null === c || c.rb !== b) c = this.makeAdornment(b); if (null !== c) { c.angle = b.Tl(); var d = null, e = null; b === a || b === a.$f ? (d = a.$f, e = a.Ef) : (d = b, e = Hb); for (var f = d.Ja, e = w.xb(f.width * e.x + e.offsetX, f.height * e.y + e.offsetY); null !== d && d !== b;)d.transform.nb(e), d = d.O; var d = e.y, f = Math.max(e.x - b.Ja.width, 0), h = w.K(); c.location = b.Wa(new L(1, 0, 50 + f, d), h); w.v(h); w.v(e); a.Cl(this.name, c); return } } } a.Bj(this.name) } }; Sj.prototype.makeAdornment = function (a) { var b = null, b = a.U.vJ; if (null === b) { b = new jh; b.type = Tj; b.Ef = Hb; var c = this.Zt; null !== c && b.add(c.copy()) } else if (lh(b), b = b.copy(), null === b) return null; b.rb = a; return b }; w.defineProperty(Sj, { Zt: "handleArchetype" }, function () { return this.el }, function (a) { null !== a && w.G(a, G, Sj, "handleArchetype"); this.el = a }); w.u(Sj, { handle: "handle" }, function () { return this.hc }); w.defineProperty(Sj, { rb: "adornedObject" }, function () { return this.Fc }, function (a) { null !== a && w.G(a, G, Sj, "adornedObject"); this.Fc = a }); Sj.prototype.canStart = function () { if (!this.isEnabled) return !1; var a = this.g; return null !== a && !a.hb && a.Sw && a.R.left ? null !== this.findToolHandleAt(a.Bc.da, this.name) : !1 }; Sj.prototype.doActivate = function () { var a = this.g; if (null !== a && (this.hc = this.findToolHandleAt(a.Bc.da, this.name), null !== this.hc)) { this.Fc = this.hc.U.rb; var b = this.Fc.U, c = b.$f; this.zD = this.Fc === b || this.Fc === c ? c.Wa(b.Ef) : this.Fc.Wa(Hb); this.iw = this.Fc.angle; a.bf = !0; a.gA = !0; this.Pb(this.name); this.sa = !0 } }; Sj.prototype.doDeactivate = function () { var a = this.g; null !== a && (this.Mk(), this.Fc = this.hc = null, this.sa = a.bf = !1) }; Sj.prototype.doCancel = function () { var a = this.g; null !== a && (a.gA = !1); this.rotate(this.iw); this.stopTool() }; Sj.prototype.doMouseMove = function () { var a = this.g; this.sa && null !== a && (a = this.computeRotate(a.R.da), this.rotate(a)) }; Sj.prototype.doMouseUp = function () { var a = this.g; if (this.sa && null !== a) { a.gA = !1; var b = this.computeRotate(a.R.da); this.rotate(b); a.sc(); this.Kf = this.name; a.Aa("PartRotated", this.Fc, this.iw) } this.stopTool() }; Sj.prototype.rotate = function (a) { null !== this.Fc && (this.Fc.angle = a) }; Sj.prototype.computeRotate = function (a) { a = this.zD.Ob(a); var b = this.Fc.O; null !== b && (a -= b.Tl(), 360 <= a ? a -= 360 : 0 > a && (a += 360)); var b = Math.min(Math.abs(this.IJ), 180), c = Math.min(Math.abs(this.HJ), b / 2); (null === this.g || !this.g.R.shift) && 0 < b && 0 < c && (a % b < c ? a = Math.floor(a / b) * b : a % b > b - c && (a = (Math.floor(a / b) + 1) * b)); 360 <= a ? a -= 360 : 0 > a && (a += 360); return a }; w.defineProperty(Sj, { IJ: "snapAngleMultiple" }, function () { return this.ED }, function (a) { w.j(a, "number", Sj, "snapAngleMultiple"); this.ED = a }); w.defineProperty(Sj, { HJ: "snapAngleEpsilon" }, function () { return this.DD }, function (a) { w.j(a, "number", Sj, "snapAngleEpsilon"); this.DD = a }); w.u(Sj, { yL: "originalAngle" }, function () { return this.iw }); function Uj() { qg.call(this); 0 < arguments.length && w.jd(Uj); this.name = "ClickSelecting" } w.Ka(Uj, qg); w.ga("ClickSelectingTool", Uj); Uj.prototype.canStart = function () { return !this.isEnabled || null === this.g || this.isBeyondDragSize() ? !1 : !0 }; Uj.prototype.doMouseUp = function () { this.sa && (this.standardMouseSelect(), !this.standardMouseClick() && null !== this.g && this.g.R.vj && this.g.eb.doToolTip()); this.stopTool() }; function Vj() { qg.call(this); 0 < arguments.length && w.jd(Vj); this.name = "Action"; this.jo = null } w.Ka(Vj, qg); w.ga("ActionTool", Vj); Vj.prototype.canStart = function () { if (!this.isEnabled) return !1; var a = this.g; if (null === a) return !1; var b = a.R, c = a.Ke(b.da, function (a) { for (; null !== a.O && !a.wx;)a = a.O; return a }); if (null !== c) { if (!c.wx) return !1; this.jo = c; a.vo = a.Ke(b.da, null, null); return !0 } return !1 }; Vj.prototype.doMouseDown = function () { if (this.sa) { var a = this.g.R, b = this.jo; null !== b && (a.Qe = b, null !== b.fE && b.fE(a, b)) } else this.canStart() && this.doActivate() }; Vj.prototype.doMouseMove = function () { if (this.sa) { var a = this.g.R, b = this.jo; null !== b && (a.Qe = b, null !== b.gE && b.gE(a, b)) } }; Vj.prototype.doMouseUp = function () { if (this.sa) { var a = this.g, b = a.R, c = this.jo; if (null === c) return; b.Qe = c; null !== c.hE && c.hE(b, c); this.isBeyondDragSize() || Jh(c, b, a) } this.stopTool() }; Vj.prototype.doCancel = function () { var a = this.g; if (null !== a) { var a = a.R, b = this.jo; if (null === b) return; a.Qe = b; null !== b.eE && b.eE(a, b) } this.stopTool() }; Vj.prototype.doStop = function () { this.jo = null }; function Wj() { qg.call(this); 0 < arguments.length && w.jd(Wj); this.name = "ClickCreating"; this.rm = null; this.RC = !0; this.FC = new z(0, 0) } w.Ka(Wj, qg); w.ga("ClickCreatingTool", Wj); Wj.prototype.canStart = function () { if (!this.isEnabled || null === this.Uz) return !1; var a = this.g; if (null === a || a.hb || a.Bf || !a.Dp || !a.R.left || this.isBeyondDragSize()) return !1; if (this.uI) { if (1 === a.R.Ge && (this.FC = a.R.df.copy()), 2 !== a.R.Ge || this.isBeyondDragSize(this.FC)) return !1 } else if (1 !== a.R.Ge) return !1; return a.$a !== this && null !== a.Ot(a.R.da, !0) ? !1 : !0 }; Wj.prototype.doMouseUp = function () { var a = this.g; this.sa && null !== a && this.insertPart(a.R.da); this.stopTool() }; Wj.prototype.insertPart = function (a) { var b = this.g; if (null === b) return null; var c = this.Uz; if (null === c) return null; this.Pb(this.name); var d = null; c instanceof T ? c.ee() && (lh(c), d = c.copy(), null !== d && b.add(d)) : null !== c && (c = b.ba.copyNodeData(c), w.Pa(c) && (b.ba.Dl(c), d = b.xh(c))); null !== d && (d.location = a, b.vf && b.select(d)); b.sc(); this.Kf = this.name; b.Aa("PartCreated", d); this.Mk(); return d }; w.defineProperty(Wj, { Uz: "archetypeNodeData" }, function () { return this.rm }, function (a) { null !== a && w.G(a, Object, Wj, "archetypeNodeData"); this.rm = a }); w.defineProperty(Wj, { uI: "isDoubleClick" }, function () { return this.RC }, function (a) { w.j(a, "boolean", Wj, "isDoubleClick"); this.RC = a }); function Xj() { this.$D = this.bD = this.jz = this.Fz = null } w.ga("HTMLInfo", Xj); w.defineProperty(Xj, { IA: "mainElement" }, function () { return this.bD }, function (a) { null !== a && w.G(a, HTMLElement, Xj, "mainElement"); this.bD = a }); w.defineProperty(Xj, { show: "show" }, function () { return this.Fz }, function (a) { this.Fz !== a && (null !== a && w.j(a, "function", Xj, "show"), this.Fz = a) }); w.defineProperty(Xj, { En: "hide" }, function () { return this.jz }, function (a) { this.jz !== a && (null !== a && w.j(a, "function", Xj, "hide"), this.jz = a) }); w.defineProperty(Xj, { DB: "valueFunction" }, function () { return this.$D }, function (a) { this.$D = a }); function Yj(a, b, c) { this.text = a; this.vE = b; this.visible = c } function Zj() { qg.call(this); 0 < arguments.length && w.jd(Zj); this.name = "ContextMenu"; this.kC = this.Ny = this.hC = null; this.hD = new z; this.Py = this.xm = null; var a = this; this.Mz = function () { a.stopTool() }; ak(this) } w.Ka(Zj, qg); w.ga("ContextMenuTool", Zj); function ak(a) { var b = new Xj; b.show = function (a, b, c) { c.showDefaultContextMenu() }; b.En = function (a, b) { b.hideDefaultContextMenu() }; a.xm = b; a.Mz = function () { a.stopTool() }; if (!1 === w.BE) { var b = w.createElement("div"), c = w.createElement("div"); b.style.cssText = "top: 0px;z-index:300;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px"; c.style.cssText = "z-index:299;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;"; var d = w.createElement("style"); window.document.getElementsByTagName("head")[0].appendChild(d); d.sheet.insertRule(".goCXul { list-style: none; }", 0); d.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }", 0); d.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }", 0); b.addEventListener("contextmenu", bk, !1); b.addEventListener("selectstart", bk, !1); c.addEventListener("contextmenu", bk, !1); window.document.body && (window.document.body.appendChild(b), window.document.body.appendChild(c)); w.Ft = b; w.Et = c; w.BE = !0 } } function bk(a) { a.preventDefault(); return !1 } Zj.prototype.canStart = function () { if (!this.isEnabled) return !1; var a = this.g; return null === a || this.isBeyondDragSize() || !a.R.right ? !1 : null !== this.xm && a.R.vj || null !== this.findObjectWithContextMenu() ? !0 : !1 }; Zj.prototype.doStart = function () { var a = this.g; null !== a && this.hD.set(a.Bc.da) }; Zj.prototype.doStop = function () { this.hideContextMenu(); this.ax = null }; Zj.prototype.findObjectWithContextMenu = function (a) { void 0 === a && (a = null); var b = this.g; if (null === b) return null; var c = b.R, d = null; a instanceof D || (d = a instanceof G ? a : b.Ke(c.da, null, function (a) { return !a.layer.Mc })); if (null !== d) { for (a = d; null !== a;) { if (null !== a.contextMenu) return a; a = a.O } if (null !== this.xm && b.R.vj) return d.U } else if (null !== b.contextMenu) return b; return null }; Zj.prototype.doActivate = function () { }; Zj.prototype.doMouseDown = function () { qg.prototype.doMouseDown.call(this); null !== this.g && this.g.eb.cf.contains(this) && ck(this) }; Zj.prototype.doMouseUp = function () { ck(this) }; function ck(a) { var b = a.g; if (null !== b) if (a.sa) { var c = a.Kl; if (null !== c) { if (!(c instanceof Xj)) { var d = b.Ke(b.R.da, null, null); null !== d && d.Zl(c) && a.standardMouseClick(null, null) } a.stopTool(); a.canStart() && (b.$a = a, a.doMouseUp()) } } else a.canStart() && (Ih(a, !0), a.sa || a.stopTool()) } function Ih(a, b, c) { void 0 === c && (c = null); b && a.standardMouseSelect(); if (!a.standardMouseClick()) if (a.sa = !0, b = a.xm, null === c && (c = a.findObjectWithContextMenu()), null !== c) { var d = c.contextMenu; null !== d ? (a.ax = c instanceof G ? c : null, a.showContextMenu(d, a.ax)) : null !== b && a.showContextMenu(b, a.ax) } else null !== b && a.showContextMenu(b, null) } Zj.prototype.doMouseMove = function () { this.sa && null !== this.g && this.g.eb.doMouseMove() }; Zj.prototype.showContextMenu = function (a, b) { null !== b && w.G(b, G, Zj, "showContextMenu:obj"); var c = this.g; if (null !== c) { a !== this.Kl && this.hideContextMenu(); if (a instanceof jh) { a.Zf = "Tool"; a.dm = !1; a.scale = 1 / c.scale; a.ud = this.name; null !== a.placeholder && (a.placeholder.scale = c.scale); c.add(a); if (null !== b) { var c = null, d = b.Rl(); null !== d && (c = d.data); a.rb = b; a.data = c } else a.data = c.ba; a.af(); this.positionContextMenu(a, b) } else a instanceof Xj && a.show(b, c, this); this.Kl = a } }; Zj.prototype.positionContextMenu = function (a) { if (null === a.placeholder) { var b = this.g; if (null !== b) { var c = b.R.da.copy(), d = a.za, e = b.pb; b.R.vj && (c.x -= d.width); c.x + d.width > e.right && (c.x -= d.width + 5); c.x < e.x && (c.x = e.x); c.y + d.height > e.bottom && (c.y -= d.height + 5); c.y < e.y && (c.y = e.y); a.position = c } } }; Zj.prototype.hideContextMenu = function () { var a = this.g; if (null !== a) { var b = this.Kl; null !== b && (b instanceof jh ? (a.remove(b), null !== this.Ny && this.Ny.Bj(b.ud), b.data = null, b.rb = null) : b instanceof Xj && (null !== b.En ? b.En(a, this) : null !== b.IA && (b.IA.style.display = "none")), this.Kl = null, this.standardMouseOver()) } }; function dk(a) { if (null === a.g) return null; a = new H(Yj); a.add(new Yj("Copy", function (a) { a.ob.copySelection() }, function (a) { return a.ob.canCopySelection() })); a.add(new Yj("Cut", function (a) { a.ob.cutSelection() }, function (a) { return a.ob.canCutSelection() })); a.add(new Yj("Delete", function (a) { a.ob.deleteSelection() }, function (a) { return a.ob.canDeleteSelection() })); a.add(new Yj("Paste", function (a) { a.ob.pasteSelection(a.R.da) }, function (a) { return a.ob.canPasteSelection() })); a.add(new Yj("Select All", function (a) { a.ob.selectAll() }, function (a) { return a.ob.canSelectAll() })); a.add(new Yj("Undo", function (a) { a.ob.undo() }, function (a) { return a.ob.canUndo() })); a.add(new Yj("Redo", function (a) { a.ob.redo() }, function (a) { return a.ob.canRedo() })); a.add(new Yj("Scroll To Part", function (a) { a.ob.scrollToPart() }, function (a) { return a.ob.canScrollToPart() })); a.add(new Yj("Zoom To Fit", function (a) { a.ob.zoomToFit() }, function (a) { return a.ob.canZoomToFit() })); a.add(new Yj("Reset Zoom", function (a) { a.ob.resetZoom() }, function (a) { return a.ob.canResetZoom() })); a.add(new Yj("Group Selection", function (a) { a.ob.groupSelection() }, function (a) { return a.ob.canGroupSelection() })); a.add(new Yj("Ungroup Selection", function (a) { a.ob.ungroupSelection() }, function (a) { return a.ob.canUngroupSelection() })); a.add(new Yj("Edit Text", function (a) { a.ob.editTextBlock() }, function (a) { return a.ob.canEditTextBlock() })); return a } Zj.prototype.showDefaultContextMenu = function () { var a = this.g; if (null !== a) { null === this.Py && (this.Py = dk(this)); w.Ft.innerHTML = ""; w.Et.addEventListener("click", this.Mz, !1); var b = this, c = w.createElement("ul"); c.className = "goCXul"; w.Ft.appendChild(c); c.innerHTML = ""; for (var d = this.Py.i; d.next();) { var e = d.value, f = e.visible; if ("function" === typeof e.vE && ("function" !== typeof f || f(a))) { f = w.createElement("li"); f.className = "goCXli"; var h = w.createElement("a"); h.className = "goCXa"; h.href = "#"; h.JG = e.vE; h.addEventListener("click", function (c) { this.JG(a); b.stopTool(); c.preventDefault(); return !1 }, !1); h.textContent = e.text; f.appendChild(h); c.appendChild(f) } } w.Ft.style.display = "block"; w.Et.style.display = "block" } }; Zj.prototype.hideDefaultContextMenu = function () { null !== this.Kl && this.Kl === this.xm && (w.Ft.style.display = "none", w.Et.style.display = "none", w.Et.removeEventListener("click", this.Mz, !1), this.Kl = null) }; w.defineProperty(Zj, { Kl: "currentContextMenu" }, function () { return this.hC }, function (a) { this.hC = a; this.Ny = a instanceof jh ? a.uf : null }); w.defineProperty(Zj, { TK: "defaultTouchContextMenu" }, function () { return this.xm }, function (a) { this.xm = a }); w.defineProperty(Zj, { ax: "currentObject" }, function () { return this.kC }, function (a) { null !== a && w.G(a, G, Zj, "currentObject"); this.kC = a }); w.u(Zj, { tL: "mouseDownPoint" }, function () { return this.hD }); function ek() { qg.call(this); 0 < arguments.length && w.jd(ek); this.name = "DragSelecting"; this.Bo = 175; this.WC = !1; var a = new T; a.Zf = "Tool"; a.dm = !1; var b = new Y; b.name = "SHAPE"; b.Cb = "Rectangle"; b.fill = null; b.stroke = "magenta"; a.add(b); this.tm = a } w.Ka(ek, qg); w.ga("DragSelectingTool", ek); ek.prototype.canStart = function () { if (!this.isEnabled) return !1; var a = this.g; if (null === a || !a.vf) return !1; var b = a.R; return !b.left || a.$a !== this && (!this.isBeyondDragSize() || b.timestamp - a.Bc.timestamp < this.CE || null !== a.Ot(b.da, !0)) ? !1 : !0 }; ek.prototype.doActivate = function () { var a = this.g; null !== a && (this.sa = !0, a.bf = !0, a.wb = !0, a.add(this.th), this.doMouseMove()) }; ek.prototype.doDeactivate = function () { var a = this.g; null !== a && (Uh(a), a.remove(this.th), a.wb = !1, this.sa = a.bf = !1) }; ek.prototype.doMouseMove = function () { var a = this.g; if (null !== a && this.sa && null !== this.th) { var b = this.computeBoxBounds(), c = this.th.xd("SHAPE"); null === c && (c = this.th.Kd()); c.Ca = b.size; this.th.position = b.position; (a.oe || a.pe) && a.iA(a.R.df) } }; ek.prototype.doMouseUp = function () { if (this.sa) { var a = this.g; a.remove(this.th); try { a.ec = "wait", this.selectInRect(this.computeBoxBounds()) } finally { a.ec = "" } } this.stopTool() }; ek.prototype.computeBoxBounds = function () { var a = this.g; return null === a ? new B(0, 0, 0, 0) : new B(a.Bc.da, a.R.da) }; ek.prototype.selectInRect = function (a) { var b = this.g; if (null !== b) { var c = b.R; b.Aa("ChangingSelection"); a = b.zk(a, null, function (a) { return a instanceof T ? a.canSelect() : !1 }, this.CI); if (w.Gk ? c.qu : c.control) if (c.shift) for (a = a.i; a.next();)c = a.value, c.ib && (c.ib = !1); else for (a = a.i; a.next();)c = a.value, c.ib = !c.ib; else { if (!c.shift) { for (var c = new H(T), d = b.selection.i; d.next();) { var e = d.value; a.contains(e) || c.add(e) } for (c = c.i; c.next();)c.value.ib = !1 } for (a = a.i; a.next();)c = a.value, c.ib || (c.ib = !0) } b.Aa("ChangedSelection") } }; w.defineProperty(ek, { CE: "delay" }, function () { return this.Bo }, function (a) { w.j(a, "number", ek, "delay"); this.Bo = a }); w.defineProperty(ek, { CI: "isPartialInclusion" }, function () { return this.WC }, function (a) { w.j(a, "boolean", ek, "isPartialInclusion"); this.WC = a }); w.defineProperty(ek, { th: "box" }, function () { return this.tm }, function (a) { null !== a && w.G(a, T, ek, "box"); this.tm = a }); function fk() { qg.call(this); 0 < arguments.length && w.jd(fk); this.name = "Panning"; this.xz = new z; this.Ij = !1; var a = this; this.JD = function () { window.document.removeEventListener("scroll", a.JD, !1); a.stopTool() } } w.Ka(fk, qg); w.ga("PanningTool", fk); fk.prototype.canStart = function () { if (!this.isEnabled) return !1; var a = this.g; return null === a || !a.oe && !a.pe || !a.R.left || a.$a !== this && !this.isBeyondDragSize() ? !1 : !0 }; fk.prototype.doActivate = function () { var a = this.g; null !== a && (this.Ij ? (a.R.bubbles = !0, window.document.addEventListener("scroll", this.JD, !1)) : (a.ec = "move", a.bf = !0, this.xz = a.position.copy()), this.sa = !0) }; fk.prototype.doDeactivate = function () { var a = this.g; null !== a && (a.ec = "", this.sa = a.bf = !1) }; fk.prototype.doCancel = function () { var a = this.g; null !== a && (a.position = this.xz, a.bf = !1); this.stopTool() }; fk.prototype.doMouseMove = function () { this.move() }; fk.prototype.doMouseUp = function () { this.move(); this.stopTool() }; fk.prototype.move = function () { var a = this.g; if (this.sa && a) if (this.Ij) a.R.bubbles = !0; else { var b = a.position, c = a.Bc.da, d = a.R.da, e = b.x + c.x - d.x, c = b.y + c.y - d.y; a.oe || (e = b.x); a.pe || (c = b.y); a.position = new z(e, c) } }; w.defineProperty(fk, { bubbles: "bubbles" }, function () { return this.Ij }, function (a) { w.j(a, "boolean", fk, "bubbles"); this.Ij = a }); w.u(fk, { BL: "originalPosition" }, function () { return this.xz }); function gk() { 0 < arguments.length && w.jd(gk); qg.call(this); this.name = "TextEditing"; this.Kz = this.lk = null; this.HD = hk; this.yl = null; this.Sa = ik; this.tl = null; this.eD = 1; this.BD = !0; var a = new Xj; this.mC = null; this.uC = a; this.Qy = null; jk(this, a) } w.ga("TextEditingTool", gk); w.Ka(gk, qg); var kk; gk.LostFocus = kk = w.p(gk, "LostFocus", 0); var lk; gk.MouseDown = lk = w.p(gk, "MouseDown", 1); var mk; gk.Tab = mk = w.p(gk, "Tab", 2); var nk; gk.Enter = nk = w.p(gk, "Enter", 3); gk.SingleClick = w.p(gk, "SingleClick", 0); var hk; gk.SingleClickSelected = hk = w.p(gk, "SingleClickSelected", 1); var ok; gk.DoubleClick = ok = w.p(gk, "DoubleClick", 2); var ik; gk.StateNone = ik = w.p(gk, "StateNone", 0); var pk; gk.StateActive = pk = w.p(gk, "StateActive", 1); var qk; gk.StateEditing = qk = w.p(gk, "StateEditing", 2); var rk; gk.StateValidating = rk = w.p(gk, "StateValidating", 3); var sk; gk.StateInvalid = sk = w.p(gk, "StateInvalid", 4); var tk; gk.StateValidated = tk = w.p(gk, "StateValidated", 5); function jk(a, b) { var c = w.createElement("textarea"); a.Qy = c; c.addEventListener("input", function () { if (null !== a.$g) { var b = a.VI(this.value), c = this.OJ; this.style.width = 20 + b.za.width * c + "px"; this.style.height = 10 + b.za.height * c + "px"; this.rows = b.JI } }, !1); c.addEventListener("keydown", function (b) { if (null !== a.$g) { var c = b.which; 13 === c ? (!1 === a.$g.Cx && b.preventDefault(), a.acceptText(nk)) : 9 === c ? (a.acceptText(mk), b.preventDefault()) : 27 === c && (a.doCancel(), null !== a.g && a.g.doFocus()) } }, !1); c.addEventListener("focus", function () { uk(a) }, !1); c.addEventListener("blur", function () { vk(a) }, !1); b.DB = function () { return c.value }; b.IA = c; b.show = function (a, b, f) { if (f.state === sk) c.style.border = "3px solid red", c.focus(); else { var h = a.Wa(Hb), k = b.position, l = b.scale, m = a.pj() * l; m < f.FF && (m = f.FF); var n = a.Ja.width * m + 6, p = a.Ja.height * m + 2, q = (h.x - k.x) * l, h = (h.y - k.y) * l; c.value = a.text; b.nj.style.font = a.font; c.style.cssText = "position: absolute;z-index: 100;font: inherit;fontSize: " + 100 * m + "%;lineHeight: normal;width: " + n + "px;height: " + p + "px;left: " + ((q - n / 2 | 0) - 1) + "px;top: " + ((h - p / 2 | 0) - 1) + "px;text-align: " + a.textAlign + ";margin: 0;padding: 1px;border: 0;outline: none;white-space: pre-wrap;overflow: hidden;"; c.OJ = m; b.nj.appendChild(c); c.focus(); f.iy && (c.select(), c.setSelectionRange(0, 9999)) } }; b.En = function (a) { a.nj.removeChild(c) } } w.defineProperty(gk, { $g: "textBlock" }, function () { return this.Kz }, function (a) { null !== a && w.G(a, Hh, gk, "textBlock"); this.Kz = a }); w.defineProperty(gk, { lj: "currentTextEditor" }, function () { return this.mC }, function (a) { this.mC = a }); w.defineProperty(gk, { JH: "defaultTextEditor" }, function () { return this.uC }, function (a) { this.uC = a }); w.defineProperty(gk, { pG: "starting" }, function () { return this.HD }, function (a) { w.mb(a, gk, gk, "starting"); this.HD = a }); gk.prototype.canStart = function () { if (!this.isEnabled) return !1; var a = this.g; if (null === a || a.hb || !a.R.left || this.isBeyondDragSize()) return !1; var b = a.Ke(a.R.da, null, function (a) { return a instanceof Hh }); if (null === b || !b.jA || !b.U.canEdit()) return !1; b = b.U; return null === b || this.pG === hk && !b.ib || this.pG === ok && 2 > a.R.Ge ? !1 : !0 }; gk.prototype.doStart = function () { this.sa || null === this.$g || this.doActivate() }; gk.prototype.doActivate = function () { if (!this.sa) { var a = this.g; if (null !== a) { var b = this.$g; null === b && (b = a.Ke(a.R.da, function (a) { return a instanceof Hh ? a : null })); if (null !== b && (this.$g = b, null !== b.U)) { this.sa = !0; this.Sa = pk; var c = this.JH; null !== b.sG && (c = b.sG); this.lk = this.$g.copy(); var d = new B(this.$g.Wa(xb), this.$g.Wa(Nb)); a.dG(d); if (c instanceof Xj) c.show(b, a, this); else { c.style.position = "absolute"; c.style.zIndex = "100"; c.textEditingTool = this; if ("function" === typeof c.onActivate) c.onActivate(); a.nj.appendChild(c); "function" === typeof c.focus && c.focus(); "function" === typeof c.select && this.iy && (c.select(), c.setSelectionRange(0, 9999)) } this.lj = c } } } }; gk.prototype.doCancel = function () { null !== this.tl && this.lj instanceof HTMLElement && (this.lj.style.border = this.tl, this.tl = null); this.stopTool() }; gk.prototype.doMouseUp = function () { !this.sa && this.canStart() && this.doActivate() }; gk.prototype.doMouseDown = function () { this.sa && this.acceptText(lk) }; gk.prototype.acceptText = function (a) { switch (a) { case lk: if (this.Sa === tk) this.lj instanceof HTMLElement && this.lj.focus(); else if (this.Sa === pk || this.Sa === sk || this.Sa === qk) this.Sa = rk, wk(this); break; case kk: case nk: case mk: if (nk === a && !0 === this.Kz.Cx) break; if (this.Sa === pk || this.Sa === sk || this.Sa === qk) this.Sa = rk, wk(this) } }; function wk(a) { var b = a.$g, c = a.g, d = a.lj; if (null !== b && null !== d) { var e = b.text, f = ""; d instanceof Xj ? null !== d.DB && (f = d.DB()) : (f = d.value, f = "function" === typeof f ? f() : f); a.isValidText(b, e, f) ? (a.Pb(a.name), a.Sa = tk, d instanceof Xj ? d.show(b, c, a) : null !== a.tl && (d.style.border = a.tl, a.tl = null), a.Kf = a.name, b.text = f, null !== b.rG && b.rG(b, e, f), null !== c && c.Aa("TextEdited", b, e), a.Mk(), a.stopTool(), null !== c && c.doFocus()) : (a.Sa = sk, null !== b.lA && b.lA(a, e, f), d instanceof Xj ? d.show(b, c, a) : (null === a.tl && (a.tl = d.style.border, d.style.border = "3px solid red"), "function" === typeof d.focus && d.focus())) } } gk.prototype.doDeactivate = function () { var a = this.g; if (null !== a) { this.Sa = ik; this.$g = null; if (null !== this.lj) { var b = this.lj; if (b instanceof Xj) b.En(a, this); else { if ("function" === typeof b.onDeactivate) b.onDeactivate(); null !== b && a.nj.removeChild(b) } } this.sa = !1 } }; gk.prototype.doFocus = function () { uk(this) }; gk.prototype.doBlur = function () { vk(this) }; function uk(a) { if (null !== a.lj) { var b = a.Qy; a.Sa === pk && (a.Sa = qk); "function" === typeof b.select && a.iy && (b.select(), b.setSelectionRange(0, 9999)) } } function vk(a) { if (null !== a.lj) { var b = a.Qy; "function" === typeof b.focus && b.focus(); "function" === typeof b.select && a.iy && (b.select(), b.setSelectionRange(0, 9999)) } } gk.prototype.isValidText = function (a, b, c) { w.G(a, Hh, gk, "isValidText:textblock"); var d = this.tB; if (null !== d && !d(a, b, c)) return !1; d = a.tB; return null === d || d(a, b, c) ? !0 : !1 }; w.defineProperty(gk, { tB: "textValidation" }, function () { return this.yl }, function (a) { null !== a && w.j(a, "function", gk, "textValidation"); this.yl = a }); w.defineProperty(gk, { FF: "minimumEditorScale" }, function () { return this.eD }, function (a) { null !== a && w.j(a, "number", gk, "minimumEditorScale"); this.eD = a }); w.defineProperty(gk, { iy: "selectsTextOnActivate" }, function () { return this.BD }, function (a) { null !== a && w.j(a, "boolean", gk, "selectsTextOnActivate"); this.BD = a }); w.defineProperty(gk, { state: "state" }, function () { return this.Sa }, function (a) { this.Sa !== a && (w.mb(a, gk, gk, "starting"), this.Sa = a) }); gk.prototype.measureTemporaryTextBlock = gk.prototype.VI = function (a) { var b = this.lk; b.text = a; xk(b, this.$g.Wo, Infinity); return b }; function hh() { qg.call(this); this.name = "ToolManager"; this.OG = new H(qg); this.PG = new H(qg); this.QG = new H(qg); this.JC = this.KC = 850; this.zC = (new ia(2, 2)).Ha(); this.VD = 5E3; this.iD = Lh; this.HC = yk; this.qv = this.nC = null; this.fn = -1 } w.Ka(hh, qg); w.ga("ToolManager", hh); var Lh; hh.WheelScroll = Lh = w.p(hh, "WheelScroll", 0); var Kh; hh.WheelZoom = Kh = w.p(hh, "WheelZoom", 1); hh.WheelNone = w.p(hh, "WheelNone", 2); var yk; hh.GestureZoom = yk = w.p(hh, "GestureZoom", 3); var zk; hh.GestureCancel = zk = w.p(hh, "GestureCancel", 4); var Ak; hh.GestureNone = Ak = w.p(hh, "GestureNone", 5); w.defineProperty(hh, { tu: "mouseWheelBehavior" }, function () { return this.iD }, function (a) { w.mb(a, hh, hh, "mouseWheelBehavior"); this.iD = a }); w.defineProperty(hh, { Up: "gestureBehavior" }, function () { return this.HC }, function (a) { w.mb(a, hh, hh, "gestureBehavior"); this.HC = a }); hh.prototype.initializeStandardTools = function () { this.aH = new Vj; this.RF = new Qh; this.MI = new mj; this.aG = new Lj; this.xJ = new Sj; this.BF = new dj; this.te = new nh; this.OH = new ek; this.iJ = new fk; this.bA = new Zj; this.sB = new gk; this.qH = new Wj; this.rH = new Uj }; hh.prototype.updateAdornments = function (a) { var b = this.Ll; if (b instanceof jh && this.qv === a) { var c = b.rb; (null !== a ? c.U === a : null === c) ? this.showToolTip(b, c) : this.hideToolTip() } }; hh.prototype.doMouseDown = function () { var a = this.g; if (null !== a) { var b = a.R; b.vj && this.Up === zk && (b.bubbles = !1); if (b.hu) { this.cancelWaitAfter(); if (this.Up === Ak) { b.bubbles = !0; return } if (this.Up === zk) return; if (a.$a.canStartMultiTouch()) { a.$a.standardPinchZoomStart(); return } } var c = a.oa; c.Xz && 0 !== c.Jh && w.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero"); for (var c = this.cf.length, d = 0; d < c; d++) { var e = this.cf.ea(d); null === e.g && e.Rc(this.g); if (e.canStart()) { a.doFocus(); a.$a = e; a.$a === e && (e.sa || e.doActivate(), e.doMouseDown()); return } } 1 === a.R.button && (this.tu === Lh ? this.tu = Kh : this.tu === Kh && (this.tu = Lh)); this.doActivate(); this.standardWaitAfter(this.gF, b) } }; hh.prototype.doMouseMove = function () { var a = this.g; if (null !== a) { var b = a.R; if (b.hu) { if (this.Up === Ak) { b.bubbles = !0; return } if (this.Up === zk) return; if (a.$a.canStartMultiTouch()) { a.$a.standardPinchZoomMove(); return } } if (this.sa) for (var c = this.bg.length, d = 0; d < c; d++) { var e = this.bg.ea(d); null === e.g && e.Rc(this.g); if (e.canStart()) { a.doFocus(); a.$a = e; a.$a === e && (e.sa || e.doActivate(), e.doMouseMove()); return } } Bk(this, a); null === b.event || "mousemove" !== b.event.type && b.event.cancelable || (b.bubbles = !0) } }; function Bk(a, b) { a.standardMouseOver(); a.isBeyondDragSize() && a.standardWaitAfter(a.sa ? a.gF : a.mI, b.R) } hh.prototype.doCurrentObjectChanged = function (a, b) { var c = this.Ll; null === c || null !== b && c instanceof jh && (b === c || b.Zl(c)) || this.hideToolTip() }; hh.prototype.doWaitAfter = function (a) { var b = this.g; null !== b && b.Fb && (this.doMouseHover(), this.sa || this.doToolTip(), a.vj && !b.R.Cc && (a = a.copy(), a.button = 2, a.buttons = 2, b.R = a, b.it = !0, b.doMouseUp())) }; hh.prototype.doMouseHover = function () { var a = this.g; if (null !== a) { var b = a.R; null === b.Qe && (b.Qe = a.Ke(b.da, null, null)); var c = b.Qe; if (null !== c) for (b.Cc = !1; null !== c;) { a = this.sa ? c.OA : c.PA; if (null !== a && (a(b, c), b.Cc)) break; c = c.O } else c = this.sa ? a.OA : a.PA, null !== c && c(b) } }; hh.prototype.doToolTip = function () { var a = this.g; if (null !== a) { var b = a.R; null === b.Qe && (b.Qe = a.Ke(b.da, null, null)); b = b.Qe; if (null !== b) { if (a = this.Ll, !(a instanceof jh) || b !== a && !b.Zl(a)) { for (; null !== b;) { a = b.vB; if (null !== a) { this.showToolTip(a, b); return } b = b.O } this.hideToolTip() } } else a = a.vB, null !== a ? this.showToolTip(a, null) : this.hideToolTip() } }; hh.prototype.showToolTip = function (a, b) { null !== b && w.G(b, G, hh, "showToolTip:obj"); var c = this.g; if (null !== c) { a !== this.Ll && this.hideToolTip(); if (a instanceof jh) { a.Zf = "Tool"; a.dm = !1; a.scale = 1 / c.scale; a.ud = "ToolTip"; null !== a.placeholder && (a.placeholder.scale = c.scale); c.add(a); if (null !== b) { var c = null, d = b.Rl(); null !== d && (c = d.data); a.rb = b; a.data = c } else a.data = c.ba; a.af(); this.positionToolTip(a, b) } else a instanceof Xj && a !== this.Ll && a.show(b, c, this); this.Ll = a; -1 !== this.fn && (w.clearTimeout(this.fn), this.fn = -1); c = this.TJ; if (0 < c && Infinity !== c) { var e = this; this.fn = w.setTimeout(function () { e.hideToolTip() }, c) } } }; hh.prototype.positionToolTip = function (a) { if (null === a.placeholder) { var b = this.g; if (null !== b) { var c = b.R.da.copy(), d = a.za, e = b.pb; b.R.vj && (c.x -= d.width); c.x + d.width > e.right && (c.x -= d.width + 5); c.x < e.x && (c.x = e.x); c.y = c.y + 20 + d.height > e.bottom ? c.y - (d.height + 5) : c.y + 20; c.y < e.y && (c.y = e.y); a.position = c } } }; hh.prototype.hideToolTip = function () { -1 !== this.fn && (w.clearTimeout(this.fn), this.fn = -1); var a = this.g; if (null !== a) { var b = this.Ll; null !== b && (b instanceof jh ? (a.remove(b), null !== this.qv && this.qv.Bj(b.ud), b.data = null, b.rb = null) : b instanceof Xj && null !== b.En && b.En(a, this), this.Ll = null) } }; w.defineProperty(hh, { Ll: "currentToolTip" }, function () { return this.nC }, function (a) { this.nC = a; this.qv = null !== a && a instanceof jh ? a.uf : null }); hh.prototype.doMouseUp = function () { this.cancelWaitAfter(); var a = this.g; if (null !== a) { if (this.sa) for (var b = this.cg.length, c = 0; c < b; c++) { var d = this.cg.ea(c); null === d.g && d.Rc(this.g); if (d.canStart()) { a.doFocus(); a.$a = d; a.$a === d && (d.sa || d.doActivate(), d.doMouseUp()); return } } a.doFocus(); this.doDeactivate() } }; hh.prototype.doMouseWheel = function () { this.standardMouseWheel() }; hh.prototype.doKeyDown = function () { var a = this.g; null !== a && a.ob.doKeyDown() }; hh.prototype.doKeyUp = function () { var a = this.g; null !== a && a.ob.doKeyUp() }; hh.prototype.doCancel = function () { null !== Oh && Oh.doCancel(); qg.prototype.doCancel.call(this) }; hh.prototype.findTool = function (a) { w.j(a, "string", hh, "findTool:name"); for (var b = this.cf.length, c = 0; c < b; c++) { var d = this.cf.ea(c); if (d.name === a) return d } b = this.bg.length; for (c = 0; c < b; c++)if (d = this.bg.ea(c), d.name === a) return d; b = this.cg.length; for (c = 0; c < b; c++)if (d = this.cg.ea(c), d.name === a) return d; return null }; hh.prototype.replaceTool = function (a, b) { w.j(a, "string", hh, "replaceTool:name"); null !== b && (w.G(b, qg, hh, "replaceTool:newtool"), b.g && b.g !== this.g && w.k("Cannot share tools between Diagrams: " + b.toString()), b.Rc(this.g)); for (var c = this.cf.length, d = 0; d < c; d++) { var e = this.cf.ea(d); if (e.name === a) return null !== b ? this.cf.ig(d, b) : this.cf.$c(d), e } c = this.bg.length; for (d = 0; d < c; d++)if (e = this.bg.ea(d), e.name === a) return null !== b ? this.bg.ig(d, b) : this.bg.$c(d), e; c = this.cg.length; for (d = 0; d < c; d++)if (e = this.cg.ea(d), e.name === a) return null !== b ? this.cg.ig(d, b) : this.cg.$c(d), e; return null }; function Ck(a, b, c, d) { w.j(b, "string", hh, "replaceStandardTool:name"); w.G(d, H, hh, "replaceStandardTool:list"); null !== c && (w.G(c, qg, hh, "replaceStandardTool:newtool"), c.g && c.g !== a.g && w.k("Cannot share tools between Diagrams: " + c.toString()), c.name = b, c.Rc(a.g)); a.findTool(b) ? a.replaceTool(b, c) : null !== c && d.add(c) } w.u(hh, { cf: "mouseDownTools" }, function () { return this.OG }); w.u(hh, { bg: "mouseMoveTools" }, function () { return this.PG }); w.u(hh, { cg: "mouseUpTools" }, function () { return this.QG }); w.defineProperty(hh, { mI: "hoverDelay" }, function () { return this.KC }, function (a) { w.j(a, "number", hh, "hoverDelay"); this.KC = a }); w.defineProperty(hh, { gF: "holdDelay" }, function () { return this.JC }, function (a) { w.j(a, "number", hh, "holdDelay"); this.JC = a }); w.defineProperty(hh, { PH: "dragSize" }, function () { return this.zC }, function (a) { w.G(a, ia, hh, "dragSize"); this.zC = a.S() }); w.defineProperty(hh, { TJ: "toolTipDuration" }, function () { return this.VD }, function (a) { w.j(a, "number", hh, "toolTipDuration"); this.VD = a }); w.defineProperty(hh, { aH: "actionTool" }, function () { return this.findTool("Action") }, function (a) { Ck(this, "Action", a, this.cf) }); w.defineProperty(hh, { RF: "relinkingTool" }, function () { return this.findTool("Relinking") }, function (a) { Ck(this, "Relinking", a, this.cf) }); w.defineProperty(hh, { MI: "linkReshapingTool" }, function () { return this.findTool("LinkReshaping") }, function (a) { Ck(this, "LinkReshaping", a, this.cf) }); w.defineProperty(hh, { aG: "resizingTool" }, function () { return this.findTool("Resizing") }, function (a) { Ck(this, "Resizing", a, this.cf) }); w.defineProperty(hh, { xJ: "rotatingTool" }, function () { return this.findTool("Rotating") }, function (a) { Ck(this, "Rotating", a, this.cf) }); w.defineProperty(hh, { BF: "linkingTool" }, function () { return this.findTool("Linking") }, function (a) { Ck(this, "Linking", a, this.bg) }); w.defineProperty(hh, { te: "draggingTool" }, function () { return this.findTool("Dragging") }, function (a) { Ck(this, "Dragging", a, this.bg) }); w.defineProperty(hh, { OH: "dragSelectingTool" }, function () { return this.findTool("DragSelecting") }, function (a) { Ck(this, "DragSelecting", a, this.bg) }); w.defineProperty(hh, { iJ: "panningTool" }, function () { return this.findTool("Panning") }, function (a) { Ck(this, "Panning", a, this.bg) }); w.defineProperty(hh, { bA: "contextMenuTool" }, function () { return this.findTool("ContextMenu") }, function (a) { Ck(this, "ContextMenu", a, this.cg) }); w.defineProperty(hh, { sB: "textEditingTool" }, function () { return this.findTool("TextEditing") }, function (a) { Ck(this, "TextEditing", a, this.cg) }); w.defineProperty(hh, { qH: "clickCreatingTool" }, function () { return this.findTool("ClickCreating") }, function (a) { Ck(this, "ClickCreating", a, this.cg) }); w.defineProperty(hh, { rH: "clickSelectingTool" }, function () { return this.findTool("ClickSelecting") }, function (a) { Ck(this, "ClickSelecting", a, this.cg) }); function Wg() { this.oC = Dk; this.kr = this.lr = this.$ = null; this.qm = this.mr = this.nr = 0; this.mo = this.qc = this.Ro = this.Wj = !1; this.Xj = this.ef = !0; this.ov = this.nv = this.jC = null; this.iC = 0; this.pv = null; this.cv = new I("string"); this.Yy = 600; this.RG = new z(0, 0); this.XB = this.WB = this.ZD = !1; this.Qm = new la(G, Qk) } w.ga("AnimationManager", Wg); Wg.prototype.Rc = function (a) { this.$ = a }; function Dk(a, b, c, d) { a /= d / 2; return 1 > a ? c / 2 * a * a + b : -c / 2 * (--a * (a - 2) - 1) + b } w.u(Wg, { xK: "animationReasons" }, function () { return this.cv }); Wg.prototype.canStart = function () { return !0 }; Wg.prototype.prepareAutomaticAnimation = Wg.prototype.Un = function (a) { this.ef && (this.Xj || this.$.Hn) && (this.cv.add(a), this.canStart(a) && (this.Wj && this.Hh(), this.qc = !0)) }; function Rk(a) { if (a.ef && (a.cv.clear(), a.qc)) if (!a.mo) a.qc = !1; else if (0 === a.qm) { var b = +new Date; a.qm = b; requestAnimationFrame(function () { if (!1 !== a.qc && !a.Wj && a.qm === b) { var c = a.$; c.qj("temporaryPixelRatio") && (c.kk = 1); Sk(c); a.qc = !1; c.Aa("AnimationStarting"); Tk(a, b) } }) } } function Yk(a, b, c, d, e, f) { if (!(!a.qc || "position" === c && d.L(e) || b instanceof T && !b.kF)) { var h = a.Qm; if (h.contains(b)) { var h = h.ja(b), k = h.start, l = h.end; void 0 === k[c] && (k[c] = Zk(d)); h.$w && void 0 !== l[c] ? h.Kt[c] = Zk(e) : (f || (h.Kt[c] = Zk(e)), l[c] = Zk(e)); f && 0 === c.indexOf("position:") && b instanceof T && (h.Kt.location = Zk(b.location)) } else k = new sa, l = new sa, k[c] = Zk(d), l[c] = Zk(e), d = l, e = k.position, e instanceof z && !e.I() && a.cv.contains("Expand SubGraph") && e.assign(d.position), k = new Qk(k, l, f), f && 0 === c.indexOf("position:") && b instanceof T && (k.Kt.location = Zk(b.location)), h.add(b, k); a.mo = !0 } } function Zk(a) { return a instanceof z ? a.copy() : a instanceof ia ? a.copy() : a } function Tk(a, b) { var c; function d() { if (!1 !== f.Wj && f.qm === b) { var a = +new Date, c = a > s ? m : a - r; $k(f); al(f, e, q, h, c, m); f.nv && f.nv(); Ri(e); bl(f); a > s ? cl(f) : requestAnimationFrame(d) } } void 0 === c && (c = new sa); var e = a.$; if (null !== e) { a.Wj = !0; var f = a, h = c.WK || a.oC, k = c.wL || null, l = c.xL || null, m = c.duration || a.Yy, n = a.RG; for (c = a.Qm.i; c.next();) { var p = c.value.start.position; p instanceof z && (p.I() || p.assign(n)) } a.jC = h; a.nv = k; a.ov = l; a.iC = m; a.pv = a.Qm; var q = a.pv; for (c = q.i; c.next();)k = c.value.end, k["position:placeholder"] && (l = k["position:placeholder"], n = l.Wa(xb), n.x += l.padding.left, n.y += l.padding.top, k["position:placeholder"] = n); $k(a); al(a, e, q, h, 0, m); Ri(a.$); bl(a); var r = +new Date, s = r + m; f.qm === b && requestAnimationFrame(function () { d() }) } } function $k(a) { if (!a.Ro) { var b = a.$; a.ZD = b.wb; a.WB = b.Oe; a.XB = b.Mu; b.wb = !0; b.Oe = !0; b.Mu = !0; a.Ro = !0 } } function bl(a) { var b = a.$; b.wb = a.ZD; b.Oe = a.WB; b.Mu = a.XB; a.Ro = !1 } function al(a, b, c, d, e, f) { for (c = c.i; c.next();) { var h = c.key, k = c.value, l = k.start, k = k.end, m; for (m in k) if (("position" !== m || !k["position:placeholder"] && !k["position:node"]) && void 0 !== dl[m]) dl[m](h, l[m], k[m], d, e, f) } d = b.BA; b.BA = !0; m = a.oC; 0 !== a.nr && 0 !== a.mr && (c = a.nr, b.ub = m(e, c, a.mr - c, f)); null !== a.lr && null !== a.kr && (c = a.lr, a = a.kr, b.jb = new z(m(e, c.x, a.x - c.x, f), m(e, c.y, a.y - c.y, f))); b.BA = d } Wg.prototype.stopAnimation = Wg.prototype.Hh = function () { !0 === this.qc && (this.qc = !1, this.qm = 0, this.mo && this.$.Me()); this.Wj && this.ef && cl(this) }; function cl(a) { a.Wj = !1; a.mo = !1; $k(a); for (var b = a.$, c = a.jC, d = a.iC, e = a.pv.i; e.next();) { var f = e.key, h = e.value, k = h.start, l = h.end, m = h.Kt, n; for (n in l) if (void 0 !== dl[n]) { var p = n; !h.$w || "position:node" !== p && "position:placeholder" !== p || (p = "position"); dl[p](f, k[n], void 0 !== m[n] ? m[n] : h.$w ? k[n] : l[n], c, d, d) } h.$w && void 0 !== m.location && f instanceof T && (f.location = m.location); h.Yx && f instanceof T && f.yd(!1) } for (c = a.$.links; c.next();)d = c.value, null !== d.kp && (d.points = d.kp, d.kp = null); b.Lx.clear(); b.kk = null; b.sc(); b.na(); b.ag(); el(b); bl(a); a.ov && a.ov(); a.qm = 0; a.pv = null; a.ov = null; a.nv = null; a.lr = null; a.kr = null; a.nr = 0; a.mr = 0; a.Qm = new la(G, Qk); b.Aa("AnimationFinished"); b.Me() } function fl(a, b, c) { var d = b.Y, e = c.Y, f = null; c instanceof V && (f = c.placeholder); null !== f ? (d = f.Wa(xb), d.x += f.padding.left, d.y += f.padding.top, Yk(a, b, "position", d, b.position, !1)) : Yk(a, b, "position", new z(e.x + e.width / 2 - d.width / 2, e.y + e.height / 2 - d.height / 2), b.position, !1); Yk(a, b, "scale", .01, b.scale, !1); if (b instanceof V) for (b = b.Oc; b.next();)f = b.value, f instanceof U && fl(a, f, c) } function gl(a, b, c) { if (b.isVisible()) { var d = null; c instanceof V && (d = c.placeholder); null !== d ? Yk(a, b, "position:placeholder", b.position, d, !0) : Yk(a, b, "position:node", b.position, c, !0); Yk(a, b, "scale", b.scale, .01, !0); a.qc && (d = a.Qm, d.contains(b) && (d.ja(b).Yx = !0)); if (b instanceof V) for (b = b.Oc; b.next();)d = b.value, d instanceof U && gl(a, d, c) } } function hl(a, b, c) { a.qc && (null === a.lr && b.I() && null === a.kr && (a.lr = b.copy()), a.kr = c.copy(), a.mo = !0) } function il(a, b, c) { a.qc && a.$.Hn && (0 === a.nr && 0 === a.mr && (a.nr = b), a.mr = c, a.mo = !0) } w.defineProperty(Wg, { isEnabled: "isEnabled" }, function () { return this.ef }, function (a) { w.j(a, "boolean", Wg, "isEnabled"); this.ef = a }); w.defineProperty(Wg, { duration: "duration" }, function () { return this.Yy }, function (a) { w.j(a, "number", Wg, "duration"); 1 > a && w.Fa(a, ">= 1", Wg, "duration"); this.Yy = a }); w.u(Wg, { mf: "isAnimating" }, function () { return this.Wj }); w.u(Wg, { DI: "isTicking" }, function () { return this.Ro }); w.defineProperty(Wg, { sF: "isInitial" }, function () { return this.Xj }, function (a) { w.j(a, "boolean", Wg, "isInitial"); this.Xj = a }); function Qk(a, b, c) { this.start = a; this.end = b; this.Kt = new sa; this.$w = c; this.Yx = !1 } var dl = { opacity: function (a, b, c, d, e, f) { a.opacity = d(e, b, c - b, f) }, position: function (a, b, c, d, e, f) { e !== f ? a.my(d(e, b.x, c.x - b.x, f), d(e, b.y, c.y - b.y, f)) : a.position = new z(d(e, b.x, c.x - b.x, f), d(e, b.y, c.y - b.y, f)) }, "position:node": function (a, b, c, d, e, f) { var h = a.Y, k = c.Y; c = k.x + k.width / 2 - h.width / 2; h = k.y + k.height / 2 - h.height / 2; e !== f ? a.my(d(e, b.x, c - b.x, f), d(e, b.y, h - b.y, f)) : a.position = new z(d(e, b.x, c - b.x, f), d(e, b.y, h - b.y, f)) }, "position:placeholder": function (a, b, c, d, e, f) { e !== f ? a.my(d(e, b.x, c.x - b.x, f), d(e, b.y, c.y - b.y, f)) : a.position = new z(d(e, b.x, c.x - b.x, f), d(e, b.y, c.y - b.y, f)) }, scale: function (a, b, c, d, e, f) { a.scale = d(e, b, c - b, f) }, visible: function (a, b, c, d, e, f) { a.visible = e !== f ? b : c } }; function pg() { 0 < arguments.length && w.jd(pg); w.nc(this); this.$ = null; this.zb = new H(T); this.Sb = ""; this.yc = 1; this.nz = !1; this.ul = this.Pz = this.Wk = this.Vk = this.Uk = this.Tk = this.Rk = this.Sk = this.Qk = this.Yk = this.Pk = this.Xk = this.Ok = this.Nk = !0; this.kz = !1; this.kw = [] } w.ga("Layer", pg); pg.prototype.Rc = function (a) { this.$ = a }; pg.prototype.toString = function (a) { void 0 === a && (a = 0); var b = 'Layer "' + this.name + '"'; if (0 >= a) return b; for (var c = 0, d = 0, e = 0, f = 0, h = 0, k = this.zb.i; k.next();) { var l = k.value; l instanceof V ? e++ : l instanceof U ? d++ : l instanceof W ? f++ : l instanceof jh ? h++ : c++ } k = ""; 0 < c && (k += c + " Parts "); 0 < d && (k += d + " Nodes "); 0 < e && (k += e + " Groups "); 0 < f && (k += f + " Links "); 0 < h && (k += h + " Adornments "); if (1 < a) for (a = this.zb.i; a.next();)c = a.value, k += "\n " + c.toString(), d = c.data, null !== d && w.Nd(d) && (k += " #" + w.Nd(d)), c instanceof U ? k += " " + Sf(d) : c instanceof W && (k += " " + Sf(c.V) + " " + Sf(c.Z)); return b + " " + this.zb.count + ": " + k }; pg.prototype.findObjectAt = pg.prototype.Ke = function (a, b, c) { void 0 === b && (b = null); void 0 === c && (c = null); if (!1 === this.ul) return null; var d = !1; null !== this.g && this.g.pb.Ia(a) && (d = !0); for (var e = w.K(), f = this.zb.n, h = f.length; h--;) { var k = f[h]; if ((!0 !== d || !1 !== jl(k)) && k.isVisible() && (e.assign(a), La(e, k.rh), k = k.Ke(e, b, c), null !== k && (null !== b && (k = b(k)), null !== k && (null === c || c(k))))) return w.v(e), k } w.v(e); return null }; pg.prototype.findObjectsAt = pg.prototype.Nt = function (a, b, c, d) { void 0 === b && (b = null); void 0 === c && (c = null); d instanceof H || d instanceof I || (d = new I(G)); if (!1 === this.ul) return d; var e = !1; null !== this.g && this.g.pb.Ia(a) && (e = !0); for (var f = w.K(), h = this.zb.n, k = h.length; k--;) { var l = h[k]; if ((!0 !== e || !1 !== jl(l)) && l.isVisible()) { f.assign(a); La(f, l.rh); var m = l; l.Nt(f, b, c, d) && (null !== b && (m = b(m)), null === m || null !== c && !c(m) || (d instanceof I && d.add(m), d instanceof H && d.add(m))) } } w.v(f); return d }; pg.prototype.findObjectsIn = pg.prototype.zk = function (a, b, c, d, e) { void 0 === b && (b = null); void 0 === c && (c = null); void 0 === d && (d = !1); e instanceof H || e instanceof I || (e = new I(G)); if (!1 === this.ul) return e; var f = !1; null !== this.g && this.g.pb.wk(a) && (f = !0); for (var h = this.zb.n, k = h.length; k--;) { var l = h[k]; if ((!0 !== f || !1 !== jl(l)) && l.isVisible()) { var m = l; l.zk(a, b, c, d, e) && (null !== b && (m = b(m)), null === m || null !== c && !c(m) || (e instanceof I && e.add(m), e instanceof H && e.add(m))) } } return e }; pg.prototype.mA = function (a, b, c, d, e, f, h) { if (!1 === this.ul) return e; for (var k = this.zb.n, l = k.length; l--;) { var m = k[l]; if ((!0 !== h || !1 !== jl(m)) && f(m) && m.isVisible()) { var n = m; m.zk(a, b, c, d, e) && (null !== b && (n = b(n)), null === n || null !== c && !c(n) || (e instanceof I && e.add(n), e instanceof H && e.add(n))) } } return e }; pg.prototype.findObjectsNear = pg.prototype.xn = function (a, b, c, d, e, f) { void 0 === c && (c = null); void 0 === d && (d = null); void 0 === e && (e = !0); if (!1 !== e && !0 !== e) { if (e instanceof H || e instanceof I) f = e; e = !0 } f instanceof H || f instanceof I || (f = new I(G)); if (!1 === this.ul) return f; var h = !1; null !== this.g && this.g.pb.Ia(a) && (h = !0); for (var k = w.K(), l = w.K(), m = this.zb.n, n = m.length; n--;) { var p = m[n]; if ((!0 !== h || !1 !== jl(p)) && p.isVisible()) { k.assign(a); La(k, p.rh); l.m(a.x + b, a.y); La(l, p.rh); var q = p; p.xn(k, l, c, d, e, f) && (null !== c && (q = c(q)), null === q || null !== d && !d(q) || (f instanceof I && f.add(q), f instanceof H && f.add(q))) } } w.v(k); w.v(l); return f }; g = pg.prototype; g.Gf = function (a, b) { if (this.visible) { var c; c = void 0 === b ? a.pb : b; for (var d = this.zb.n, e = d.length, f = 0; f < e; f++) { var h = d[f]; h.aD = f; if (!(h instanceof W && !1 === h.kg)) { if (h instanceof jh) { var k = h; if (null !== k.uf) continue } if (Za(h.Y, c)) for (h.Gf(!0), kl(h), h = h.Pw; h.next();)k = h.value, xk(k, Infinity, Infinity), k.jc(), k.Gf(!0); else h.Gf(!1), null !== h.Pw && 0 < h.Pw.count && kl(h) } } } }; g.ue = function (a, b, c) { if (this.visible && 0 !== this.yc && (void 0 === c && (c = !0), c || !this.Mc)) { c = this.zb.n; var d = c.length; if (0 !== d) { 1 !== this.yc && (a.globalAlpha = this.yc); var e = this.kw; e.length = 0; for (var f = b.scale, h = 0; h < d; h++) { var k = c[h]; if (jl(k)) { if (k instanceof W) { var l = k; l.ac && e.push(l); if (!1 === l.kg) continue } l = k.Y; 1 < l.width * f || 1 < l.height * f ? k.ue(a, b) : ll(k, a) } } a.globalAlpha = 1 } } }; function ml(a, b, c, d) { if (a.visible && 0 !== a.yc) { 1 !== a.yc && (b.globalAlpha = a.yc); var e = a.kw; e.length = 0; var f = c.scale; a = a.zb.n; for (var h = a.length, k = d.length, l = 0; l < h; l++) { var m = a[l]; if (jl(m)) { if (m instanceof W) { var n = m; n.ac && e.push(n); if (!1 === n.kg) continue } var n = nl(m, m.Y), p; a: { p = n; for (var q = d, r = k, s = 2 / f, u = 4 / f, t = 0; t < r; t++) { var x = q[t]; if (0 !== x.width && 0 !== x.height && p.iF(x.x - s, x.y - s, x.width + u, x.height + u)) { p = !0; break a } } p = !1 } p && (1 < n.width * f || 1 < n.height * f ? m.ue(b, c) : ll(m, b)) } } b.globalAlpha = 1 } } g.h = function (a, b, c, d, e) { var f = this.g; null !== f && f.Zc(Of, a, this, b, c, d, e) }; g.Xp = function (a, b, c) { var d = this.zb; b.Uv = this; if (a >= d.count) a = d.count; else if (d.ea(a) === b) return -1; d.Pd(a, b); b.$t(c); d = this.g; null !== d && (c ? d.na() : d.Xp(b)); ol(this, a, b); return a }; g.lf = function (a, b, c) { if (!c && b.layer !== this && null !== b.layer) return b.layer.lf(a, b, c); var d = this.zb; if (0 > a || a >= d.length) { if (a = d.indexOf(b), 0 > a) return -1 } else if (d.ea(a) !== b && (a = d.indexOf(b), 0 > a)) return -1; b.au(c); d.$c(a); d = this.g; null !== d && (c ? d.na() : d.lf(b)); b.Uv = null; return a }; function ol(a, b, c) { b = pl(a, b, c); if (c instanceof V && null !== c && isNaN(c.ho)) { if (0 !== c.Oc.count) { for (var d = -1, e = a.zb.n, f = e.length, h = 0; h < f; h++) { var k = e[h]; if (k === c && (b = h, 0 <= d)) break; if (0 > d && k.Da === c && (d = h, 0 <= b)) break } !(0 > d) && d < b && (e = a.zb, e.$c(b), e.Pd(d, c)) } c = c.Da; null !== c && ol(a, -1, c) } } function pl(a, b, c) { var d = c.ho; if (isNaN(d)) return b; a = a.zb; var e = a.count; if (1 >= e) return b; 0 > b && (b = a.indexOf(c)); if (0 > b) return -1; for (var f = b - 1, h = NaN; 0 <= f;) { h = a.ea(f).ho; if (!isNaN(h)) break; f-- } for (var k = b + 1, l = NaN; k < e;) { l = a.ea(k).ho; if (!isNaN(l)) break; k++ } if (!isNaN(h) && h > d) for (; ;) { if (-1 === f || h <= d) { f++; if (f === b) break; a.$c(b); a.Pd(f, c); return f } for (h = NaN; 0 <= --f && (h = a.ea(f).ho, isNaN(h));); } else if (!isNaN(l) && l < d) for (; ;) { if (k === e || l >= d) { k--; if (k === b) break; a.$c(b); a.Pd(k, c); return k } for (l = NaN; ++k < e && (l = a.ea(k).ho, isNaN(l));); } return b } g.clear = function () { for (var a = this.zb.gc(), b = a.length, c = 0; c < b; c++)a[c].Gf(!1), this.lf(-1, a[c], !1) }; w.u(pg, { Kk: "parts" }, function () { return this.zb.i }); w.u(pg, { EL: "partsBackwards" }, function () { return this.zb.In }); w.u(pg, { g: "diagram" }, function () { return this.$ }); w.defineProperty(pg, { name: "name" }, function () { return this.Sb }, function (a) { w.j(a, "string", pg, "name"); var b = this.Sb; if (b !== a) { var c = this.g; if (null !== c) for ("" === b && w.k("Cannot rename default Layer to: " + a), c = c.Ix; c.next();)c.value.name === a && w.k("Layer.name is already present in this diagram: " + a); this.Sb = a; this.h("name", b, a); for (a = this.zb.i; a.next();)a.value.Zf = this.Sb } }); w.defineProperty(pg, { opacity: "opacity" }, function () { return this.yc }, function (a) { var b = this.yc; b !== a && (w.j(a, "number", pg, "opacity"), (0 > a || 1 < a) && w.Fa(a, "0 <= value <= 1", pg, "opacity"), this.yc = a, this.h("opacity", b, a), a = this.g, null !== a && a.na()) }); w.defineProperty(pg, { Mc: "isTemporary" }, function () { return this.nz }, function (a) { var b = this.nz; b !== a && (w.j(a, "boolean", pg, "isTemporary"), this.nz = a, this.h("isTemporary", b, a)) }); w.defineProperty(pg, { visible: "visible" }, function () { return this.Pz }, function (a) { var b = this.Pz; if (b !== a) { w.j(a, "boolean", pg, "visible"); this.Pz = a; this.h("visible", b, a); for (b = this.zb.i; b.next();)b.value.yd(a); a = this.g; null !== a && a.na() } }); w.defineProperty(pg, { Wg: "pickable" }, function () { return this.ul }, function (a) { var b = this.ul; b !== a && (w.j(a, "boolean", pg, "pickable"), this.ul = a, this.h("pickable", b, a)) }); w.defineProperty(pg, { lF: "isBoundsIncluded" }, function () { return this.kz }, function (a) { this.kz !== a && (this.kz = a, null !== this.g && this.g.sc()) }); w.defineProperty(pg, { tk: "allowCopy" }, function () { return this.Nk }, function (a) { var b = this.Nk; b !== a && (w.j(a, "boolean", pg, "allowCopy"), this.Nk = a, this.h("allowCopy", b, a)) }); w.defineProperty(pg, { hn: "allowDelete" }, function () { return this.Ok }, function (a) { var b = this.Ok; b !== a && (w.j(a, "boolean", pg, "allowDelete"), this.Ok = a, this.h("allowDelete", b, a)) }); w.defineProperty(pg, { Tw: "allowTextEdit" }, function () { return this.Xk }, function (a) { var b = this.Xk; b !== a && (w.j(a, "boolean", pg, "allowTextEdit"), this.Xk = a, this.h("allowTextEdit", b, a)) }); w.defineProperty(pg, { Qw: "allowGroup" }, function () { return this.Pk }, function (a) { var b = this.Pk; b !== a && (w.j(a, "boolean", pg, "allowGroup"), this.Pk = a, this.h("allowGroup", b, a)) }); w.defineProperty(pg, { Uw: "allowUngroup" }, function () { return this.Yk }, function (a) { var b = this.Yk; b !== a && (w.j(a, "boolean", pg, "allowUngroup"), this.Yk = a, this.h("allowUngroup", b, a)) }); w.defineProperty(pg, { Bt: "allowLink" }, function () { return this.Qk }, function (a) { var b = this.Qk; b !== a && (w.j(a, "boolean", pg, "allowLink"), this.Qk = a, this.h("allowLink", b, a)) }); w.defineProperty(pg, { jn: "allowRelink" }, function () { return this.Sk }, function (a) { var b = this.Sk; b !== a && (w.j(a, "boolean", pg, "allowRelink"), this.Sk = a, this.h("allowRelink", b, a)) }); w.defineProperty(pg, { Fl: "allowMove" }, function () { return this.Rk }, function (a) { var b = this.Rk; b !== a && (w.j(a, "boolean", pg, "allowMove"), this.Rk = a, this.h("allowMove", b, a)) }); w.defineProperty(pg, { Rw: "allowReshape" }, function () { return this.Tk }, function (a) { var b = this.Tk; b !== a && (w.j(a, "boolean", pg, "allowReshape"), this.Tk = a, this.h("allowReshape", b, a)) }); w.defineProperty(pg, { Ct: "allowResize" }, function () { return this.Uk }, function (a) { var b = this.Uk; b !== a && (w.j(a, "boolean", pg, "allowResize"), this.Uk = a, this.h("allowResize", b, a)) }); w.defineProperty(pg, { Sw: "allowRotate" }, function () { return this.Vk }, function (a) { var b = this.Vk; b !== a && (w.j(a, "boolean", pg, "allowRotate"), this.Vk = a, this.h("allowRotate", b, a)) }); w.defineProperty(pg, { vf: "allowSelect" }, function () { return this.Wk }, function (a) { var b = this.Wk; b !== a && (w.j(a, "boolean", pg, "allowSelect"), this.Wk = a, this.h("allowSelect", b, a)) }); function D(a) { function b() { window.document.removeEventListener("DOMContentLoaded", b, !1); ql(c) } 1 < arguments.length && w.k("Diagram constructor can only take one optional argument, the DIV HTML element or its id."); w.nc(this); rl = []; this.Tc = !0; this.RB = new Wg; this.RB.Rc(this); this.Gd = 17; this.Mr = !1; this.Az = "default"; var c = this; null !== window.document.body ? ql(this) : window.document.addEventListener("DOMContentLoaded", b, !1); this.cc = new H(pg); this.Lb = this.Ib = 0; this.hk = this.Mb = this.qf = this.Fb = null; this.XF(); this.Oo = null; this.WF(); this.jb = (new z(NaN, NaN)).freeze(); this.ub = 1; this.Jv = (new z(NaN, NaN)).freeze(); this.Kv = NaN; this.bw = 1E-4; this.$v = 100; this.fd = new ja; this.Mw = (new z(NaN, NaN)).freeze(); this.Bv = (new B(NaN, NaN, NaN, NaN)).freeze(); this.uw = (new db(0, 0, 0, 0)).freeze(); this.vw = sl; this.rw = this.pw = null; this.sm = oh; this.so = rc; this.hl = oh; this.Lo = rc; this.Lv = this.Iv = xb; this.Ce = !0; this.Ir = !1; this.vg = new I(T); this.bl = new la(W, B); this.pr = !0; this.Nq = 250; this.no = -1; this.fv = (new db(16, 16, 16, 16)).freeze(); this.tv = this.Sf = !1; this.Go = !0; this.Ki = new Bf; this.Vc = new Bf; this.Rb = new Bf; this.ih = this.yi = null; this.it = !1; this.Ty = this.Uy = null; tl(this); this.ep = new I(U); this.zl = new I(V); this.Yo = new I(W); this.zb = new I(T); this.Rv = !0; this.Hw = ul; this.NC = !1; this.Jw = Vi; this.Oy = this.Ry = this.Lz = null; this.mv = ""; this.jr = "auto"; this.Ci = this.ej = this.Ti = this.ew = this.Ui = this.Vi = this.Wi = this.Bi = this.Hi = this.zi = null; this.vz = !1; this.vD = {}; this.ow = 0; this.$i = [null, null]; this.Ly = null; this.Fq = this.Sy = this.Gz = this.CD = this.dj = !1; this.YC = !0; this.mz = this.$d = !1; this.me = null; var d = this; this.fD = function (a) { if (a.ba === d.ba && d.Ta) { d.Ta = !1; try { var b = a.Ac; "" === a.nf && b === Of && vl(d, a.object, a.propertyName) } finally { d.Ta = !0 } } }; this.gD = function (a) { wl(d, a) }; this.bE = !0; this.fh = -2; this.Di = new la(Object, T); this.Kj = new la(Object, W); this.Fm = new la(Object, Array); this.gp = new la("string", Array); this.yz = new H(xl); this.Mi = !1; this.Ok = this.Nk = this.Vu = this.ef = !0; this.Xu = this.Wu = !1; this.bv = this.$u = this.Wk = this.Vk = this.Uk = this.Tk = this.Rk = this.Sk = this.Qk = this.Zu = this.Yk = this.Pk = this.Xk = !0; this.Dm = this.VC = !1; this.av = this.Yu = this.Gv = this.Fv = !0; this.xw = this.tw = 16; this.Cz = this.sw = !1; this.Ss = this.ww = null; this.Dz = this.Ez = 0; this.gf = (new db(5)).freeze(); this.zw = (new I(T)).freeze(); this.aw = 999999999; this.Hv = (new I(T)).freeze(); this.il = this.Bm = this.Vj = !0; this.fl = this.Uj = !1; this.ke = null; this.dv = !0; this.gh = !1; this.NG = new I(W); this.LC = new I(yl); this.Fd = null; this.mD = 1; this.FD = 0; this.ph = { scale: 1, position: new z, bounds: new B, isScroll: !1 }; this.aE = (new B(NaN, NaN, NaN, NaN)).freeze(); this.uv = (new B(NaN, NaN, NaN, NaN)).freeze(); this.Sv = !1; this.wv = null; this.lw = new I(zl); Al(this); this.Wv = this.Dv = this.fw = this.rC = this.qC = this.sC = this.ak = this.dl = this.Xi = null; Bl(this); this.qd = null; this.Cv = !1; this.vo = null; this.eb = new hh; this.eb.initializeStandardTools(); this.$a = this.Gt = this.eb; this.ob = new rg; this.ba = new R; this.dj = !0; this.Tb = new sg; this.dj = !1; this.DC = this.Xy = null; this.Dd = 1; this.kk = null; var e = w.vfo.split("."); !0 !== w.hx.licenseKey && "1" === e[0] && 7 > parseInt(e[1], 10) && (w.trace("Warning: You have entered a license key for GoJS version 1.7 or later, but this library is version " + w.vfo + ". This license key will do nothing until you upgrade to GoJS 1.7 or later."), w.hx.licenseKey = !0); this.ml = 1; this.Hm = 0; this.$C = new z; this.XD = 500; this.ev = new z; this.at = null; this.jl = !1; this.preventDefault = this.Xx = this.NF = this.OF = this.MF = this.Qn = this.Rg = this.Rn = this.On = this.Pn = this.EB = this.wB = this.xB = this.yB = this.wl = this.Os = this.vl = this.Ns = null; this.jD = 1; this.Ov = !1; this.gl = new Cl; void 0 !== a && Dl(this, a); this.Tc = !1 } w.ga("Diagram", D); D.prototype.clear = D.prototype.clear = function () { var a = null; null !== this.qd && (a = this.qd.U); this.ba.clear(); for (var b = this.cc.length, c = 0; c < b; c++)this.cc.n[c].clear(); this.vg.clear(); this.bl.clear(); this.ep.clear(); this.zl.clear(); this.Yo.clear(); this.zb.clear(); this.Di.clear(); this.Kj.clear(); this.Fm.clear(); this.zw.Qa(); this.zw.clear(); this.zw.freeze(); this.Hv.Qa(); this.Hv.clear(); this.Hv.freeze(); fh = this.vo = null; gh = ""; this.uv = (new B(NaN, NaN, NaN, NaN)).freeze(); null !== a && (this.add(a), this.zb.remove(a)); this.na() }; D.prototype.reset = D.prototype.reset = function () { this.Tc = !0; this.clear(); this.cc = new H(pg); this.XF(); this.WF(); this.jb = (new z(NaN, NaN)).freeze(); this.ub = 1; this.Jv = (new z(NaN, NaN)).freeze(); this.Kv = NaN; this.bw = 1E-4; this.$v = 100; this.Mw = (new z(NaN, NaN)).freeze(); this.Bv = (new B(NaN, NaN, NaN, NaN)).freeze(); this.uw = (new db(0, 0, 0, 0)).freeze(); this.vw = sl; this.rw = this.pw = null; this.sm = oh; this.so = rc; this.hl = oh; this.Lo = rc; this.Lv = this.Iv = xb; this.Nq = 250; this.fv = (new db(16, 16, 16, 16)).freeze(); this.Rv = !0; this.Hw = ul; this.Jw = Vi; this.jr = "auto"; this.Ci = this.ej = this.Ti = this.ew = this.Ui = this.Vi = this.Wi = this.Bi = this.Hi = this.zi = null; this.Mi = !1; this.Ok = this.Nk = this.Vu = this.ef = !0; this.Xu = this.Wu = !1; this.av = this.Yu = this.Gv = this.Fv = this.bv = this.$u = this.Wk = this.Vk = this.Uk = this.Tk = this.Rk = this.Sk = this.Qk = this.Zu = this.Yk = this.Pk = this.Xk = !0; this.xw = this.tw = 16; this.gf = (new db(5)).freeze(); this.aw = 999999999; this.ke = null; this.Sv = !1; Bl(this); this.qd = null; this.eb = new hh; this.eb.initializeStandardTools(); this.$a = this.Gt = this.eb; this.ob = new rg; this.dj = !0; Al(this); this.Tb = new sg; this.dj = !1; this.ba = new R; this.gh = !1; this.Go = !0; this.Tc = this.Sf = !1; this.na(); this.ih = this.yi = null; tl(this); this.mv = "" }; function Bl(a) { a.Xi = new la("string", T); var b = new U, c = new Hh; c.bind(new ah("text", "", Sf)); b.add(c); a.sC = b; a.Xi.add("", b); b = new U; c = new Hh; c.stroke = "brown"; c.bind(new ah("text", "", Sf)); b.add(c); a.Xi.add("Comment", b); b = new U; b.dm = !1; b.Vz = !1; c = new Y; c.Cb = "Ellipse"; c.fill = "black"; c.stroke = null; c.Ca = (new ia(3, 3)).Ha(); b.add(c); a.Xi.add("LinkLabel", b); a.dl = new la("string", V); b = new V; b.gB = "GROUPPANEL"; b.type = El; c = new Hh; c.font = "bold 12pt sans-serif"; c.bind(new ah("text", "", Sf)); b.add(c); c = new C(Fl); c.name = "GROUPPANEL"; var d = new Y; d.Cb = "Rectangle"; d.fill = "rgba(128,128,128,0.2)"; d.stroke = "black"; c.add(d); d = new Nj; d.padding = (new db(5, 5, 5, 5)).Ha(); c.add(d); b.add(c); a.qC = b; a.dl.add("", b); a.ak = new la("string", W); b = new W; c = new Y; c.Yf = !0; b.add(c); c = new Y; c.yq = "Standard"; c.fill = "black"; c.stroke = null; c.lb = 0; b.add(c); a.rC = b; a.ak.add("", b); b = new W; c = new Y; c.Yf = !0; c.stroke = "brown"; b.add(c); a.ak.add("Comment", b); b = new jh; b.type = Fl; c = new Y; c.fill = null; c.stroke = "dodgerblue"; c.lb = 3; b.add(c); c = new Nj; c.margin = (new db(1.5, 1.5, 1.5, 1.5)).Ha(); b.add(c); a.fw = b; a.Dv = b; b = new jh; b.type = hj; c = new Y; c.Yf = !0; c.fill = null; c.stroke = "dodgerblue"; c.lb = 3; b.add(c); a.Wv = b } function ql(a) { var b = w.createElement("p"); b.style.width = "100%"; b.style.height = "200px"; b.style.boxSizing = "content-box"; var c = w.createElement("div"); c.style.position = "absolute"; c.style.visibility = "hidden"; c.style.width = "200px"; c.style.height = "150px"; c.style.overflow = "hidden"; c.style.boxSizing = "content-box"; c.appendChild(b); window.document.body.appendChild(c); var d = b.offsetWidth; c.style.overflow = "scroll"; b = b.offsetWidth; d === b && (b = c.clientWidth); window.document.body.removeChild(c); c = d - b; 0 !== c || w.qF || (c = 11); a.Gd = c; c = w.createElement("div"); c.dir = "rtl"; c.style.cssText = "font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;"; c.textContent = "A"; window.document.body.appendChild(c); d = "reverse"; 0 < c.scrollLeft ? d = "default" : (c.scrollLeft = 1, 0 === c.scrollLeft && (d = "negative")); window.document.body.removeChild(c); a.Az = d } D.prototype.ic = function (a) { a.Ee === D ? this.Hl = a : w.Ej(this, a) }; D.prototype.toString = function (a) { void 0 === a && (a = 0); var b = ""; this.nj && this.nj.id && (b = this.nj.id); b = 'Diagram "' + b + '"'; if (0 >= a) return b; for (var c = this.cc.i; c.next();)b += "\n " + c.value.toString(a - 1); return b }; D.fromDiv = function (a) { var b = a; "string" === typeof a && (b = window.document.getElementById(a)); return b instanceof HTMLDivElement && b.$ instanceof D ? b.$ : null }; w.defineProperty(D, { nj: "div" }, function () { return this.Mb }, function (a) { null !== a && w.G(a, HTMLDivElement, D, "div"); if (this.Mb !== a) { rl = []; var b = this.Mb; null !== b ? (b.$ = void 0, b.innerHTML = "", null !== this.Fb && (this.Fb.removeEventListener("touchstart", this.yB, !1), this.Fb.removeEventListener("touchmove", this.xB, !1), this.Fb.removeEventListener("touchend", this.wB, !1), this.Fb.Jd.$ = null), b = this.eb, null !== b && (b.cf.each(function (a) { a.cancelWaitAfter() }), b.bg.each(function (a) { a.cancelWaitAfter() }), b.cg.each(function (a) { a.cancelWaitAfter() })), b.cancelWaitAfter(), this.$a.doCancel(), this.qf = this.Fb = null, window.removeEventListener("resize", this.EB, !1), window.removeEventListener("mousemove", this.Pn, !0), window.removeEventListener("mousedown", this.On, !0), window.removeEventListener("mouseup", this.Rn, !0), window.removeEventListener("mousewheel", this.Rg, !0), window.removeEventListener("DOMMouseScroll", this.Rg, !0), window.removeEventListener("mouseout", this.Qn, !0)) : this.gh = !1; this.Mb = null; if (null !== a) { if (b = a.$) b.nj = null; Dl(this, a); this.Wx() } } }); function Gl(a) { var b = a.Fb; b.addEventListener("touchstart", a.yB, !1); b.addEventListener("touchmove", a.xB, !1); b.addEventListener("touchend", a.wB, !1); b.addEventListener("mousemove", a.Pn, !1); b.addEventListener("mousedown", a.On, !1); b.addEventListener("mouseup", a.Rn, !1); b.addEventListener("mousewheel", a.Rg, !1); b.addEventListener("DOMMouseScroll", a.Rg, !1); b.addEventListener("mouseout", a.Qn, !1); b.addEventListener("keydown", a.FI, !1); b.addEventListener("keyup", a.GI, !1); b.addEventListener("selectstart", function (a) { a.preventDefault(); return !1 }, !1); b.addEventListener("contextmenu", function (a) { a.preventDefault(); return !1 }, !1); b.addEventListener("gesturechange", function (b) { a.eb.Up === zk && b.preventDefault() }, !1); b.addEventListener("pointerdown", a.MF, !1); b.addEventListener("pointermove", a.OF, !1); b.addEventListener("pointerleave", a.NF, !1); window.addEventListener("resize", a.EB, !1) } D.prototype.computePixelRatio = function () { return null !== this.kk ? this.kk : this.jD }; D.prototype.doMouseMove = function () { this.$a.doMouseMove() }; D.prototype.doMouseDown = function () { this.$a.doMouseDown() }; D.prototype.doMouseUp = function () { this.$a.doMouseUp() }; D.prototype.doMouseWheel = function () { this.$a.doMouseWheel() }; D.prototype.doKeyDown = function () { this.$a.doKeyDown() }; D.prototype.doKeyUp = function () { this.$a.doKeyUp() }; D.prototype.doFocus = function () { this.focus() }; D.prototype.focus = D.prototype.focus = function () { this.Fb && this.Fb.focus() }; function Sk(a) { if (null !== a.Fb) { var b = a.Mb; if (0 !== b.clientWidth && 0 !== b.clientHeight) { var c = a.fl ? a.Gd : 0, d = a.Uj ? a.Gd : 0, e = a.Dd; a.Dd = a.computePixelRatio(); a.Dd !== e && (a.Ir = !0, a.Me()); if (b.clientWidth !== a.Ib + c || b.clientHeight !== a.Lb + d) a.Bm = !0, a.Ce = !0, b = a.Tb, null !== b && b.Ex && a.Hl === oh && b.J(), a.$d || a.Me() } } } function Al(a) { var b = new pg; b.name = "Background"; a.vt(b); b = new pg; b.name = ""; a.vt(b); b = new pg; b.name = "Foreground"; a.vt(b); b = new pg; b.name = "Adornment"; b.Mc = !0; a.vt(b); b = new pg; b.name = "Tool"; b.Mc = !0; b.lF = !0; a.vt(b); b = new pg; b.name = "Grid"; b.vf = !1; b.Wg = !1; b.Mc = !0; a.fH(b, a.Mt("Background")) } function Hl(a) { a.qd = new C(Il); a.qd.name = "GRID"; var b = new Y; b.Cb = "LineH"; b.stroke = "lightgray"; b.lb = .5; b.interval = 1; a.qd.add(b); b = new Y; b.Cb = "LineH"; b.stroke = "gray"; b.lb = .5; b.interval = 5; a.qd.add(b); b = new Y; b.Cb = "LineH"; b.stroke = "gray"; b.lb = 1; b.interval = 10; a.qd.add(b); b = new Y; b.Cb = "LineV"; b.stroke = "lightgray"; b.lb = .5; b.interval = 1; a.qd.add(b); b = new Y; b.Cb = "LineV"; b.stroke = "gray"; b.lb = .5; b.interval = 5; a.qd.add(b); b = new Y; b.Cb = "LineV"; b.stroke = "gray"; b.lb = 1; b.interval = 10; a.qd.add(b); b = new T; b.add(a.qd); b.Zf = "Grid"; b.ho = 0; b.DA = !1; b.kF = !1; b.Wg = !1; b.HA = "GRID"; a.add(b); a.zb.remove(b); a.qd.visible = !1 } function Jl() { this.$.isEnabled ? this.$.NH(this) : Kl(this.$) } function Ll(a) { this.$.isEnabled ? (this.$.Cz = !0, this.$.Ez = a.target.scrollTop, this.$.Dz = a.target.scrollLeft) : Kl(this.$) } D.prototype.diagramScroll = D.prototype.NH = function (a) { if (this.Cz && null !== this.Fb) { this.sw = !0; var b = this.se, c = this.pb, d = this.gy, e = b.x - d.left, f = b.y - d.top, h = b.width + d.left + d.right, k = b.height + d.top + d.bottom, l = b.right + d.right, d = b.bottom + d.bottom, m = c.x, b = c.y, n = c.width, p = c.height, q = c.right, r = c.bottom, c = this.scale, s; s = a.scrollLeft; if (this.Mr) switch (this.Az) { case "negative": s = s + a.scrollWidth - a.clientWidth; break; case "reverse": s = a.scrollWidth - s - a.clientWidth }var u = s; n < h || p < k ? (s = w.xb(this.position.x, this.position.y), this.oe && this.Dz !== u && (s.x = u / c + e, this.Dz = u), this.pe && this.Ez !== a.scrollTop && (s.y = a.scrollTop / c + f, this.Ez = a.scrollTop), this.position = s, w.v(s), this.Bm = this.sw = !1) : (s = w.K(), a.UG && this.oe && (e < m && (this.position = s.m(u + e, this.position.y)), l > q && (this.position = s.m(-(this.ww.scrollWidth - this.Ib) + u - this.Ib / c + l, this.position.y))), a.VG && this.pe && (f < b && (this.position = s.m(this.position.x, a.scrollTop + f)), d > r && (this.position = s.m(this.position.x, -(this.ww.scrollHeight - this.Lb) + a.scrollTop - this.Lb / c + d))), w.v(s), Ml(this), this.Bm = this.sw = !1, b = this.se, c = this.pb, l = b.right, q = c.right, d = b.bottom, r = c.bottom, e = b.x, m = c.x, f = b.y, b = c.y, n >= h && e >= m && l <= q && (this.Ss.style.width = "1px"), p >= k && f >= b && d <= r && (this.Ss.style.height = "1px")) } }; D.prototype.computeBounds = D.prototype.uh = function () { 0 < this.vg.count && Hi(this); return Nl(this) }; function Nl(a) { if (a.SE.I()) { var b = a.SE.copy(); b.Ow(a.padding); return b } for (var c = !0, d = a.cc.n, e = d.length, f = 0; f < e; f++) { var h = d[f]; if (h.visible && (!h.Mc || h.lF)) for (var h = h.zb.n, k = h.length, l = 0; l < k; l++) { var m = h[l]; m.DA && m.isVisible() && (m = m.Y, m.I() && (c ? (c = !1, b = m.copy()) : b.Kh(m))) } } c && (b = new B(0, 0, 0, 0)); b.Ow(a.padding); return b } D.prototype.computePartsBounds = function (a, b) { void 0 === b && (b = !1); for (var c = null, d = a.i; d.next();) { var e = d.value; !b && e instanceof W || (e.af(), null === c ? c = e.Y.copy() : c.Kh(e.Y)) } return null === c ? new B(NaN, NaN, 0, 0) : c }; function Ol(a, b) { if ((b || a.gh) && !a.Tc && null !== a.Fb && !a.Oa.mf && a.se.I()) { a.Tc = !0; var c = a.sm; b && a.hl !== oh && (c = a.hl); var d = c !== oh ? Pl(a, c) : a.scale, c = a.pb.copy(), e = a.Ib / d, f = a.Lb / d, h = null, k = a.Oa; k.qc && (h = a.jb.copy()); a.position.Qa(); var l = a.so; b && !l.Xc() && a.Lo.Xc() && (l = a.Lo); Ql(a, a.jb, a.se, e, f, l, b); a.position.freeze(); null !== h && hl(k, h, a.jb); e = a.scale; a.scale = d; a.Tc = !1; d = a.pb; d.Kc(c) || a.xu(c, d, e, a.scale, !1) } } function Pl(a, b) { var c = a.ob.ex; if (null === a.Fb) return c; a.Vj && Rl(a, a.uh()); var d = a.se; if (!d.I()) return c; var e = d.width, d = d.height, f = a.Ib, h = a.Lb, k = f / e, l = h / d; return b === Sl ? (e = Math.min(l, k), e > c && (e = c), e < a.Ah && (e = a.Ah), e > a.zh && (e = a.zh), e) : b === Tl ? (e = l > k ? (h - a.Gd) / d : (f - a.Gd) / e, e > c && (e = c), e < a.Ah && (e = a.Ah), e > a.zh && (e = a.zh), e) : a.scale } D.prototype.zoomToFit = D.prototype.zoomToFit = function () { this.scale = Pl(this, Sl) }; D.prototype.zoomToRect = function (a, b) { void 0 === b && (b = Sl); var c = a.width, d = a.height; if (!(0 === c || 0 === d || isNaN(c) && isNaN(d))) { var e = 1; if (b === Sl || b === Tl) if (isNaN(c)) e = this.pb.height * this.scale / d; else if (isNaN(d)) e = this.pb.width * this.scale / c; else var e = this.Ib, f = this.Lb, e = b === Tl ? f / d > e / c ? (f - (this.Uj ? this.Gd : 0)) / d : (e - (this.fl ? this.Gd : 0)) / c : Math.min(f / d, e / c); this.scale = e; this.position = new z(a.x, a.y) } }; w.defineProperty(D, { BA: null }, function () { return this.Tc }, function (a) { this.Tc = a }); D.prototype.alignDocument = function (a, b) { this.Vj && Rl(this, this.uh()); var c = this.se, d = this.pb; this.position = new z(c.x + (a.x * c.width + a.offsetX) - (b.x * d.width - b.offsetX), c.y + (a.y * c.height + a.offsetY) - (b.y * d.height - b.offsetY)) }; function Ql(a, b, c, d, e, f, h) { var k = b.x, l = b.y; if (h || a.dB === sl) f.Xc() && (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.gy, 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.QF && (a = a.QF(a, b), b.x = a.x, b.y = a.y) } D.prototype.findPartAt = D.prototype.Ot = function (a, b) { var c = b ? Li(this, a, function (a) { return a.U }, function (a) { return a.canSelect() }) : Li(this, a, function (a) { return a.U }); return c instanceof T ? c : null }; D.prototype.findObjectAt = D.prototype.Ke = function (a, b, c) { void 0 === b && (b = null); void 0 === c && (c = null); Hi(this); for (var d = this.cc.In; d.next();) { var e = d.value; if (e.visible && (e = e.Ke(a, b, c), null !== e)) return e } return null }; function Li(a, b, c, d) { void 0 === c && (c = null); void 0 === d && (d = null); Hi(a); for (a = a.cc.In; a.next();) { var e = a.value; if (e.visible && !e.Mc && (e = e.Ke(b, c, d), null !== e)) return e } return null } D.prototype.findObjectsAt = D.prototype.Nt = function (a, b, c, d) { void 0 === b && (b = null); void 0 === c && (c = null); d instanceof H || d instanceof I || (d = new I(G)); Hi(this); for (var e = this.cc.In; e.next();) { var f = e.value; f.visible && f.Nt(a, b, c, d) } return d }; D.prototype.findObjectsIn = D.prototype.zk = function (a, b, c, d, e) { void 0 === b && (b = null); void 0 === c && (c = null); void 0 === d && (d = !1); e instanceof H || e instanceof I || (e = new I(G)); Hi(this); for (var f = this.cc.In; f.next();) { var h = f.value; h.visible && h.zk(a, b, c, d, e) } return e }; D.prototype.mA = function (a, b, c, d, e, f) { var h = new I(G); Hi(this); for (var k = this.cc.In; k.next();) { var l = k.value; l.visible && l.mA(a, b, c, d, h, e, f) } return h }; D.prototype.findObjectsNear = D.prototype.xn = function (a, b, c, d, e, f) { void 0 === c && (c = null); void 0 === d && (d = null); void 0 === e && (e = !0); if (!1 !== e && !0 !== e) { if (e instanceof H || e instanceof I) f = e; e = !0 } f instanceof H || f instanceof I || (f = new I(G)); Hi(this); for (var h = this.cc.In; h.next();) { var k = h.value; k.visible && k.xn(a, b, c, d, e, f) } return f }; D.prototype.acceptEvent = function (a) { var b = this.Vc; this.Vc = this.Rb; this.Rb = b; Ul(this, this, a, b, a instanceof MouseEvent); return b }; function Ul(a, b, c, d, e) { d.g = b; d.event = c; e ? Vl(a, c, d) : (d.df = b.Rb.df, d.da = b.Rb.da); a = 0; c.ctrlKey && (a += 1); c.altKey && (a += 2); c.shiftKey && (a += 4); c.metaKey && (a += 8); d.zd = a; d.button = c.button; void 0 === c.buttons || w.wI || (d.buttons = c.buttons); w.Gk && 0 === c.button && c.ctrlKey && (d.button = 2); d.Pl = !1; d.up = !1; d.Ge = 1; d.Ol = 0; d.Cc = !1; d.bubbles = !1; d.timestamp = Date.now(); d.hu = !1; d.Yg = c.target.$ ? c.target.$ : null; d.Qe = null } function Wl(a, b, c, d, e) { d.g = a; Vl(a, c, d); d.zd = 0; d.button = 0; d.buttons = 1; d.Pl = !0; d.up = !1; d.Ge = 1; d.Ol = 0; d.Cc = !1; d.bubbles = !0; d.event = b; d.timestamp = Date.now(); d.hu = e; d.Yg = b.target.$ ? b.target.$ : null; d.Qe = null; a.Ki = d.copy(); Oh = null } function Xl(a, b, c, d, e) { var f = null; d.g = a; null !== c ? ((f = window.document.elementFromPoint(c.clientX, c.clientY)) && f.$ ? f = f.$ : (c = b.changedTouches[0], f = a), d.Yg = f, Vl(a, c, d)) : null !== a.Vc ? (d.da = a.Vc.da, d.df = a.Vc.df, d.Yg = a.Vc.Yg) : null !== a.Ki && (d.da = a.Ki.da, d.df = a.Ki.df, d.Yg = a.Ki.Yg); d.zd = 0; d.button = 0; d.buttons = 1; d.Pl = !1; d.up = !1; d.Ge = 1; d.Ol = 0; d.Cc = !1; d.bubbles = !1; d.event = b; d.timestamp = Date.now(); d.hu = e; d.Qe = null } function Yl(a, b) { if (a.bubbles) return !0; void 0 !== b.stopPropagation && b.stopPropagation(); b.preventDefault(); b.cancelBubble = !0; return !1 } D.prototype.FI = function (a) { if (!this.$.isEnabled) return !1; var b = this.$.Rb; Ul(this.$, this.$, a, b, !1); b.key = String.fromCharCode(a.which); b.Pl = !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.$.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 ? Yl(b, a) : (a.cancelBubble = !0, a.preventDefault(), a.stopPropagation(), !1) }; D.prototype.GI = function (a) { if (!this.$.isEnabled) return !1; var b = this.$.Rb; Ul(this.$, this.$, 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.$.doKeyUp(); return Yl(b, a) }; D.prototype.Ar = function (a) { var b = this.Fb; if (null === b) return new z(0, 0); var c = this.Ib, d = this.Lb, b = b.getBoundingClientRect(), c = a.clientX - c / b.width * b.left; a = a.clientY - d / b.height * b.top; return null !== this.fd ? (a = new z(c, a), La(a, this.fd), a) : new z(c, a) }; function Vl(a, b, c) { var d = a.Fb, e = a.Ib, f = a.Lb, 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.df.m(h, k); null !== a.fd ? (b = w.xb(h, k), a.fd.pi(b), c.da.assign(b), w.v(b)) : c.da.m(h, k) } function Cf(a, b, c, d) { var e = null; if (void 0 !== b.targetTouches) { if (2 > b.targetTouches.length) return; e = b.targetTouches[c] } else if (null !== a.$i[0]) e = a.$i[c]; else return; c = a.Fb; b = a.Ib; a = a.Lb; var f = 0, h = 0; null !== c && null !== e && (c = c.getBoundingClientRect(), f = e.clientX - b / c.width * c.left, h = e.clientY - a / c.height * c.top); d.m(f, h) } D.prototype.invalidateDocumentBounds = D.prototype.sc = function () { this.Vj || (this.Vj = !0, this.Me(!0)) }; function el(a) { a.$d || Hi(a); a.Vj && Rl(a, a.uh()) } D.prototype.redraw = D.prototype.Wx = function () { this.Tc || this.$d || (this.na(), Zl(this), Ml(this), this.sc(), this.ag()) }; D.prototype.isUpdateRequested = function () { return this.Sf }; D.prototype.delayInitialization = function (a) { void 0 === a && (a = null); var b = this.Oa, c = b.isEnabled; b.Hh(); b.isEnabled = !1; Ri(this); this.gh = !1; b.isEnabled = c; null !== a && w.setTimeout(a, 1) }; D.prototype.requestUpdate = D.prototype.Me = function (a) { void 0 === a && (a = !1); if (!0 !== this.Sf && !(this.Tc || !1 === a && this.$d)) { this.Sf = !0; var b = this; requestAnimationFrame(function () { b.Sf && b.ag() }) } }; D.prototype.maybeUpdate = D.prototype.ag = function () { if (!this.Go || this.Sf) this.Go && (this.Go = !1), Ri(this) }; function $l(a, b) { a.Oa.mf || a.Tc || !a.Bm || Kl(a) || (b && Hi(a), Ol(a, !1)) } function Ri(a) { if (!a.$d && (a.Sf = !1, null !== a.Mb)) { a.$d = !0; var b = a.Oa, c = a.yz; if (!b.Ro && 0 !== c.length) { for (var d = c.n, e = d.length, f = 0; f < e; f++) { var h = d[f]; am(h, !1); h.H() } c.clear() } c = a.LC; 0 < c.count && (c.each(function (a) { a.CB() }), c.clear()); d = c = !1; b.mf && (d = !0, c = a.wb, a.wb = !0); b.qc || Sk(a); $l(a, !1); null !== a.qd && (a.qd.visible && !a.Cv && (bm(a), a.Cv = !0), !a.qd.visible && a.Cv && (a.Cv = !1)); Hi(a); e = !1; if (!a.gh || a.dv) a.gh ? cm(a, !a.tv) : (a.Pb("Initial Layout"), !1 === b.isEnabled && b.Hh(), cm(a, !1)), e = !0; a.tv = !1; Hi(a); a.Gz || b.mf || el(a); $l(a, !0); e && (a.gh || fm(a), a.Aa("LayoutCompleted")); Hi(a); e && !a.gh && (a.gh = !0, a.wd("Initial Layout"), a.wb || a.oa.clear(), w.setTimeout(function () { a.ri = !1 }, 1)); nm(a); Rk(b); a.ue(a.qf); d && (a.wb = c); a.$d = !1 } } w.u(D, { Hn: null }, function () { return this.gh }); function fm(a) { var b = a.cc.n; a.Gf(b, b.length, a); a.hl !== oh ? a.scale = Pl(a, a.hl) : a.sm !== oh ? a.scale = Pl(a, a.sm) : (b = a.qI, isFinite(b) && 0 < b && (a.scale = b)); b = a.pI; if (b.I()) a.position = b; else { b = w.K(); b.Xn(a.se, a.oI); var c = a.pb, c = w.jg(0, 0, c.width, c.height), d = w.K(); d.Xn(c, a.rI); d.m(b.x - d.x, b.y - d.y); a.position = d; w.Db(c); w.v(d); w.v(b); Zl(a); $l(a, !0); Ol(a, !0) } a.Aa("InitialLayoutCompleted"); bm(a) } function Hi(a) { if ((a.$d || !a.Oa.mf) && 0 !== a.vg.count) { for (var b = 0; 23 > b; b++) { var c = a.vg.i; if (null === c || 0 === a.vg.count) break; a.vg = new I(T); a.CB(c, a.vg) } a.gg.each(function (a) { a instanceof V && 0 !== (a.ya & 65536) !== !1 && (a.ya ^= 65536) }) } } D.prototype.CB = function (a, b) { for (a.reset(); a.next();) { var c = a.value; !c.ee() || c instanceof V || (c.$l() ? (xk(c, Infinity, Infinity), c.jc()) : b.add(c)) } for (a.reset(); a.next();)c = a.value, c instanceof V && c.isVisible() && Bm(this, c); for (a.reset(); a.next();)c = a.value, c instanceof W && c.isVisible() && (c.$l() ? (xk(c, Infinity, Infinity), c.jc()) : b.add(c)); for (a.reset(); a.next();)c = a.value, c instanceof jh && c.isVisible() && (c.$l() ? (xk(c, Infinity, Infinity), c.jc()) : b.add(c)) }; function Bm(a, b) { for (var c = w.cb(), d = w.cb(), e = b.Oc; e.next();) { var f = e.value; f.isVisible() && (f instanceof V ? (Cm(f) || Dm(f) || Em(f)) && Bm(a, f) : f instanceof W ? f.V === b || f.Z === b ? d.push(f) : c.push(f) : (xk(f, Infinity, Infinity), f.jc())) } for (var e = c.length, h = 0; h < e; h++)f = c[h], xk(f, Infinity, Infinity), f.jc(); w.ua(c); xk(b, Infinity, Infinity); b.jc(); e = d.length; for (h = 0; h < e; h++)f = d[h], xk(f, Infinity, Infinity), f.jc(); w.ua(d) } D.prototype.Gf = function (a, b, c, d) { var e = this.Oa; if (this.il || e.mf) for (e = 0; e < b; e++)a[e].Gf(c, d) }; D.prototype.ue = function (a, b) { void 0 === b && (b = null); null === this.Mb && w.k("No div specified"); var c = this.Fb; null === c && w.k("No canvas specified"); var d = this.Oa; if (!d.qc && (Fm(this), "0" !== this.Mb.style.opacity)) { var e = a !== this.qf, f = this.cc.n, h = f.length, k = this; this.Gf(f, h, k); if (e) a.Fe(!0), Ml(this); else if (!this.Ce && null === b && !d.Wj) return; var h = this.jb, l = this.ub, m = Math.round(h.x * l) / l, n = Math.round(h.y * l) / l, d = this.fd; d.reset(); 1 !== l && d.scale(l); 0 === h.x && 0 === h.y || d.translate(-m, -n); l = this.Dd; w.Fn ? (c.width = c.width, a.Fe(!0), a.scale(l, l)) : (a.setTransform(1, 0, 0, 1, 0, 0), a.scale(l, l), a.clearRect(0, 0, this.Ib, this.Lb)); a.setTransform(1, 0, 0, 1, 0, 0); a.scale(l, l); a.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy); c = null !== b ? function (c) { var d = b; if (c.visible && 0 !== c.yc) { var e = c.zb.n, f = e.length; if (0 !== f) { 1 !== c.yc && (a.globalAlpha = c.yc); c = c.kw; c.length = 0; for (var h = k.scale, l = 0; l < f; l++) { var m = e[l]; if (jl(m) && !d.contains(m)) { if (m instanceof W) { var n = m; n.ac && c.push(n); if (!1 === n.kg) continue } n = m.Y; 1 < n.width * h || 1 < n.height * h ? m.ue(a, k) : ll(m, a) } } a.globalAlpha = 1 } } } : function (b) { b.ue(a, k) }; Gm(this, a); h = f.length; for (m = 0; m < h; m++)a.setTransform(1, 0, 0, 1, 0, 0), a.scale(l, l), a.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy), c(f[m]); this.gl ? this.gl.lm(this) && this.wv() : this.Ar = function () { return new z(0, 0) }; e ? (this.qf.Fe(!0), Ml(this)) : this.Ce = this.il = !1 } }; function Hm(a, b, c, d, e) { null === a.Mb && w.k("No div specified"); var f = a.Fb; null === f && w.k("No canvas specified"); if (!a.Oa.qc) { var h = a.qf; if (a.Ce) { Fm(a); var k = a.Dd; w.Fn ? (f.width = f.width, h.Fe(!0)) : (h.setTransform(1, 0, 0, 1, 0, 0), h.clearRect(0, 0, a.Ib * k, a.Lb * k)); h.ky(!1); h.drawImage(a.Xy.Jd, 0 < d ? 0 : Math.round(-d), 0 < e ? 0 : Math.round(-e)); e = a.jb; var f = a.ub, l = Math.round(e.x * f) / f, m = Math.round(e.y * f) / f; d = a.fd; d.reset(); 1 !== f && d.scale(f); 0 === e.x && 0 === e.y || d.translate(-l, -m); h.save(); h.beginPath(); e = c.length; for (f = 0; f < e; f++)l = c[f], 0 !== l.width && 0 !== l.height && h.rect(Math.floor(l.x), Math.floor(l.y), Math.ceil(l.width), Math.ceil(l.height)); h.clip(); h.setTransform(1, 0, 0, 1, 0, 0); h.scale(k, k); h.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy); c = a.cc.n; e = c.length; a.Gf(c, e, a); Gm(a, h); for (f = 0; f < e; f++)ml(c[f], h, a, b); h.restore(); h.Fe(!0); a.gl ? a.gl.lm(a) && a.wv() : a.Ar = function () { return new z(0, 0) }; a.il = !1; a.Ce = !1; a.Xx() } } } function Im(a, b, c, d, e, f, h, k, l, m) { null === a.Mb && w.k("No div specified"); null === a.Fb && w.k("No canvas specified"); void 0 === h && (h = null); void 0 === k && (k = null); void 0 === l && (l = !1); void 0 === m && (m = !1); Fm(a); a.qf.Fe(!0); Ml(a); a.mz = !0; var n = a.ub; a.ub = e; var p = a.cc.n, q = p.length; try { var r = new B(f.x, f.y, d.width / e, d.height / e), s = r.copy(); s.Ow(c); bm(a, s); Hi(a); a.Gf(p, q, a, r); var u = a.Dd; b.setTransform(1, 0, 0, 1, 0, 0); b.scale(u, u); b.clearRect(0, 0, d.width, d.height); null !== k && "" !== k && (b.fillStyle = k, b.fillRect(0, 0, d.width, d.height)); var t = w.Jf(); t.reset(); t.translate(c.left, c.top); t.scale(e); 0 === f.x && 0 === f.y || t.translate(-f.x, -f.y); b.setTransform(t.m11, t.m12, t.m21, t.m22, t.dx, t.dy); w.we(t); Gm(a, b); var x; if (null !== h) { var v = new I(T), A = h.i; for (A.reset(); A.next();) { var y = A.value; !1 === m && "Grid" === y.layer.name || null === y || v.add(y) } x = function (c) { var d = l; if (c.visible && 0 !== c.yc && (void 0 === d && (d = !0), d || !c.Mc)) { var d = c.zb.n, e = d.length; if (0 !== e) { 1 !== c.yc && (b.globalAlpha = c.yc); c = c.kw; c.length = 0; for (var f = a.scale, h = 0; h < e; h++) { var k = d[h]; if (jl(k) && v.contains(k)) { if (k instanceof W) { var m = k; m.ac && c.push(m); if (!1 === m.kg) continue } m = k.Y; 1 < m.width * f || 1 < m.height * f ? k.ue(b, a) : ll(k, b) } } b.globalAlpha = 1 } } } } else if (!l && m) { var K = a.Dn.U, E = K.layer; x = function (c) { c === E ? K.ue(b, a) : c.ue(b, a, l) } } else x = function (c) { c.ue(b, a, l) }; for (c = 0; c < q; c++)x(p[c]); a.mz = !1; a.gl ? a.gl.lm(a) && a.wv() : a.Ar = function () { return new z(0, 0) } } finally { a.ub = n, a.qf.Fe(!0), Ml(a), a.Gf(p, q, a), bm(a) } } D.prototype.getRenderingHint = D.prototype.qj = function (a) { return this.hk[a] }; D.prototype.setRenderingHint = D.prototype.FJ = function (a, b) { this.hk[a] = b; this.Wx() }; D.prototype.resetRenderingHints = D.prototype.XF = function () { this.hk = new sa; this.hk.drawShadows = !0; this.hk.textGreeking = !0; this.hk.viewportOptimizations = w.qF ? !1 : !0; this.hk.temporaryPixelRatio = !0; this.hk.pictureRatioOptimization = !0 }; function Gm(a, b) { var c = a.hk; null !== c && (void 0 !== c.imageSmoothingEnabled && b.ky(!!c.imageSmoothingEnabled), c = c.defaultFont, void 0 !== c && null !== c && (b.font = c)) } D.prototype.getInputOption = D.prototype.Xt = function (a) { return this.Oo[a] }; D.prototype.setInputOption = function (a, b) { this.Oo[a] = b }; D.prototype.resetInputOptions = D.prototype.WF = function () { this.Oo = new sa; this.Oo.extraTouchArea = 10; this.Oo.extraTouchThreshold = 10; this.Oo.hasGestureZoom = !0 }; D.prototype.setProperties = function (a) { w.Iu(this, a) }; function nm(a) { if (0 === a.oa.Jh && 0 !== a.bl.count) { for (; 0 < a.bl.count;) { var b = a.bl; a.bl = new la(W, B); for (b = b.i; b.next();) { var c = b.key; lj(c, b.value); c.Le() } } a.na() } } D.prototype.na = function (a) { void 0 === a && (a = null); if (null === a) this.Ce = !0, this.Me(); else { var b = this.pb; null !== a && a.I() && b.Wf(a) && (this.Ce = !0, this.Me()) } for (b = this.lw.i; b.next();)b.value.na(a) }; D.prototype.jF = function (a, b) { if (!0 !== this.Ce) { this.Ce = !0; var c = !0 === this.qj("temporaryPixelRatio"); if (!0 === this.qj("viewportOptimizations") && this.dB !== Jm && this.gy.kx(0, 0, 0, 0) && b.width === a.width && b.height === a.height) { var d = this.scale, e = w.If(), f = Math.max(a.x, b.x), h = Math.max(a.y, b.y), k = Math.min(a.x + a.width, b.x + b.width), l = Math.min(a.y + a.height, b.y + b.height); e.x = f; e.y = h; e.width = Math.max(0, k - f) * d; e.height = Math.max(0, l - h) * d; if (0 < e.width && 0 < e.height) { if (!this.$d && (this.Sf = !1, null !== this.Mb)) { this.$d = !0; nm(this); this.se.I() || Rl(this, this.uh()); var m = this.Fb; if (null !== m) { var n = this.Dd, h = this.Ib * n, k = this.Lb * 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.Xy, p = this.DC; l.width !== h && (l.width = h); l.height !== k && (l.height = k); p.clearRect(0, 0, h, k); var l = 190 * this.Dd, q = 70 * this.Dd, r = Math.max(d, 0), s = Math.max(f, 0), u = Math.floor(h - r), t = Math.floor(k - s); p.ky(!1); p.drawImage(m.Jd, r, s, u, t, 0, 0, u, t); this.gl.lm(this) && p.clearRect(0, 0, l, q); var m = w.cb(), p = w.cb(), t = Math.abs(d), u = Math.abs(f), x = 0 === r ? 0 : h - t, r = w.xb(x, 0), t = w.xb(t + x, k); p.push(new B(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y))); var v = this.fd; v.reset(); v.scale(n, n); 1 !== this.ub && v.scale(this.ub); n = this.jb; (0 !== n.x || 0 !== n.y) && isFinite(n.x) && isFinite(n.y) && v.translate(-n.x, -n.y); La(r, v); La(t, v); m.push(new B(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y))); x = 0 === s ? 0 : k - u; r.m(0, x); t.m(h, u + x); p.push(new B(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y))); La(r, v); La(t, v); m.push(new B(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y))); this.gl.lm(this) && (h = 0 < d ? 0 : -d, k = 0 < f ? 0 : -f, r.m(h, k), t.m(l + h, q + k), p.push(new B(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y))), La(r, v), La(t, v), m.push(new B(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y)))); w.v(r); w.v(t); $l(this, !1); Hm(this, m, p, d, f); w.ua(m); w.ua(p); this.$d = !1 } } } else this.ag(); w.Db(e); c && (this.kk = 1, this.ag(), this.kk = null, this.Xx()) } else c ? (this.kk = 1, this.ag(), this.kk = null, this.Xx()) : this.ag() } }; function Zl(a) { !1 === a.Bm && (a.Bm = !0) } function Ml(a) { !1 === a.il && (a.il = !0) } function Fm(a) { !1 !== a.Ir && (a.Ir = !1, Km(a, a.Ib, a.Lb)) } function Km(a, b, c) { var d = a.Fb, e = a.Dd, f = b * e, e = c * e; if (d.width !== f || d.height !== e) d.width = f, d.height = e, d.style.width = b + "px", d.style.height = c + "px", a.Ce = !0, a.qf.Fe(!0) } function Kl(a) { var b = a.Fb; if (null === b) return !0; var c = a.Mb, d = a.Ib, e = a.Lb, f = a.aE.copy(); if (!f.I()) return !0; var h = !1, k = a.fl ? a.Gd : 0, l = a.Uj ? a.Gd : 0, m = c.clientWidth || d + k, c = c.clientHeight || e + l; if (m !== d + k || c !== e + l) a.fl = !1, a.Uj = !1, l = k = 0, a.Ib = m, a.Lb = c, h = a.Ir = !0; a.Bm = !1; var n = a.pb, p = a.se, q = 0, r = 0, s = 0, u = 0, m = n.width, c = n.height, t = a.gy; a.$z.Xc() ? (p.width > m && (q = t.left, r = t.right), p.height > c && (s = t.top, u = t.bottom)) : (q = t.left, r = t.right, s = t.top, u = t.bottom); var t = p.width + q + r, x = p.height + s + u, q = p.x - q, v = n.x, r = p.right + r, A = n.right + k, s = p.y - s, y = n.y, u = p.bottom + u, n = n.bottom + l, K = "1px", E = "1px", p = a.scale, Q = !(t < m + k), X = !(x < c + l); if (a.dB !== sl || Q || X) Q && a.vA && a.oe && (K = 1, q + 1 < v && (K = Math.max((v - q) * p + a.Ib, K)), r > A + 1 && (K = Math.max((r - A) * p + a.Ib, K)), m + k + 1 < t && (K = Math.max((t - m + k) * p + a.Ib, K)), K = K.toString() + "px"), X && a.wA && a.pe && (E = 1, s + 1 < y && (E = Math.max((y - s) * p + a.Lb, E)), u > n + 1 && (E = Math.max((u - n) * p + a.Lb, E)), c + l + 1 < x && (E = Math.max((x - c + l) * p + a.Lb, E)), E = E.toString() + "px"); var Q = "1px" !== K, O = "1px" !== E; Q && O || !Q && !O || (X = !(x < c + l), O && (A -= a.Gd), Q && (n -= a.Gd), t < m + k || !a.vA || !a.oe || (K = 1, q + 1 < v && (K = Math.max((v - q) * p + a.Ib, K)), r > A + 1 && (K = Math.max((r - A) * p + a.Ib, K)), m + 1 < t && (K = Math.max((t - m) * p + a.Ib, K)), K = K.toString() + "px"), Q = "1px" !== K, k = Q !== a.Uj ? a.Lb - a.Gd : a.Lb, X && a.wA && a.pe && (E = 1, s + 1 < y && (E = Math.max((y - s) * p + k, E)), u > n + 1 && (E = Math.max((u - n) * p + k, E)), c + 1 < x && (E = Math.max((x - c) * p + k, E)), E = E.toString() + "px"), O = "1px" !== E); if (a.sw && Q === a.Uj && O === a.fl) return d === a.Ib && e === a.Lb || a.ag(), !1; Q !== a.Uj && (a.Lb = "1px" === K ? a.Lb + a.Gd : Math.max(a.Lb - a.Gd, 1), h = !0); a.Uj = Q; a.Ss.style.width = K; O !== a.fl && (a.Ib = "1px" === E ? a.Ib + a.Gd : Math.max(a.Ib - a.Gd, 1), h = !0, a.Mr && (k = w.K(), O ? (b.style.left = a.Gd + "px", a.position = k.m(a.jb.x + a.Gd / a.scale, a.jb.y)) : (b.style.left = "0px", a.position = k.m(a.jb.x - a.Gd / a.scale, a.jb.y)), w.v(k))); a.fl = O; a.Ss.style.height = E; b = a.ww; k = b.scrollLeft; a.vA && a.oe && (m + 1 < t ? k = (a.position.x - q) * p : q + 1 < v ? k = b.scrollWidth - b.clientWidth : r > A + 1 && (k = a.position.x * p)); if (a.Mr) switch (a.Az) { case "negative": k = -(b.scrollWidth - k - b.clientWidth); break; case "reverse": k = b.scrollWidth - k - b.clientWidth }b.scrollLeft = k; a.wA && a.pe && (c + 1 < x ? b.scrollTop = (a.position.y - s) * p : s + 1 < y ? b.scrollTop = b.scrollHeight - b.clientHeight : u > n + 1 && (b.scrollTop = a.position.y * p)); h && (a.Ir = !0); m = a.Ib; c = a.Lb; b.style.width = m + (a.fl ? a.Gd : 0) + "px"; b.style.height = c + (a.Uj ? a.Gd : 0) + "px"; a.Cz = !1; return d !== m || e !== c || a.Oa.qc ? (n = a.pb, a.xu(f, n, p, a.scale, h), !1) : !0 } D.prototype.add = D.prototype.add = function (a) { w.G(a, T, D, "add:part"); var b = a.g; if (b !== this) { null !== b && w.k("Cannot add part " + a.toString() + " to " + this.toString() + ". It is already a part of " + b.toString()); this.Fq && (a.nl = "Tool"); var c = a.Zf, b = this.Mt(c); null === b && (b = this.Mt("")); null === b && w.k('Cannot add a Part when unable find a Layer named "' + c + '" and there is no default Layer'); a.layer !== b && (c = b.Xp(99999999, a, a.g === this), 0 <= c && this.Zc(Qf, "parts", b, null, a, null, c), b.Mc || this.sc(), a.J(Lm), c = a.Hx, null !== c && c(a, null, b)) } }; D.prototype.Xp = function (a) { if (a instanceof U) { if (this.ep.add(a), a instanceof V) { var b = a.Da; null === b ? this.zl.add(a) : b.bp.add(a); b = a.Tb; null !== b && (b.g = this) } } else a instanceof W ? this.Yo.add(a) : a instanceof jh || this.zb.add(a); var c = this; Mm(a, function (a) { Nm(c, a) }); (a instanceof jh || a instanceof V && null !== a.Kb) && a.H(); b = a.data; null !== b && (a instanceof jh || (a instanceof W ? this.Kj.add(b, a) : this.Di.add(b, a)), Mm(a, function (a) { Om(c, a) })); !0 !== Dm(a) && !0 !== Em(a) || this.vg.add(a); Pm(a, !0, this); Qm(a) ? (a.Y.I() && this.na(nl(a, a.Y)), this.sc()) : a.isVisible() && a.Y.I() && this.na(nl(a, a.Y)); this.Me() }; D.prototype.lf = function (a) { a.Dt(); if (a instanceof U) { if (this.ep.remove(a), a instanceof V) { var b = a.Da; null === b ? this.zl.remove(a) : b.bp.remove(a); b = a.Tb; null !== b && (b.g = null) } } else a instanceof W ? this.Yo.remove(a) : a instanceof jh || this.zb.remove(a); var c = this; Mm(a, function (a) { Rm(c, a) }); b = a.data; null !== b && (a instanceof jh || (a instanceof W ? this.Kj.remove(b) : this.Di.remove(b)), Mm(a, function (a) { Sm(c, a) })); this.vg.remove(a); Qm(a) ? (a.Y.I() && this.na(nl(a, a.Y)), this.sc()) : a.isVisible() && a.Y.I() && this.na(nl(a, a.Y)); this.Me() }; D.prototype.remove = D.prototype.remove = function (a) { w.G(a, T, D, "remove:part"); Tm(this, a, !0) }; function Tm(a, b, c) { var d = b.layer; null !== d && d.g === a && (b.ib = !1, b.Pg = !1, b.J(Um), c && b.wn(), c = d.lf(-1, b, !1), 0 <= c && a.Zc(Rf, "parts", d, b, null, c, null), a = b.Hx, null !== a && a(b, d, null)) } D.prototype.removeParts = D.prototype.aB = function (a, b) { if (w.isArray(a)) for (var c = w.Za(a), d = 0; d < c; d++) { var e = w.Ba(a, d); b && !e.canDelete() || this.remove(e) } else for (e = new I(T), e.Jc(a), c = e.i; c.next();)e = c.value, b && !e.canDelete() || this.remove(e) }; D.prototype.copyParts = D.prototype.Kp = function (a, b, c) { return this.ob.Kp(a, b, c) }; D.prototype.moveParts = D.prototype.moveParts = function (a, b, c) { w.G(b, z, D, "moveParts:offset"); var d = this.eb; if (null !== d) { d = d.te; null === d && (d = new nh, d.Rc(this)); var e = new la(T); if (null !== a) a = a.i; else { for (a = this.Kk; a.next();)Rh(d, e, a.value, c); for (a = this.gg; a.next();)Rh(d, e, a.value, c); a = this.links } for (; a.next();)Rh(d, e, a.value, c); d.moveParts(e, b, c) } }; function Vm(a, b, c) { w.G(b, pg, D, "addLayer:layer"); null !== b.g && b.g !== a && w.k("Cannot share a Layer with another Diagram: " + b + " of " + b.g); null === c ? null !== b.g && w.k("Cannot add an existing Layer to this Diagram again: " + b) : (w.G(c, pg, D, "addLayer:existingLayer"), c.g !== a && w.k("Existing Layer must be in this Diagram: " + c + " not in " + c.g), b === c && w.k("Cannot move a Layer before or after itself: " + b)); if (b.g !== a) { b = b.name; a = a.cc; c = a.count; for (var d = 0; d < c; d++)a.ea(d).name === b && w.k("Cannot add Layer with the name '" + b + "'; a Layer with the same name is already present in this Diagram.") } } D.prototype.addLayer = D.prototype.vt = function (a) { Vm(this, a, null); a.Rc(this); var b = this.cc, c = b.count - 1; if (!a.Mc) for (; 0 <= c && b.ea(c).Mc;)c--; b.Pd(c + 1, a); null !== this.me && this.Zc(Qf, "layers", this, null, a, null, c + 1); this.na(); this.sc() }; D.prototype.addLayerBefore = D.prototype.fH = function (a, b) { Vm(this, a, b); a.Rc(this); var c = this.cc, d = c.indexOf(a); 0 <= d && (c.remove(a), null !== this.me && this.Zc(Rf, "layers", this, a, null, d, null)); for (var e = c.count, f = 0; f < e; f++)if (c.ea(f) === b) { c.Pd(f, a); break } null !== this.me && this.Zc(Qf, "layers", this, null, a, null, f); this.na(); 0 > d && this.sc() }; D.prototype.addLayerAfter = function (a, b) { Vm(this, a, b); a.Rc(this); var c = this.cc, d = c.indexOf(a); 0 <= d && (c.remove(a), null !== this.me && this.Zc(Rf, "layers", this, a, null, d, null)); for (var e = c.count, f = 0; f < e; f++)if (c.ea(f) === b) { c.Pd(f + 1, a); break } null !== this.me && this.Zc(Qf, "layers", this, null, a, null, f + 1); this.na(); 0 > d && this.sc() }; D.prototype.removeLayer = function (a) { w.G(a, pg, D, "removeLayer:layer"); a.g !== this && w.k("Cannot remove a Layer from another Diagram: " + a + " of " + a.g); if ("" !== a.name) { var b = this.cc, c = b.indexOf(a); if (b.remove(a)) { for (b = a.zb.copy().i; b.next();) { var d = b.value, e = d.Zf; d.Zf = e !== a.name ? e : "" } null !== this.me && this.Zc(Rf, "layers", this, a, null, c, null); this.na(); this.sc() } } }; D.prototype.findLayer = D.prototype.Mt = function (a) { for (var b = this.Ix; b.next();) { var c = b.value; if (c.name === a) return c } return null }; D.prototype.addModelChangedListener = D.prototype.hH = function (a) { w.j(a, "function", D, "addModelChangedListener:listener"); null === this.ih && (this.ih = new H("function")); this.ih.add(a); this.ba.gn(a) }; D.prototype.removeModelChangedListener = function (a) { w.j(a, "function", D, "removeModelChangedListener:listener"); null !== this.ih && (this.ih.remove(a), 0 === this.ih.count && (this.ih = null)); this.ba.Au(a) }; D.prototype.addChangedListener = D.prototype.gn = function (a) { w.j(a, "function", D, "addChangedListener:listener"); null === this.yi && (this.yi = new H("function")); this.yi.add(a) }; D.prototype.removeChangedListener = D.prototype.Au = function (a) { w.j(a, "function", D, "removeChangedListener:listener"); null !== this.yi && (this.yi.remove(a), 0 === this.yi.count && (this.yi = null)) }; D.prototype.Ww = function (a) { this.wb || this.oa.eF(a); a.Ac !== Pf && (this.ri = !0); if (null !== this.yi) { var b = this.yi, c = b.length; if (1 === c) b = b.ea(0), b(a); else if (0 !== c) for (var d = b.gc(), e = 0; e < c; e++)b = d[e], b(a) } }; D.prototype.raiseChangedEvent = D.prototype.Zc = function (a, b, c, d, e, f, h) { void 0 === f && (f = null); void 0 === h && (h = null); var k = new Ef; k.g = this; k.Ac = a; k.propertyName = b; k.object = c; k.oldValue = d; k.Aj = f; k.newValue = e; k.zj = h; this.Ww(k) }; D.prototype.raiseChanged = D.prototype.h = function (a, b, c, d, e) { this.Zc(Of, a, this, b, c, d, e) }; w.u(D, { Oa: "animationManager" }, function () { return this.RB }); w.u(D, { oa: "undoManager" }, function () { return this.me.oa }); w.defineProperty(D, { wb: "skipsUndoManager" }, function () { return this.dj }, function (a) { w.j(a, "boolean", D, "skipsUndoManager"); this.dj = a; this.me.dj = a }); w.defineProperty(D, { gA: "delaysLayout" }, function () { return this.Sy }, function (a) { this.Sy = a }); D.prototype.on = function (a, b) { if (null !== a && a.g === this) { var c = this.Oe; try { this.Oe = !0; var d = a.Ac, e; if (d === Of) { var f = a.object, h = a.propertyName, k = a.ja(b); w.La(f, h, k); if (f instanceof G) { var l, m = f.U; null !== m && m.de() } this.ri = !0 } else if (d === Qf) { var n = a.object, p = a.zj, f = a.newValue; if (n instanceof C) if ("number" === typeof p && f instanceof G) { l = f; var q = n; b ? q.lf(p) : q.Pd(p, l); m = n.U; null !== m && m.de() } else { if ("number" === typeof p && f instanceof Vg) { var r = f, q = n; b ? r.xe ? q.VF(p) : q.TF(p) : (e = r.xe ? q.Md(r.index) : q.Ld(r.index), e.Jp(r)) } } else if (n instanceof pg) { var s = !0 === a.Aj; if ("number" === typeof p && f instanceof T) { var m = f, u = n; b ? (m.ib = !1, m.Pg = !1, m.de(), u.lf(s ? p : -1, m, s)) : u.Xp(p, m, s) } } else if (n instanceof D) { if ("number" === typeof p && f instanceof pg) { var t = f; b ? this.cc.$c(p) : (d = t, d.Rc(this), this.cc.Pd(p, d)) } } else w.k("unknown ChangedEvent.Insert object: " + a.toString()); this.ri = !0 } else d === Rf ? (n = a.object, p = a.Aj, f = a.oldValue, n instanceof C ? "number" === typeof p && f instanceof G ? (q = n, b ? q.Pd(p, f) : q.lf(p)) : "number" === typeof p && f instanceof Vg && (r = f, q = n, b ? (e = r.xe ? q.Md(r.index) : q.Ld(r.index), e.Jp(r)) : r.xe ? q.VF(p) : q.TF(p)) : n instanceof pg ? (s = !0 === a.zj, "number" === typeof p && f instanceof T && (m = f, u = n, b ? u.Xp(p, m, s) : (m.ib = !1, m.Pg = !1, m.de(), u.lf(s ? p : -1, m, s)))) : n instanceof D ? "number" === typeof p && f instanceof pg && (t = f, b ? (d = t, d.Rc(this), this.cc.Pd(p, d)) : this.cc.$c(p)) : w.k("unknown ChangedEvent.Remove object: " + a.toString()), this.ri = !0) : d !== Pf && w.k("unknown ChangedEvent: " + a.toString()) } finally { this.Oe = c } } }; D.prototype.startTransaction = D.prototype.Pb = function (a) { return this.oa.Pb(a) }; D.prototype.commitTransaction = D.prototype.wd = function (a) { return this.oa.wd(a) }; D.prototype.rollbackTransaction = D.prototype.mq = function () { return this.oa.mq() }; D.prototype.updateAllTargetBindings = D.prototype.BG = function (a) { void 0 === a && (a = ""); for (var b = this.Kk; b.next();)b.value.Hb(a); for (b = this.gg; b.next();)b.value.Hb(a); for (b = this.links; b.next();)b.value.Hb(a) }; D.prototype.updateAllRelationshipsFromData = D.prototype.XJ = function () { for (var a = this.ba, b = new I, c = a.fg, d = 0; d < c.length; d++) { var e = c[d]; b.add(e) } var f = []; this.gg.each(function (a) { null === a.data || b.contains(a.data) || f.push(a.data) }); this.Kk.each(function (a) { null === a.data || b.contains(a.data) || f.push(a.data) }); f.forEach(function (b) { yg(a, b, !1) }); for (d = 0; d < c.length; d++) { var e = c[d], h = this.xh(e); null === h && xg(a, e, !1) } if (a instanceof R) { for (var k = new I, c = a.Qg, d = 0; d < c.length; d++)e = c[d], k.add(e); var l = []; this.links.each(function (a) { null === a.data || k.contains(a.data) || l.push(a.data) }); l.forEach(function (b) { $g(a, b, !1) }); for (d = 0; d < c.length; d++)e = c[d], h = this.Vf(e), null === h && Zg(a, e, !1) } for (d = this.Kk; d.next();)h = d.value, h.updateRelationshipsFromData(); for (d = this.gg; d.next();)d.value.updateRelationshipsFromData(); for (d = this.links; d.next();)h = d.value, h.updateRelationshipsFromData() }; function Wm(a, b, c) { if (a.Tc || a.$d) a.ub = c, c = a.Oa, c.qc && il(c, b, a.ub); else if (a.Tc = !0, null === a.Fb) a.ub = c; else { var d = a.pb.copy(), e = a.Ib, f = a.Lb; d.width = a.Ib / b; d.height = a.Lb / b; var h = a.mm.x, k = a.mm.y, l = a.$z; isNaN(h) && (l.uj() ? l.sj(Xb) ? h = 0 : l.sj(Yb) && (h = e - 1) : h = l.Xc() ? l.x * (e - 1) : e / 2); isNaN(k) && (l.uj() ? l.sj(Wb) ? k = 0 : l.sj(Zb) && (k = f - 1) : k = l.Xc() ? l.y * (f - 1) : f / 2); null !== a.cG && (c = a.cG(a, c)); c < a.Ah && (c = a.Ah); c > a.zh && (c = a.zh); e = w.xb(a.jb.x + h / b - h / c, a.jb.y + k / b - k / c); a.position = e; w.v(e); a.ub = c; a.xu(d, a.pb, b, c, !1); a.Tc = !1; Ol(a, !1); c = a.Oa; c.qc && il(c, b, a.ub); a.na(); Zl(a) } } D.prototype.xu = function (a, b, c, d, e) { a.L(b) || (void 0 === e && (e = !1), e || Zl(this), Ml(this), d = this.Tb, null === d || !d.Ex || this.Hl !== oh || e || a.width === b.width && a.height === b.height || d.J(), d = this.$a, !0 === this.Dm && d instanceof hh && (this.R.da = this.zB(this.R.df), Bk(d, this)), this.Tc || this.jF(a, b), bm(this), this.ph.scale = c, this.ph.position.x = a.x, this.ph.position.y = a.y, this.ph.bounds.set(a), this.ph.isScroll = e, this.Aa("ViewportBoundsChanged", this.ph, a), this.EA && this.links.each(function (a) { a.Xl && a.Y.Wf(b) && a.$b() })) }; function bm(a, b) { void 0 === b && (b = null); var c = a.qd; if (null !== c && c.visible) { for (var d = w.jm(), e = 1, f = 1, h = c.xa.n, k = h.length, l = 0; l < k; l++) { var m = h[l], n = m.interval; 2 > n || (Xm(m.Cb) ? f = f * n / Ae(f, n) : e = e * n / Ae(e, n)) } h = c.ux; d.m(f * h.width, e * h.height); h = f = l = k = 0; if (null !== b) k = b.width, l = b.height, f = b.x, h = b.y; else { e = w.If(); f = a.pb; e.m(f.x, f.y, f.width, f.height); for (h = a.lw.i; h.next();)f = h.value.pb, f.I() && $a(e, f.x, f.y, f.width, f.height); if (!e.I()) { w.Db(e); return } k = e.width; l = e.height; f = e.x; h = e.y; w.Db(e) } c.width = k + 2 * d.width; c.height = l + 2 * d.height; e = w.K(); Ka(f, h, 0, 0, d.width, d.height, e); e.offset(-d.width, -d.height); w.Bk(d); c.U.location = e; w.v(e) } } D.prototype.clearSelection = D.prototype.Xw = function () { var a = 0 < this.selection.count; a && this.Aa("ChangingSelection"); mh(this); a && this.Aa("ChangedSelection") }; function mh(a) { a = a.selection; if (0 < a.count) { for (var b = a.gc(), c = b.length, d = 0; d < c; d++)b[d].ib = !1; a.Qa(); a.clear(); a.freeze() } } D.prototype.select = D.prototype.select = function (a) { null !== a && (w.G(a, T, D, "select:part"), a.layer.g === this && (!a.ib || 1 < this.selection.count) && (this.Aa("ChangingSelection"), mh(this), a.ib = !0, this.Aa("ChangedSelection"))) }; D.prototype.selectCollection = D.prototype.gG = function (a) { this.Aa("ChangingSelection"); mh(this); if (w.isArray(a)) for (var b = w.Za(a), c = 0; c < b; c++) { var d = w.Ba(a, c); d instanceof T || w.k("Diagram.selectCollection given something that is not a Part: " + d); d.ib = !0 } else for (a = a.i; a.next();)d = a.value, d instanceof T || w.k("Diagram.selectCollection given something that is not a Part: " + d), d.ib = !0; this.Aa("ChangedSelection") }; D.prototype.clearHighlighteds = D.prototype.pH = function () { var a = this.Wl; if (0 < a.count) { for (var b = a.gc(), c = b.length, d = 0; d < c; d++)b[d].Pg = !1; a.Qa(); a.clear(); a.freeze() } }; D.prototype.highlight = function (a) { null !== a && a.layer.g === this && (w.G(a, T, D, "highlight:part"), !a.Pg || 1 < this.Wl.count) && (this.pH(), a.Pg = !0) }; D.prototype.highlightCollection = function (a) { for (var b = (new I(T)).Jc(a), c = this.Wl.copy().Zx(b).i; c.next();)a = c.value, a.Pg = !1; for (b = b.i; b.next();)a = b.value, a instanceof T || w.k("Diagram.highlightCollection given something that is not a Part: " + a), a.Pg = !0 }; D.prototype.scroll = D.prototype.scroll = function (a, b, c) { void 0 === c && (c = 1); var d = "up" === b || "down" === b, e = 0; if ("pixel" === a) e = c; else if ("line" === a) e = c * (d ? this.Gu : this.Fu); else if ("page" === a) a = d ? this.pb.height : this.pb.width, a *= this.scale, 0 !== a && (e = Math.max(a - (d ? this.Gu : this.Fu), 0), e *= c); else { if ("document" === a) { e = this.se; d = this.pb; c = w.K(); "up" === b ? this.position = c.m(d.x, e.y) : "left" === b ? this.position = c.m(e.x, d.y) : "down" === b ? this.position = c.m(d.x, e.bottom - d.height) : "right" === b && (this.position = c.m(e.right - d.width, d.y)); w.v(c); return } w.k("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: " + a) } e /= this.scale; c = this.position.copy(); "up" === b ? c.y = this.position.y - e : "down" === b ? c.y = this.position.y + e : "left" === b ? c.x = this.position.x - e : "right" === b ? c.x = this.position.x + e : w.k("scrolling direction must be 'up', 'down', 'left', or 'right', not: " + b); this.position = c }; D.prototype.scrollToRect = D.prototype.dG = function (a) { var b = this.pb; b.wk(a) || (a = a.Il, a.x -= b.width / 2, a.y -= b.height / 2, this.position = a) }; D.prototype.centerRect = D.prototype.sE = function (a) { var b = this.pb; a = a.Il; a.x -= b.width / 2; a.y -= b.height / 2; this.position = a }; D.prototype.transformDocToView = D.prototype.yG = function (a) { var b = this.fd; b.reset(); 1 !== this.ub && b.scale(this.ub); var c = this.jb; (0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y); return a.copy().transform(this.fd) }; D.prototype.transformViewToDoc = D.prototype.zB = function (a) { var b = this.fd; b.reset(); 1 !== this.ub && b.scale(this.ub); var c = this.jb; (0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y); return La(a.copy(), this.fd) }; var oh; D.None = oh = w.p(D, "None", 0); var Sl; D.Uniform = Sl = w.p(D, "Uniform", 1); var Tl; D.UniformToFill = Tl = w.p(D, "UniformToFill", 2); var Vi; D.CycleAll = Vi = w.p(D, "CycleAll", 10); var Zi; D.CycleNotDirected = Zi = w.p(D, "CycleNotDirected", 11); var aj; D.CycleNotDirectedFast = aj = w.p(D, "CycleNotDirectedFast", 12); var bj; D.CycleNotUndirected = bj = w.p(D, "CycleNotUndirected", 13); var Wi; D.CycleDestinationTree = Wi = w.p(D, "CycleDestinationTree", 14); var Yi; D.CycleSourceTree = Yi = w.p(D, "CycleSourceTree", 15); var sl; D.DocumentScroll = sl = w.p(D, "DocumentScroll", 1); var Jm; D.InfiniteScroll = Jm = w.p(D, "InfiniteScroll", 2); var ul; D.TreeParentCollapsed = ul = w.p(D, "TreeParentCollapsed", 21); var Ym; D.AllParentsCollapsed = Ym = w.p(D, "AllParentsCollapsed", 22); var Zm; D.AnyParentsCollapsed = Zm = w.p(D, "AnyParentsCollapsed", 23); w.defineProperty(D, { YJ: "validCycle" }, function () { return this.Jw }, function (a) { var b = this.Jw; b !== a && (w.mb(a, D, D, "validCycle"), this.Jw = a, this.h("validCycle", b, a)) }); w.u(D, { Ix: "layers" }, function () { return this.cc.i }); w.defineProperty(D, { Bf: "isModelReadOnly" }, function () { var a = this.me; return null === a ? !1 : a.hb }, function (a) { var b = this.me; null !== b && (b.hb = a) }); w.defineProperty(D, { hb: "isReadOnly" }, function () { return this.Mi }, function (a) { var b = this.Mi; b !== a && (w.j(a, "boolean", D, "isReadOnly"), this.Mi = a, this.h("isReadOnly", b, a)) }); w.defineProperty(D, { isEnabled: "isEnabled" }, function () { return this.ef }, function (a) { var b = this.ef; b !== a && (w.j(a, "boolean", D, "isEnabled"), this.ef = a, this.h("isEnabled", b, a)) }); w.defineProperty(D, { Sz: "allowClipboard" }, function () { return this.Vu }, function (a) { var b = this.Vu; b !== a && (w.j(a, "boolean", D, "allowClipboard"), this.Vu = a, this.h("allowClipboard", b, a)) }); w.defineProperty(D, { tk: "allowCopy" }, function () { return this.Nk }, function (a) { var b = this.Nk; b !== a && (w.j(a, "boolean", D, "allowCopy"), this.Nk = a, this.h("allowCopy", b, a)) }); w.defineProperty(D, { hn: "allowDelete" }, function () { return this.Ok }, function (a) { var b = this.Ok; b !== a && (w.j(a, "boolean", D, "allowDelete"), this.Ok = a, this.h("allowDelete", b, a)) }); w.defineProperty(D, { At: "allowDragOut" }, function () { return this.Wu }, function (a) { var b = this.Wu; b !== a && (w.j(a, "boolean", D, "allowDragOut"), this.Wu = a, this.h("allowDragOut", b, a)) }); w.defineProperty(D, { lE: "allowDrop" }, function () { return this.Xu }, function (a) { var b = this.Xu; b !== a && (w.j(a, "boolean", D, "allowDrop"), this.Xu = a, this.h("allowDrop", b, a)) }); w.defineProperty(D, { Tw: "allowTextEdit" }, function () { return this.Xk }, function (a) { var b = this.Xk; b !== a && (w.j(a, "boolean", D, "allowTextEdit"), this.Xk = a, this.h("allowTextEdit", b, a)) }); w.defineProperty(D, { Qw: "allowGroup" }, function () { return this.Pk }, function (a) { var b = this.Pk; b !== a && (w.j(a, "boolean", D, "allowGroup"), this.Pk = a, this.h("allowGroup", b, a)) }); w.defineProperty(D, { Uw: "allowUngroup" }, function () { return this.Yk }, function (a) { var b = this.Yk; b !== a && (w.j(a, "boolean", D, "allowUngroup"), this.Yk = a, this.h("allowUngroup", b, a)) }); w.defineProperty(D, { Dp: "allowInsert" }, function () { return this.Zu }, function (a) { var b = this.Zu; b !== a && (w.j(a, "boolean", D, "allowInsert"), this.Zu = a, this.h("allowInsert", b, a)) }); w.defineProperty(D, { Bt: "allowLink" }, function () { return this.Qk }, function (a) { var b = this.Qk; b !== a && (w.j(a, "boolean", D, "allowLink"), this.Qk = a, this.h("allowLink", b, a)) }); w.defineProperty(D, { jn: "allowRelink" }, function () { return this.Sk }, function (a) { var b = this.Sk; b !== a && (w.j(a, "boolean", D, "allowRelink"), this.Sk = a, this.h("allowRelink", b, a)) }); w.defineProperty(D, { Fl: "allowMove" }, function () { return this.Rk }, function (a) { var b = this.Rk; b !== a && (w.j(a, "boolean", D, "allowMove"), this.Rk = a, this.h("allowMove", b, a)) }); w.defineProperty(D, { Rw: "allowReshape" }, function () { return this.Tk }, function (a) { var b = this.Tk; b !== a && (w.j(a, "boolean", D, "allowReshape"), this.Tk = a, this.h("allowReshape", b, a)) }); w.defineProperty(D, { Ct: "allowResize" }, function () { return this.Uk }, function (a) { var b = this.Uk; b !== a && (w.j(a, "boolean", D, "allowResize"), this.Uk = a, this.h("allowResize", b, a)) }); w.defineProperty(D, { Sw: "allowRotate" }, function () { return this.Vk }, function (a) { var b = this.Vk; b !== a && (w.j(a, "boolean", D, "allowRotate"), this.Vk = a, this.h("allowRotate", b, a)) }); w.defineProperty(D, { vf: "allowSelect" }, function () { return this.Wk }, function (a) { var b = this.Wk; b !== a && (w.j(a, "boolean", D, "allowSelect"), this.Wk = a, this.h("allowSelect", b, a)) }); w.defineProperty(D, { mE: "allowUndo" }, function () { return this.$u }, function (a) { var b = this.$u; b !== a && (w.j(a, "boolean", D, "allowUndo"), this.$u = a, this.h("allowUndo", b, a)) }); w.defineProperty(D, { Vw: "allowZoom" }, function () { return this.bv }, function (a) { var b = this.bv; b !== a && (w.j(a, "boolean", D, "allowZoom"), this.bv = a, this.h("allowZoom", b, a)) }); w.defineProperty(D, { wA: "hasVerticalScrollbar" }, function () { return this.Gv }, function (a) { var b = this.Gv; b !== a && (w.j(a, "boolean", D, "hasVerticalScrollbar"), this.Gv = a, Zl(this), this.na(), this.h("hasVerticalScrollbar", b, a), Ol(this, !1)) }); w.defineProperty(D, { vA: "hasHorizontalScrollbar" }, function () { return this.Fv }, function (a) { var b = this.Fv; b !== a && (w.j(a, "boolean", D, "hasHorizontalScrollbar"), this.Fv = a, Zl(this), this.na(), this.h("hasHorizontalScrollbar", b, a), Ol(this, !1)) }); w.defineProperty(D, { oe: "allowHorizontalScroll" }, function () { return this.Yu }, function (a) { var b = this.Yu; b !== a && (w.j(a, "boolean", D, "allowHorizontalScroll"), this.Yu = a, this.h("allowHorizontalScroll", b, a), Ol(this, !1)) }); w.defineProperty(D, { pe: "allowVerticalScroll" }, function () { return this.av }, function (a) { var b = this.av; b !== a && (w.j(a, "boolean", D, "allowVerticalScroll"), this.av = a, this.h("allowVerticalScroll", b, a), Ol(this, !1)) }); w.defineProperty(D, { Fu: "scrollHorizontalLineChange" }, function () { return this.tw }, function (a) { var b = this.tw; b !== a && (w.j(a, "number", D, "scrollHorizontalLineChange"), 0 > a && w.Fa(a, ">= 0", D, "scrollHorizontalLineChange"), this.tw = a, this.h("scrollHorizontalLineChange", b, a)) }); w.defineProperty(D, { Gu: "scrollVerticalLineChange" }, function () { return this.xw }, function (a) { var b = this.xw; b !== a && (w.j(a, "number", D, "scrollVerticalLineChange"), 0 > a && w.Fa(a, ">= 0", D, "scrollVerticalLineChange"), this.xw = a, this.h("scrollVerticalLineChange", b, a)) }); w.defineProperty(D, { R: "lastInput" }, function () { return this.Rb }, function (a) { this.Rb = a }); w.defineProperty(D, { Bc: "firstInput" }, function () { return this.Ki }, function (a) { this.Ki = a }); w.defineProperty(D, { ec: "currentCursor" }, function () { return this.mv }, function (a) { "" === a && (a = this.jr); var b = this.mv; if (b !== a) { w.j(a, "string", D, "currentCursor"); var c = this.Fb, d = this.Mb; null !== c && (this.mv = a, c.style.cursor = a, d.style.cursor = a, c.style.cursor === b && (c.style.cursor = "-webkit-" + a, d.style.cursor = "-webkit-" + a, c.style.cursor === b && (c.style.cursor = "-moz-" + a, d.style.cursor = "-moz-" + a, c.style.cursor === b && (c.style.cursor = a, d.style.cursor = a)))) } }); w.defineProperty(D, { KK: "defaultCursor" }, function () { return this.jr }, function (a) { "" === a && (a = "auto"); var b = this.jr; b !== a && (w.j(a, "string", D, "defaultCursor"), this.jr = a, this.h("defaultCursor", b, a)) }); w.defineProperty(D, { click: "click" }, function () { return this.zi }, function (a) { var b = this.zi; b !== a && (null !== a && w.j(a, "function", D, "click"), this.zi = a, this.h("click", b, a)) }); w.defineProperty(D, { It: "doubleClick" }, function () { return this.Hi }, function (a) { var b = this.Hi; b !== a && (null !== a && w.j(a, "function", D, "doubleClick"), this.Hi = a, this.h("doubleClick", b, a)) }); w.defineProperty(D, { aA: "contextClick" }, function () { return this.Bi }, function (a) { var b = this.Bi; b !== a && (null !== a && w.j(a, "function", D, "contextClick"), this.Bi = a, this.h("contextClick", b, a)) }); w.defineProperty(D, { QA: "mouseOver" }, function () { return this.Wi }, function (a) { var b = this.Wi; b !== a && (null !== a && w.j(a, "function", D, "mouseOver"), this.Wi = a, this.h("mouseOver", b, a)) }); w.defineProperty(D, { PA: "mouseHover" }, function () { return this.Vi }, function (a) { var b = this.Vi; b !== a && (null !== a && w.j(a, "function", D, "mouseHover"), this.Vi = a, this.h("mouseHover", b, a)) }); w.defineProperty(D, { OA: "mouseHold" }, function () { return this.Ui }, function (a) { var b = this.Ui; b !== a && (null !== a && w.j(a, "function", D, "mouseHold"), this.Ui = a, this.h("mouseHold", b, a)) }); w.defineProperty(D, { cJ: "mouseDragOver" }, function () { return this.ew }, function (a) { var b = this.ew; b !== a && (null !== a && w.j(a, "function", D, "mouseDragOver"), this.ew = a, this.h("mouseDragOver", b, a)) }); w.defineProperty(D, { NA: "mouseDrop" }, function () { return this.Ti }, function (a) { var b = this.Ti; b !== a && (null !== a && w.j(a, "function", D, "mouseDrop"), this.Ti = a, this.h("mouseDrop", b, a)) }); w.defineProperty(D, { vB: "toolTip" }, function () { return this.ej }, function (a) { var b = this.ej; b !== a && (this.ej = a, this.h("toolTip", b, a)) }); w.defineProperty(D, { contextMenu: "contextMenu" }, function () { return this.Ci }, function (a) { var b = this.Ci; b !== a && (this.Ci = a, this.h("contextMenu", b, a)) }); w.defineProperty(D, { ob: "commandHandler" }, function () { return this.Ly }, function (a) { var b = this.Ly; b !== a && (w.G(a, rg, D, "commandHandler"), null !== a.g && w.k("Cannot share CommandHandlers between Diagrams: " + a.toString()), null !== b && b.Rc(null), this.Ly = a, a.Rc(this)) }); w.defineProperty(D, { eb: "toolManager" }, function () { return this.Lz }, function (a) { var b = this.Lz; b !== a && (w.G(a, hh, D, "toolManager"), null !== a.g && w.k("Cannot share ToolManagers between Diagrams: " + a.toString()), null !== b && b.Rc(null), this.Lz = a, a.Rc(this)) }); w.defineProperty(D, { Gt: "defaultTool" }, function () { return this.Ry }, function (a) { var b = this.Ry; b !== a && (w.G(a, qg, D, "defaultTool"), this.Ry = a, this.$a === b && (this.$a = a)) }); w.defineProperty(D, { $a: "currentTool" }, function () { return this.Oy }, function (a) { var b = this.Oy; null !== b && (b.sa && b.doDeactivate(), b.cancelWaitAfter(), b.doStop()); null === a && (a = this.Gt); null !== a && (w.G(a, qg, D, "currentTool"), this.Oy = a, a.Rc(this), a.doStart()) }); w.u(D, { selection: "selection" }, function () { return this.zw }); w.defineProperty(D, { UI: "maxSelectionCount" }, function () { return this.aw }, function (a) { var b = this.aw; if (b !== a) if (w.j(a, "number", D, "maxSelectionCount"), 0 <= a && !isNaN(a)) { if (this.aw = a, this.h("maxSelectionCount", b, a), !this.oa.ab && (a = this.selection.count - a, 0 < a)) { this.Aa("ChangingSelection"); for (var b = this.selection.gc(), c = 0; c < a; c++)b[c].ib = !1; this.Aa("ChangedSelection") } } else w.Fa(a, ">= 0", D, "maxSelectionCount") }); w.defineProperty(D, { fJ: "nodeSelectionAdornmentTemplate" }, function () { return this.fw }, function (a) { var b = this.fw; b !== a && (w.G(a, jh, D, "nodeSelectionAdornmentTemplate"), this.fw = a, this.h("nodeSelectionAdornmentTemplate", b, a)) }); w.defineProperty(D, { hI: "groupSelectionAdornmentTemplate" }, function () { return this.Dv }, function (a) { var b = this.Dv; b !== a && (w.G(a, jh, D, "groupSelectionAdornmentTemplate"), this.Dv = a, this.h("groupSelectionAdornmentTemplate", b, a)) }); w.defineProperty(D, { NI: "linkSelectionAdornmentTemplate" }, function () { return this.Wv }, function (a) { var b = this.Wv; b !== a && (w.G(a, jh, D, "linkSelectionAdornmentTemplate"), this.Wv = a, this.h("linkSelectionAdornmentTemplate", b, a)) }); w.u(D, { Wl: "highlighteds" }, function () { return this.Hv }); w.defineProperty(D, { ri: "isModified" }, function () { var a = this.oa; return a.isEnabled ? null !== a.mj ? !0 : this.Ov && this.fh !== a.rj : this.Ov }, function (a) { if (this.Ov !== a) { w.j(a, "boolean", D, "isModified"); this.Ov = a; var b = this.oa; !a && b.isEnabled && (this.fh = b.rj); a || $m(this) } }); function $m(a) { var b = a.ri; a.bE !== b && (a.bE = b, a.Aa("Modified")) } w.defineProperty(D, { ba: "model" }, function () { return this.me }, function (a) { var b = this.me; if (b !== a) { w.G(a, F, D, "model"); this.$a.doCancel(); null !== b && b.oa !== a.oa && b.oa.rF && w.k("Do not replace a Diagram.model while a transaction is in progress."); this.Oa.Hh(); this.Xw(); this.gh = !1; this.Go = !0; this.fh = -2; this.Sf = !1; var c = this.$d; this.$d = !0; this.Oa.Un("Model"); null !== b && (null !== this.ih && this.ih.each(function (a) { b.Au(a) }), b.Au(this.gD), b instanceof R && an(this, b.Qg), an(this, b.fg)); this.me = a; a.gn(this.fD); bn(this, a.fg); a instanceof R && cn(this, a.Qg); a.Au(this.fD); a.gn(this.gD); null !== this.ih && this.ih.each(function (b) { a.gn(b) }); this.$d = c; this.Tc || this.na(); null !== b && (a.oa.isEnabled = b.oa.isEnabled) } }); w.defineProperty(D, { Ta: null }, function () { return this.YC }, function (a) { this.YC = a }); w.u(D, { Lx: null }, function () { return this.NG }); function wl(a, b) { if (b.ba === a.ba) { var c = b.Ac, d = b.propertyName; if (c === Pf && "S" === d[0]) if ("StartingFirstTransaction" === d) c = a.eb, c.cf.each(function (b) { b.Rc(a) }), c.bg.each(function (b) { b.Rc(a) }), c.cg.each(function (b) { b.Rc(a) }), a.$d || a.gh || (a.tv = !0, a.Go && (a.Sf = !0)); else if ("StartingUndo" === d || "StartingRedo" === d) { var e = a.Oa; e.mf && !a.wb && e.Hh(); a.Aa("ChangingSelection") } else "StartedTransaction" === d && (e = a.Oa, e.mf && !a.wb && e.Hh()); else if (a.Ta) { a.Ta = !1; try { var f = b.nf; if ("" !== f) if (c === Of) { if ("linkFromKey" === f) { var h = b.object, k = a.Vf(h); if (null !== k) { var l = b.newValue, m = a.Je(l); k.V = m } } else if ("linkToKey" === f) h = b.object, k = a.Vf(h), null !== k && (l = b.newValue, m = a.Je(l), k.Z = m); else if ("linkFromPortId" === f) { if (h = b.object, k = a.Vf(h), null !== k) { var n = b.newValue; "string" === typeof n && (k.Og = n) } } else if ("linkToPortId" === f) h = b.object, k = a.Vf(h), null !== k && (n = b.newValue, "string" === typeof n && (k.Ih = n)); else if ("nodeGroupKey" === f) { var h = b.object, p = a.xh(h); if (null !== p) { var q = b.newValue; if (void 0 !== q) { var r = a.Je(q); p.Da = r instanceof V ? r : null } else p.Da = null } } else if ("linkLabelKeys" === f) { if (h = b.object, k = a.Vf(h), null !== k) { var s = b.oldValue, u = b.newValue; if (w.isArray(s)) for (var t = w.Za(s), x = 0; x < t; x++) { var v = w.Ba(s, x), m = a.Je(v); null !== m && (m.Wb = null) } if (w.isArray(u)) for (t = w.Za(u), x = 0; x < t; x++)v = w.Ba(u, x), m = a.Je(v), null !== m && (m.Wb = k) } } else if ("nodeParentKey" === f) { var A = b.object, y = a.Je(b.newValue), K = a.ox(A); if (null !== K) { var E = K.yn(); null !== E ? null === y ? a.remove(E) : a.Sd ? E.V = y : E.Z = y : dn(a, y, K) } } else if ("parentLinkCategory" === f) { var A = b.object, K = a.ox(A), Q = b.newValue; null !== K && "string" === typeof Q && (E = K.yn(), null !== E && (E.ud = Q)) } else if ("nodeCategory" === f) { var h = b.object, X = a.xh(h), Q = b.newValue; null !== X && "string" === typeof Q && (X.ud = Q) } else if ("linkCategory" === f) { var h = b.object, O = a.Vf(h), Q = b.newValue; null !== O && "string" === typeof Q && (O.ud = Q) } else if ("nodeDataArray" === f) { var aa = b.oldValue; an(a, aa); var da = b.newValue; bn(a, da) } else "linkDataArray" === f && (aa = b.oldValue, an(a, aa), da = b.newValue, cn(a, da)); a.ri = !0 } else c === Qf ? (da = b.newValue, "nodeDataArray" === f && w.Pa(da) ? en(a, da) : "linkDataArray" === f && w.Pa(da) ? fn(a, da) : "linkLabelKeys" === f && wg(da) && (k = a.Vf(b.object), m = a.Je(da), null !== k && null !== m && (m.Wb = k)), a.ri = !0) : c === Rf ? (aa = b.oldValue, "nodeDataArray" === f && w.Pa(aa) ? gn(a, aa) : "linkDataArray" === f && w.Pa(aa) ? gn(a, aa) : "linkLabelKeys" === f && wg(aa) && (m = a.Je(aa), null !== m && (m.Wb = null)), a.ri = !0) : c === Pf && ("SourceChanged" === f ? null !== b.object ? vl(a, b.object, b.propertyName) : (a.XJ(), a.BG()) : "ModelDisplaced" === f && a.cm()); else if (c === Of) { var S = b.propertyName, h = b.object; if (h === a.ba) { if ("nodeKeyProperty" === S || "nodeCategoryProperty" === S || "linkFromKeyProperty" === S || "linkToKeyProperty" === S || "linkFromPortIdProperty" === S || "linkToPortIdProperty" === S || "linkLabelKeysProperty" === S || "nodeIsGroupProperty" === S || "nodeGroupKeyProperty" === S || "nodeParentKeyProperty" === S || "linkCategoryProperty" === S) a.oa.ab || a.cm() } else vl(a, h, S); a.ri = !0 } else if (c === Qf || c === Rf) hn(a, b), a.ri = !0; else if (c === Pf) { if ("FinishedUndo" === d || "FinishedRedo" === d) a.oa.Nf = !0, a.Aa("ChangedSelection"), Hi(a), a.oa.Nf = !1; e = a.Oa; "RolledBackTransaction" === d && e.Hh(); a.tv = !0; a.ag(); 0 === a.oa.Jh && Rk(e); "CommittedTransaction" === d && a.oa.oz && (a.fh = Math.min(a.fh, a.oa.rj - 1)); var Ra = b.wF; Ra && ($m(a), a.Lx.clear()); !a.vz && Ra && (a.vz = !0, w.setTimeout(function () { a.$a.standardMouseOver(); a.vz = !1 }, 10)) } } finally { a.Ta = !0 } } } } function vl(a, b, c) { if ("string" === typeof c) { var d = a.xh(b); if (null !== d) d.Hb(c), a.ba instanceof ag && (d = a.Vf(b), null !== d && d.Hb(c)); else { for (var d = null, e = a.Fm.i; e.next();) { for (var f = e.value, h = 0; h < f.length; h++) { var k = f[h].TH(b); null !== k && (null === d && (d = w.cb()), d.push(k)) } if (null !== d) break } if (null !== d) { for (e = 0; e < d.length; e++)d[e].Hb(c); w.ua(d) } } b === a.ba.Hk && a.BG(c) } } w.defineProperty(D, { Oe: "skipsModelSourceBindings" }, function () { return this.CD }, function (a) { this.CD = a }); w.defineProperty(D, { Mu: null }, function () { return this.Gz }, function (a) { this.Gz = a }); function hn(a, b) { var c = b.Ac === Qf, d = c ? b.zj : b.Aj, e = c ? b.newValue : b.oldValue, f = a.Fm.ja(b.object); if (Array.isArray(f)) for (var h = 0; h < f.length; h++) { var k = f[h]; if (c) jn(k, e, d); else { var l = d; if (!(0 > l)) { var m = l; kn(k) && m++; k.lf(m); ln(k, m, l) } } } } function Om(a, b) { var c = b.$j; if (w.isArray(c)) { var d = a.Fm.ja(c); if (null === d) d = [], d.push(b), a.Fm.add(c, d); else { for (c = 0; c < d.length; c++)if (d[c] === b) return; d.push(b) } } } function Sm(a, b) { var c = b.$j; if (w.isArray(c)) { var d = a.Fm.ja(c); if (null !== d) for (var e = 0; e < d.length; e++)if (d[e] === b) { d.splice(e, 1); 0 === d.length && a.Fm.remove(c); break } } } function Nm(a, b) { for (var c = b.xa.n, d = c.length, e = 0; e < d; e++) { var f = c[e]; f instanceof xl && mn(a, f) } } function mn(a, b) { var c = b.element; if (null !== c && c instanceof HTMLImageElement) { var d = b.Te; null !== d && (d.Io instanceof Event && null !== b.Ue && b.Ue(b, d.Io), !0 === d.Nv && (null !== b.ki && b.ki(b, d.Bz), null !== b.g && b.g.yz.add(b))); c = c.src; d = a.gp.ja(c); if (null === d) d = [], d.push(b), a.gp.add(c, d); else { for (c = 0; c < d.length; c++)if (d[c] === b) return; d.push(b) } } } function Rm(a, b) { for (var c = b.xa.n, d = c.length, e = 0; e < d; e++) { var f = c[e]; f instanceof xl && nn(a, f) } } function nn(a, b) { var c = b.element; if (null !== c && c instanceof HTMLImageElement) { var c = c.src, d = a.gp.ja(c); if (null !== d) for (var e = 0; e < d.length; e++)if (d[e] === b) { d.splice(e, 1); 0 === d.length && a.gp.remove(c); break } } } D.prototype.rebuildParts = D.prototype.cm = function () { for (var a = this.TA.i; a.next();) { var b = a.value, c = a.key; (!b.ee() || b instanceof V) && w.k('Invalid node template in Diagram.nodeTemplateMap: template for "' + c + '" must be a Node or a simple Part, not a Group or Link: ' + b) } for (a = this.uA.i; a.next();)b = a.value, c = a.key, b instanceof V || w.k('Invalid group template in Diagram.groupTemplateMap: template for "' + c + '" must be a Group, not a normal Node or Link: ' + b); for (a = this.GA.i; a.next();)b = a.value, c = a.key, b instanceof W || w.k('Invalid link template in Diagram.linkTemplateMap: template for "' + c + '" must be a Link, not a normal Node or simple Part: ' + b); a = w.cb(); for (b = this.selection.i; b.next();)(c = b.value.data) && a.push(c); for (var b = w.cb(), d = this.Wl.i; d.next();)(c = d.value.data) && b.push(c); c = w.cb(); for (d = this.gg.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.Kk.i; d.next();)e = d.value, null !== e.data && (c.push(e.data), c.push(e.location)); d = this.ba; d instanceof R && an(this, d.Qg); an(this, d.fg); bn(this, d.fg); d instanceof R && cn(this, d.Qg); for (d = 0; d < a.length; d++)e = this.xh(a[d]), null !== e && (e.ib = !0); for (d = 0; d < b.length; d++)e = this.xh(b[d]), null !== e && (e.Pg = !0); for (d = 0; d < c.length; d += 2)e = this.xh(c[d]), null !== e && (e.location = c[d + 1]); w.ua(a); w.ua(b); w.ua(c) }; function bn(a, b) { if (null !== b) { for (var c = a.ba, d = c instanceof R, e = w.Za(b), f = 0; f < e; f++) { var h = w.Ba(b, f); c.He(h) ? en(a, h, !1) : d && fn(a, h) } if (d || c instanceof ag) { for (f = 0; f < e; f++)h = w.Ba(b, f), c.He(h) && on(a, h); if (d) for (c = a.links; c.next();)pn(c.value) } qn(a, !1) } } function en(a, b, c) { if (void 0 !== b && null !== b && !a.oa.ab && !a.Di.contains(b)) { void 0 === c && (c = !0); var d = a.qA(b), e = rn(a, b, d); if (null !== e && (lh(e), e = e.copy(), null !== e)) { var f = a.Oe; a.Oe = !0; e.xi = d; e.Yd = b; a.add(e); e.Yd = null; e.data = b; c && on(a, b); a.Oe = f } } } D.prototype.qA = function (a) { return this.ba.qA(a) }; var sn = !1, tn = !1; function rn(a, b, c) { var d = !1, e = a.ba; e instanceof R && (d = e.CA(b)); d ? (b = a.uA.ja(c), null === b && (b = a.uA.ja(""), null === b && (tn || (tn = !0, w.trace('No Group template found for category "' + c + '"'), w.trace(" Using default group template")), b = a.qC))) : (b = a.TA.ja(c), null === b && (b = a.TA.ja(""), null === b && (sn || (sn = !0, w.trace('No Node template found for category "' + c + '"'), w.trace(" Using default node template")), b = a.sC))); return b } function on(a, b) { var c = a.ba; if (c instanceof R || c instanceof ag) { var d = c.sb(b); if (void 0 !== d) { var e = zg(c, d), f = a.xh(b); if (null !== e && null !== f) { for (e = e.i; e.next();) { var h = e.value; if (c instanceof R) { var k = c; if (k.He(h)) { if (f instanceof V && k.An(h) === d) { var l = f, h = a.xh(h); null !== h && (h.Da = l) } } else { var m = a.Vf(h); if (null !== m && f instanceof U && (l = f, k.Ul(h) === d && (m.V = l), k.Vl(h) === d && (m.Z = l), h = k.Ck(h), w.isArray(h))) for (k = 0; k < w.Za(h); k++)if (w.Ba(h, k) === d) { l.Wb = m; break } } } else c instanceof ag && (m = c, m.He(h) && f instanceof U && (l = f, m.Cn(h) === d && (h = a.ox(h), dn(a, l, h)))) } Tg(c, d) } c instanceof R ? (c = c.An(b), void 0 !== c && (c = a.Je(c), c instanceof V && (f.Da = c))) : c instanceof ag && (c = c.Cn(b), void 0 !== c && f instanceof U && (l = f, f = a.Je(c), dn(a, f, l))) } } } function dn(a, b, c) { if (null !== b && null !== c) { var d = a.eb.BF, e = b, f = c; if (a.Sd) for (b = f.ge; b.next();) { if (b.value.Z === f) return } else for (e = c, f = b, b = e.ge; b.next();)if (b.value.V === e) return; if (null === d || !Xi(d, e, f, null, !0)) if (d = a.sx(c.data), b = un(a, d), null !== b && (lh(b), b = b.copy(), null !== b)) { var h = a.Oe; a.Oe = !0; b.xi = d; b.Yd = c.data; b.V = e; b.Z = f; a.add(b); b.Yd = null; b.data = c.data; a.Oe = h } } } function cn(a, b) { if (null !== b) { for (var c = w.Za(b), d = 0; d < c; d++) { var e = w.Ba(b, d); fn(a, e) } qn(a, !1) } } function fn(a, b) { if (void 0 !== b && null !== b && !a.oa.ab && !a.Kj.contains(b)) { var c = a.sx(b), d = un(a, c); if (null !== d && (lh(d), d = d.copy(), null !== d)) { var e = a.Oe; a.Oe = !0; d.xi = c; d.Yd = b; var c = a.ba, f = c.$H(b); "" !== f && (d.Og = f); f = c.Ul(b); void 0 !== f && (f = a.Je(f), f instanceof U && (d.V = f)); f = c.dI(b); "" !== f && (d.Ih = f); f = c.Vl(b); void 0 !== f && (f = a.Je(f), f instanceof U && (d.Z = f)); c = c.Ck(b); if (w.isArray(c)) for (var f = w.Za(c), h = 0; h < f; h++) { var k = w.Ba(c, h), k = a.Je(k); null !== k && (k.Wb = d) } a.add(d); d.Yd = null; d.data = b; a.Oe = e } } } D.prototype.sx = function (a) { var b = this.ba, c = ""; b instanceof R ? c = b.sx(a) : b instanceof ag && (c = b.bI(a)); return c }; var vn = !1; function un(a, b) { var c = a.GA.ja(b); null === c && (c = a.GA.ja(""), null === c && (vn || (vn = !0, w.trace('No Link template found for category "' + b + '"'), w.trace(" Using default link template")), c = a.rC)); return c } function an(a, b) { for (var c = w.Za(b), d = 0; d < c; d++) { var e = w.Ba(b, d); gn(a, e) } } function gn(a, b) { if (void 0 !== b && null !== b) { var c = a.xh(b); if (null !== c) { Tm(a, c, !1); var d = a.ba; if (d instanceof R && c instanceof U) { var e = d.sb(c.data); if (void 0 !== e) { for (var f = c.ge; f.next();)Sg(d, e, f.value.data); c.Af && (f = c.Wb, null !== f && Sg(d, e, f.data)); if (c instanceof V) for (c = c.Oc; c.next();)f = c.value.data, d.He(f) && Sg(d, e, f) } } else if (d instanceof ag && c instanceof U) { f = a.Vf(c.data); if (null !== f) { f.ib = !1; f.Pg = !1; var h = f.layer; if (null !== h) { var k = h.lf(-1, f, !1); 0 <= k && a.Zc(Rf, "parts", h, f, null, k, null); k = f.Hx; null !== k && k(f, h, null) } } f = a.Sd; for (c = c.ge; c.next();)h = c.value, h = (f ? h.Z : h.V).data, d.He(h) && Sg(d, e, h) } } } } D.prototype.findPartForKey = D.prototype.UH = function (a) { if (null === a || void 0 === a) return null; var b = this.ba.ve(a); return null !== b ? this.Di.ja(b) : this.ba instanceof R && (b = this.ba.Rp(a), null !== b) ? this.Kj.ja(b) : null }; D.prototype.findNodeForKey = D.prototype.Je = function (a) { if (null === a || void 0 === a) return null; a = this.ba.ve(a); if (null === a) return null; a = this.Di.ja(a); return a instanceof U ? a : null }; D.prototype.findPartForData = D.prototype.xh = function (a) { if (null === a) return null; var b = this.Di.ja(a); return null !== b ? b : b = this.Kj.ja(a) }; D.prototype.findNodeForData = D.prototype.ox = function (a) { if (null === a) return null; a = this.Di.ja(a); return a instanceof U ? a : null }; D.prototype.findLinkForData = D.prototype.Vf = function (a) { return null === a ? null : this.Kj.ja(a) }; D.prototype.findNodesByExample = function (a) { for (var b = new I(U), c = this.ep.i; c.next();) { var d = c.value, e = d.data; if (null !== e) for (var f = 0; f < arguments.length; f++) { var h = arguments[f]; if (w.Pa(h) && wn(this, e, h)) { b.add(d); break } } } return b.i }; D.prototype.findLinksByExample = function (a) { for (var b = new I(W), c = this.Yo.i; c.next();) { var d = c.value, e = d.data; if (null !== e) for (var f = 0; f < arguments.length; f++) { var h = arguments[f]; if (w.Pa(h) && wn(this, e, h)) { b.add(d); break } } } return b.i }; function wn(a, b, c) { for (var d in c) { var e = b[d], f = c[d]; if (w.isArray(f)) { if (!w.isArray(e) || e.length < f.length) return !1; for (var h = 0; h < e.length; h++) { var k = e[h], l = f[h]; if (void 0 !== l && !xn(a, k, l)) return !1 } } else if (!xn(a, e, f)) return !1 } return !0 } function xn(a, b, c) { if ("function" === typeof c) { if (!c(b)) return !1 } else if (c instanceof RegExp) { if (!b || !c.test(b.toString())) return !1 } else if (w.Pa(b) && w.Pa(c)) { if (!wn(a, b, c)) return !1 } else if (b !== c) return !1; return !0 } w.defineProperty(D, { vL: "nodeTemplate" }, function () { return this.Xi.ja("") }, function (a) { var b = this.Xi.ja(""); b !== a && (w.G(a, T, D, "nodeTemplate"), this.Xi.add("", a), this.h("nodeTemplate", b, a), this.oa.ab || this.cm()) }); w.defineProperty(D, { TA: "nodeTemplateMap" }, function () { return this.Xi }, function (a) { var b = this.Xi; b !== a && (w.G(a, la, D, "nodeTemplateMap"), this.Xi = a, this.h("nodeTemplateMap", b, a), this.oa.ab || this.cm()) }); w.defineProperty(D, { YK: "groupTemplate" }, function () { return this.dl.ja("") }, function (a) { var b = this.dl.ja(""); b !== a && (w.G(a, V, D, "groupTemplate"), this.dl.add("", a), this.h("groupTemplate", b, a), this.oa.ab || this.cm()) }); w.defineProperty(D, { uA: "groupTemplateMap" }, function () { return this.dl }, function (a) { var b = this.dl; b !== a && (w.G(a, la, D, "groupTemplateMap"), this.dl = a, this.h("groupTemplateMap", b, a), this.oa.ab || this.cm()) }); w.defineProperty(D, { jL: "linkTemplate" }, function () { return this.ak.ja("") }, function (a) { var b = this.ak.ja(""); b !== a && (w.G(a, W, D, "linkTemplate"), this.ak.add("", a), this.h("linkTemplate", b, a), this.oa.ab || this.cm()) }); w.defineProperty(D, { GA: "linkTemplateMap" }, function () { return this.ak }, function (a) { var b = this.ak; b !== a && (w.G(a, la, D, "linkTemplateMap"), this.ak = a, this.h("linkTemplateMap", b, a), this.oa.ab || this.cm()) }); w.defineProperty(D, { zI: null }, function () { return this.Dm }, function (a) { this.Dm = a }); w.defineProperty(D, { bf: "isMouseCaptured" }, function () { return this.VC }, function (a) { var b = this.Fb; null !== b && (a ? (this.R.bubbles = !1, b.removeEventListener("mousemove", this.Pn, !1), b.removeEventListener("mousedown", this.On, !1), b.removeEventListener("mouseup", this.Rn, !1), b.removeEventListener("mousewheel", this.Rg, !1), b.removeEventListener("DOMMouseScroll", this.Rg, !1), b.removeEventListener("mouseout", this.Qn, !1), window.addEventListener("mousemove", this.Pn, !0), window.addEventListener("mousedown", this.On, !0), window.addEventListener("mouseup", this.Rn, !0), window.addEventListener("mousewheel", this.Rg, !0), window.addEventListener("DOMMouseScroll", this.Rg, !0), window.addEventListener("mouseout", this.Qn, !0), window.addEventListener("selectstart", this.preventDefault, !1)) : (window.removeEventListener("mousemove", this.Pn, !0), window.removeEventListener("mousedown", this.On, !0), window.removeEventListener("mouseup", this.Rn, !0), window.removeEventListener("mousewheel", this.Rg, !0), window.removeEventListener("DOMMouseScroll", this.Rg, !0), window.removeEventListener("mouseout", this.Qn, !0), window.removeEventListener("selectstart", this.preventDefault, !1), b.addEventListener("mousemove", this.Pn, !1), b.addEventListener("mousedown", this.On, !1), b.addEventListener("mouseup", this.Rn, !1), b.addEventListener("mousewheel", this.Rg, !1), b.addEventListener("DOMMouseScroll", this.Rg, !1), b.addEventListener("mouseout", this.Qn, !1)), this.VC = a) }); w.defineProperty(D, { position: "position" }, function () { return this.jb }, function (a) { var b = this.jb; if (!b.L(a)) { w.G(a, z, D, "position"); var c = this.pb.copy(); a = a.copy(); if (!this.Tc && null !== this.Fb) { this.Tc = !0; var d = this.scale; Ql(this, a, this.se, this.Ib / d, this.Lb / d, this.so, !1); this.Tc = !1 } this.jb = a.S(); a = this.Oa; a.qc && hl(a, b, this.jb); this.Tc || this.xu(c, this.pb, this.ub, this.ub, !1) } }); w.defineProperty(D, { pI: "initialPosition" }, function () { return this.Jv }, function (a) { this.Jv.L(a) || (w.G(a, z, D, "initialPosition"), this.Jv = a.S()) }); w.defineProperty(D, { qI: "initialScale" }, function () { return this.Kv }, function (a) { this.Kv !== a && (w.j(a, "number", D, "initialScale"), this.Kv = a) }); w.defineProperty(D, { Dn: "grid" }, function () { null === this.qd && Hl(this); return this.qd }, function (a) { var b = this.qd; if (b !== a) { null === b && (Hl(this), b = this.qd); w.G(a, C, D, "grid"); a.type !== Il && w.k("Diagram.grid must be a Panel of type Panel.Grid"); var c = b.O; null !== c && c.remove(b); this.qd = a; a.name = "GRID"; null !== c && c.add(a); bm(this); this.na(); this.h("grid", b, a) } }); w.u(D, { pb: "viewportBounds" }, function () { var a = this.aE; if (null === this.Fb) return a; var b = this.jb, c = this.ub; a.m(b.x, b.y, Math.max(this.Ib, 0) / c, Math.max(this.Lb, 0) / c); return a }); w.defineProperty(D, { SE: "fixedBounds" }, function () { return this.Bv }, function (a) { var b = this.Bv; b.L(a) || (w.G(a, B, D, "fixedBounds"), -Infinity !== a.width && Infinity !== a.height && -Infinity !== a.height || w.k("fixedBounds width/height must not be Infinity"), this.Bv = a = a.S(), this.sc(), this.h("fixedBounds", b, a)) }); w.defineProperty(D, { gy: "scrollMargin" }, function () { return this.uw }, function (a) { "number" === typeof a ? a = new db(a) : w.G(a, db, D, "scrollMargin"); var b = this.uw; b.L(a) || (this.uw = a = a.S(), this.sc(), this.h("scrollMargin", b, a)) }); w.defineProperty(D, { dB: "scrollMode" }, function () { return this.vw }, function (a) { var b = this.vw; b !== a && (w.mb(a, D, D, "scrollMode"), this.vw = a, a === sl && Ol(this, !1), this.h("scrollMode", b, a)) }); w.defineProperty(D, { QF: "positionComputation" }, function () { return this.pw }, function (a) { var b = this.pw; b !== a && (null !== a && w.j(a, "function", D, "positionComputation"), this.pw = a, Ol(this, !1), this.h("positionComputation", b, a)) }); w.defineProperty(D, { cG: "scaleComputation" }, function () { return this.rw }, function (a) { var b = this.rw; b !== a && (null !== a && w.j(a, "function", D, "scaleComputation"), this.rw = a, Wm(this, this.scale, this.scale), this.h("scaleComputation", b, a)) }); w.u(D, { se: "documentBounds" }, function () { return this.uv }); function Rl(a, b) { a.Vj = !1; var c = a.uv; c.L(b) || (b = b.S(), a.uv = b, Ol(a, !1), a.Aa("DocumentBoundsChanged", null, c.copy()), Zl(a)) } w.defineProperty(D, { EA: "isVirtualized" }, function () { return this.Sv }, function (a) { var b = this.Sv; b !== a && (w.j(a, "boolean", D, "isVirtualized"), this.Sv = a, this.h("isVirtualized", b, a)) }); w.defineProperty(D, { scale: "scale" }, function () { return this.ub }, function (a) { var b = this.ub; w.vd(a, D, "scale"); b !== a && Wm(this, b, a) }); w.defineProperty(D, { Hl: "autoScale" }, function () { return this.sm }, function (a) { var b = this.sm; b !== a && (w.mb(a, D, D, "autoScale"), this.sm = a, this.h("autoScale", b, a), a !== oh && Ol(this, !1)) }); w.defineProperty(D, { aL: "initialAutoScale" }, function () { return this.hl }, function (a) { var b = this.hl; b !== a && (w.mb(a, D, D, "initialAutoScale"), this.hl = a, this.h("initialAutoScale", b, a)) }); w.defineProperty(D, { rI: "initialViewportSpot" }, function () { return this.Lv }, function (a) { var b = this.Lv; b !== a && (w.G(a, L, D, "initialViewportSpot"), a.Xc() || w.k("initialViewportSpot must be a specific Spot: " + a), this.Lv = a, this.h("initialViewportSpot", b, a)) }); w.defineProperty(D, { oI: "initialDocumentSpot" }, function () { return this.Iv }, function (a) { var b = this.Iv; b !== a && (w.G(a, L, D, "initialDocumentSpot"), a.Xc() || w.k("initialViewportSpot must be a specific Spot: " + a), this.Iv = a, this.h("initialDocumentSpot", b, a)) }); w.defineProperty(D, { Ah: "minScale" }, function () { return this.bw }, function (a) { w.vd(a, D, "minScale"); var b = this.bw; b !== a && (0 < a ? (this.bw = a, this.h("minScale", b, a), a > this.scale && (this.scale = a)) : w.Fa(a, "> 0", D, "minScale")) }); w.defineProperty(D, { zh: "maxScale" }, function () { return this.$v }, function (a) { w.vd(a, D, "maxScale"); var b = this.$v; b !== a && (0 < a ? (this.$v = a, this.h("maxScale", b, a), a < this.scale && (this.scale = a)) : w.Fa(a, "> 0", D, "maxScale")) }); w.defineProperty(D, { mm: "zoomPoint" }, function () { return this.Mw }, function (a) { this.Mw.L(a) || (w.G(a, z, D, "zoomPoint"), this.Mw = a = a.S()) }); w.defineProperty(D, { $z: "contentAlignment" }, function () { return this.so }, function (a) { var b = this.so; b.L(a) || (w.G(a, L, D, "contentAlignment"), this.so = a = a.S(), this.h("contentAlignment", b, a), Ol(this, !1)) }); w.defineProperty(D, { bL: "initialContentAlignment" }, function () { return this.Lo }, function (a) { var b = this.Lo; b.L(a) || (w.G(a, L, D, "initialContentAlignment"), this.Lo = a = a.S(), this.h("initialContentAlignment", b, a)) }); w.defineProperty(D, { padding: "padding" }, function () { return this.gf }, function (a) { "number" === typeof a ? a = new db(a) : w.G(a, db, D, "padding"); var b = this.gf; b.L(a) || (this.gf = a = a.S(), this.sc(), this.h("padding", b, a)) }); w.u(D, { gg: "nodes" }, function () { return this.ep.i }); w.u(D, { links: "links" }, function () { return this.Yo.i }); w.u(D, { Kk: "parts" }, function () { return this.zb.i }); D.prototype.findTopLevelNodesAndLinks = function () { for (var a = new I(T), b = this.ep.i; b.next();) { var c = b.value; c.$p && a.add(c) } for (b = this.Yo.i; b.next();)c = b.value, c.$p && a.add(c); return a.i }; D.prototype.findTopLevelGroups = function () { return this.zl.i }; w.defineProperty(D, { Tb: "layout" }, function () { return this.ke }, function (a) { var b = this.ke; b !== a && (w.G(a, sg, D, "layout"), null !== b && (b.g = null, b.group = null), this.ke = a, a.g = this, a.group = null, this.dv = !0, this.h("layout", b, a), this.Me()) }); D.prototype.layoutDiagram = function (a) { Hi(this); a && qn(this, !0); cm(this, !1) }; function qn(a, b) { for (var c = a.zl.i; c.next();)yn(a, c.value, b); null !== a.Tb && (b ? a.Tb.Cf = !1 : a.Tb.J()) } function yn(a, b, c) { if (null !== b) { for (var d = b.bp.i; d.next();)yn(a, d.value, c); null !== b.Tb && (c ? b.Tb.Cf = !1 : b.Tb.J()) } } function cm(a, b) { if (!a.Sy) { var c = a.Tb, d = a.Ta; a.Ta = !0; try { var e = a.oa.Jh; 0 === e && a.Pb("Layout"); var f = a.Oa; 1 !== a.oa.Jh || f.mf || f.qc || b || f.Un("Layout"); for (var h = a.zl.i; h.next();)zn(a, h.value, b); c.Cf || b && !c.vF && 0 !== e || (c.doLayout(a), Hi(a), c.Cf = !0) } finally { 0 === e && a.wd("Layout"), a.dv = !c.Cf, a.Ta = d } } } function zn(a, b, c) { if (null !== b) { for (var d = b.bp.i; d.next();)zn(a, d.value, c); d = b.Tb; null === d || d.Cf || c && !d.vF || (b.Sn = !b.location.I(), d.doLayout(b), b.J(An), d.Cf = !0, Bm(a, b)) } } w.defineProperty(D, { Sd: "isTreePathToChildren" }, function () { return this.Rv }, function (a) { var b = this.Rv; if (b !== a && (w.j(a, "boolean", D, "isTreePathToChildren"), this.Rv = a, this.h("isTreePathToChildren", b, a), !this.oa.ab)) for (a = this.gg; a.next();)Bn(a.value) }); D.prototype.findTreeRoots = function () { for (var a = new H(U), b = this.gg; b.next();) { var c = b.value; c.$p && null === c.yn() && a.add(c) } return a.i }; w.defineProperty(D, { AB: "treeCollapsePolicy" }, function () { return this.Hw }, function (a) { var b = this.Hw; b !== a && (a !== ul && a !== Ym && a !== Zm && w.k("Unknown Diagram.treeCollapsePolicy: " + a), this.Hw = a, this.h("treeCollapsePolicy", b, a)) }); w.defineProperty(D, { yh: null }, function () { return this.NC }, function (a) { this.NC = a }); function tl(a) { function b(a) { var b = a.toLowerCase(), h = new H("function"); c.add(a, h); c.add(b, h); d.add(a, a); d.add(b, a) } var c = new la("string", H), 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.Uy = c; a.Ty = d } function oa(a, b) { var c = a.Ty.ja(b); return null !== c ? c : a.Ty.ja(b.toLowerCase()) } function Cn(a, b) { var c = a.Uy.ja(b); if (null !== c) return c; c = a.Uy.ja(b.toLowerCase()); if (null !== c) return c; w.k("Unknown DiagramEvent name: " + b); return null } D.prototype.addDiagramListener = D.prototype.Nw = function (a, b) { w.j(a, "string", D, "addDiagramListener:name"); w.j(b, "function", D, "addDiagramListener:listener"); var c = Cn(this, a); null !== c && c.add(b) }; D.prototype.removeDiagramListener = D.prototype.$A = function (a, b) { w.j(a, "string", D, "removeDiagramListener:name"); w.j(b, "function", D, "addDiagramListener:listener"); var c = Cn(this, a); null !== c && c.remove(b) }; D.prototype.raiseDiagramEvent = D.prototype.Aa = function (a, b, c) { var d = Cn(this, a), e = new Df; e.g = this; a = oa(this, a); null !== a && (e.name = a); void 0 !== b && (e.rB = b); void 0 !== c && (e.VA = c); b = d.length; if (1 === b) d = d.ea(0), d(e); else if (0 !== b) for (c = d.gc(), a = 0; a < b; a++)d = c[a], d(e); return e.cancel }; D.prototype.isUnoccupied = D.prototype.bq = function (a, b) { void 0 === b && (b = null); return Dn(this, !1, null, b).bq(a.x, a.y, a.width, a.height) }; D.prototype.computeOccupiedArea = function () { return this.EA ? this.pb.copy() : this.Vj ? Nl(this) : this.se.copy() }; function Dn(a, b, c, d) { null === a.Fd && (a.Fd = new En); if (a.Fd.bu || a.Fd.group !== c || a.Fd.qB !== d) { if (null === c) { b = a.computeOccupiedArea(); b.zf(100, 100); a.Fd.initialize(b); b = w.If(); for (var e = a.gg; e.next();) { var f = e.value, h = f.layer; null !== h && h.visible && !h.Mc && Fn(a, f, d, b) } } else for (c.Y.I() || c.af(), b = c.Y.copy(), b.zf(20, 20), a.Fd.initialize(b), b = w.If(), e = c.Oc; e.next();)f = e.value, f instanceof U && Fn(a, f, d, b); w.Db(b); a.Fd.group = c; a.Fd.qB = d; a.Fd.bu = !1 } else b && Gn(a.Fd); return a.Fd } function Fn(a, b, c, d) { if (b !== c) if (b.isVisible() && b.Vz && !b.Af) { c = b.getAvoidableRect(d); d = a.Fd.nn; b = a.Fd.mn; for (var e = c.x + c.width, f = c.y + c.height, h = c.x; h < e; h += d) { for (var k = c.y; k < f; k += b)Hn(a.Fd, h, k); Hn(a.Fd, h, f) } for (k = c.y; k < f; k += b)Hn(a.Fd, e, k); Hn(a.Fd, e, f) } else if (b instanceof V) for (b = b.Oc; b.next();)e = b.value, e instanceof U && Fn(a, e, c, d) } D.invalidatePositionArray = D.prototype.AA = function (a) { null !== this.Fd && !this.Fd.bu && (void 0 === a && (a = null), null === a || a.Vz && !a.Af) && (this.Fd.bu = !0) }; D.prototype.simulatedMouseMove = function (a, b, c) { if (null !== Oh) { var d = Oh.g; c instanceof D || (c = null); var e = Ph; c !== e && (null !== e && e !== d && null !== e.eb.te && (Uh(e), Oh.yx = !1, e.eb.te.doSimulatedDragLeave()), Ph = c, null !== c && c !== d && null !== c.eb.te && (ni(), e = c.eb.te, Xh.contains(e) || Xh.add(e), c.eb.te.doSimulatedDragEnter())); if (null === c || c === d || !c.lE || c.hb || !c.Dp) return !1; d = c.eb.te; null !== d && (null !== a ? b = c.Ar(a) : null === b && (b = new z), c.Rb.da = b, c.Rb.Pl = !1, c.Rb.up = !1, d.doSimulatedDragOver()); return !0 } return !1 }; D.prototype.simulatedMouseUp = function (a, b, c, d) { if (null !== Oh) { null === d && (d = b); b = Ph; var e = Oh.g; if (d !== b) { if (null !== b && b !== e && null !== b.eb.te) return Uh(b), Oh.yx = !1, b.eb.te.doSimulatedDragLeave(), !1; Ph = d; null !== d && null !== d.eb.te && (ni(), b = d.eb.te, Xh.contains(b) || Xh.add(b), d.eb.te.doSimulatedDragEnter()) } if (null === d) return Oh.doCancel(), !0; if (d !== this) return null !== a && (c = d.Ar(a)), d.Rb.da = c, d.Rb.Pl = !1, d.Rb.up = !0, a = d.eb.te, null !== a && a.doSimulatedDrop(), a = Oh, null !== a && (d = a.mayCopy(), a.Kf = d ? "Copy" : "Move", a.stopTool()), !0 } return !1 }; w.defineProperty(D, { AK: "autoScrollInterval" }, function () { return this.Nq }, function (a) { var b = this.Nq; w.vd(a, D, "scale"); b !== a && (this.Nq = a, this.h("autoScrollInterval", b, a)) }); w.defineProperty(D, { rE: "autoScrollRegion" }, function () { return this.fv }, function (a) { "number" === typeof a ? a = new db(a) : w.G(a, db, D, "autoScrollRegion"); var b = this.fv; b.L(a) || (this.fv = a = a.S(), this.sc(), this.h("autoScrollRegion", b, a)) }); D.prototype.doAutoScroll = D.prototype.iA = function (a) { this.ev.assign(a); In(this, this.ev).Kc(this.position) ? Uh(this) : Jn(this) }; function Jn(a) { -1 === a.no && (a.no = w.setTimeout(function () { if (-1 !== a.no) { Uh(a); var b = a.R.event; if (null !== b) { var c = In(a, a.ev); c.Kc(a.position) || (a.position = c, a.R.da = a.zB(a.ev), a.simulatedMouseMove(b, null, b.target.$) || a.doMouseMove(), a.Vj = !0, Rl(a, a.uh()), a.Ce = !0, a.ag(), Jn(a)) } } }, a.Nq)) } function Uh(a) { -1 !== a.no && (w.clearTimeout(a.no), a.no = -1) } function In(a, b) { var c = a.position, d = a.rE; if (0 >= d.top && 0 >= d.left && 0 >= d.right && 0 >= d.bottom) return c; var e = a.pb, f = a.scale, e = w.jg(0, 0, e.width * f, e.height * f), h = w.xb(0, 0); if (b.x >= e.x && b.x < e.x + d.left) { var k = Math.max(a.Fu, 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.Fu, 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.Gu, 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.Gu, 1), k |= 0, h.y += k, b.y > e.y + e.height - d.bottom / 2 && (h.y += k), b.y > e.y + e.height - d.bottom / 4 && (h.y += 4 * k)); h.Kc(ed) || (c = new z(c.x + h.x / f, c.y + h.y / f)); w.Db(e); w.v(h); return c } D.prototype.makeSvg = D.prototype.makeSVG = function (a) { void 0 === a && (a = new sa); a.context = "svg"; a = Kn(this, a); return null !== a ? a.hm : null }; D.prototype.makeImage = function (a) { void 0 === a && (a = new sa); var b = (a.document || document).createElement("img"); b.src = this.OI(a); return b }; D.prototype.makeImageData = D.prototype.OI = function (a) { void 0 === a && (a = new sa); var b = Kn(this, a); if (null !== b) { var c = a.returnType, c = void 0 === c ? "string" : c.toLowerCase(); switch (c) { case "imagedata": return b.xk.getImageData(0, 0, b.width, b.height); case "blob": b = b.Jd; c = a.callback; if ("function" !== typeof c) { w.k('Error: Diagram.makeImageData called with "returnType: toBlob", but no "callback" function property defined.'); break } if ("function" === typeof b.toBlob) return b.toBlob(c, a.type, a.details), "toBlob"; if ("function" === typeof b.msToBlob) return c(b.msToBlob()), "msToBlob"; c(null); break; default: return b.toDataURL(a.type, a.details) } } return "" }; var Ln = !1; function Kn(a, b) { a.Oa.Hh(); a.ag(); if (null === a.Fb) return null; "object" !== typeof b && w.k("properties argument must be an Object."); var c = !1, d = b.size || null, e = b.scale || null; void 0 !== b.scale && isNaN(b.scale) && (e = "NaN"); var f = b.maxSize; void 0 === b.maxSize && (c = !0, f = "svg" === b.context ? new ia(Infinity, Infinity) : new ia(2E3, 2E3)); var h = b.position || null, k = b.parts || null, l = void 0 === b.padding ? 1 : b.padding, m = b.background || null, n = b.omitTemporary; void 0 === n && (n = !0); var p = b.document || document, q = b.elementFinished || null, r = b.showTemporary; void 0 === r && (r = !n); n = b.showGrid; void 0 === n && (n = r); null !== d && isNaN(d.width) && isNaN(d.height) && (d = null); "number" === typeof l ? l = new db(l) : l instanceof db || (l = new db(0)); l.left = Math.max(l.left, 0); l.right = Math.max(l.right, 0); l.top = Math.max(l.top, 0); l.bottom = Math.max(l.bottom, 0); a.qf.Fe(!0); var s = new Wc(null, p), u = s.xk; if (!(d || e || k || h)) { s.width = a.Ib + Math.ceil(l.left + l.right); s.height = a.Lb + Math.ceil(l.top + l.bottom); if ("svg" === b.context) return u = new Oc(s.Jd, p, q), Im(a, u, l, new ia(s.width, s.height), a.ub, a.jb, k, m, r, n), u; a.pr = !1; Im(a, u, l, new ia(s.width, s.height), a.ub, a.jb, k, m, r, n); a.pr = !0; return s } var t = a.ob.ex, x = new z(0, 0), v = a.se.copy(); v.MJ(a.padding); if (r) for (var A = !0, A = a.cc.n, y = A.length, K = 0; K < y; K++) { var E = A[K]; if (E.visible && E.Mc) for (var E = E.zb.n, Q = E.length, X = 0; X < Q; X++) { var O = E[X]; O.DA && O.isVisible() && (O = O.Y, O.I() && v.Kh(O)) } } x.x = v.x; x.y = v.y; if (null !== k) { var aa, A = !0, y = k.i; for (y.reset(); y.next();)O = y.value, O instanceof T && (E = O.layer, null !== E && !E.visible || null !== E && !r && E.Mc || !O.isVisible() || (O = O.Y, O.I() && (A ? (A = !1, aa = O.copy()) : aa.Kh(O)))); A && (aa = new B(0, 0, 0, 0)); v.width = aa.width; v.height = aa.height; x.x = aa.x; x.y = aa.y } null !== h && h.I() && (x = h, e || (e = t)); A = O = 0; null !== l && (O = l.left + l.right, A = l.top + l.bottom); K = y = 0; null !== d && (y = d.width, K = d.height, isFinite(y) && (y = Math.max(0, y - O)), isFinite(K) && (K = Math.max(0, K - A))); aa = h = 0; null !== d && null !== e ? ("NaN" === e && (e = t), d.I() ? (h = y, aa = K) : isNaN(K) ? (h = y, aa = v.height * e) : (h = v.width * e, aa = K)) : null !== d ? d.I() ? (e = Math.min(y / v.width, K / v.height), h = y, aa = K) : isNaN(K) ? (e = y / v.width, h = y, aa = v.height * e) : (e = K / v.height, h = v.width * e, aa = K) : null !== e ? "NaN" === e && f.I() ? (e = Math.min((f.width - O) / v.width, (f.height - A) / v.height), e > t ? (e = t, h = v.width, aa = v.height) : (h = f.width, aa = f.height)) : (h = v.width * e, aa = v.height * e) : (e = t, h = v.width, aa = v.height); null !== l ? (h += O, aa += A) : l = new db(0); null !== f && (d = f.width, f = f.height, "svg" !== b.context && c && !Ln && (h > d || aa > f) && (w.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. (" + Math.ceil(h) + "x" + Math.ceil(aa) + " vs 2000x2000) Consider increasing the max size."), Ln = !0), isNaN(d) && (d = 2E3), isNaN(f) && (f = 2E3), isFinite(d) && (h = Math.min(h, d)), isFinite(f) && (aa = Math.min(aa, f))); s.width = Math.ceil(h); s.height = Math.ceil(aa); if ("svg" === b.context) return u = new Oc(s.Jd, p, q), Im(a, u, l, new ia(Math.ceil(h), Math.ceil(aa)), e, x, k, m, r, n), u; a.pr = !1; Im(a, u, l, new ia(Math.ceil(h), Math.ceil(aa)), e, x, k, m, r, n); a.pr = !0; return s } D.inherit = function (a, b) { w.j(a, "function", D, "inherit"); w.j(b, "function", D, "inherit"); b.WG && w.k("Cannot inherit from " + w.kf(b)); w.Ka(a, b) }; function Cl() { this.KD = null; this.YG = "63ad05bbe23a1786468a4c741b6d2"; this.Ii = this.YG === this._tk ? !0 : null } function Mn(a) { var b = "f", c = window[w.Lg("76a715b2f73f148a")][w.Lg("72ba13b5")], d = w.Lg; if (window[d("7da7")] && window[d("7da7")][d("76a115b6ed251eaf4692")]) { a.Ii = !0; var e = window[d("7da7")][d("76a115b6ed251eaf4692")], e = d(e).split(d("39e9")); if (6 > e.length) return; var f = d(e[1]).split("."); if ("7da71ca0" !== e[4]) return; var h = d(w[d("6cae19")]).split("."); if (f[0] > h[0] || f[0] === h[0] && f[1] >= h[1]) { f = c[d("76ad18b4f73e")]; for (h = c[d("73a612b6fb191d")](d("35e7")) + 2; h < f; h++)b += c[h]; f = b[d("73a612b6fb191d")](d(e[2])); 0 > f && d(e[2]) !== d("7da71ca0ad381e90") && (f = b[d("73a612b6fb191d")](d("76a715b2ef3e149757"))); 0 > f && (f = b[d("73a612b6fb191d")](d("76a715b2ef3e149757"))); a.Ii = !(0 <= f && f < b[d("73a612b6fb191d")](d("35"))); if (!a.Ii) return } else return } f = c[d("76ad18b4f73e")]; for (h = c[d("73a612b6fb191d")](d("35e7")) + 2; h < f; h++)b += c[h]; f = b[d("73a612b6fb191d")](d(w.adym)); 0 > f && d(w.adym) !== d("7da71ca0ad381e90") && (f = b[d("73a612b6fb191d")](d("76a715b2ef3e149757"))); a.Ii = !(0 <= f && f < b[d("73a612b6fb191d")](d("35"))); a.Ii && (b = window.document[d("79ba13b2f7333e8846865a7d00")]("div"), c = d("02cncncn"), "." === c[0] && (c = c[d("69bd14a0f724128a44")](1)), b[d("79a417a0f0181a8946")] = c, window.document[d("78a712aa")] ? (window.document[d("78a712aa")][d("7bb806b6ed32388c4a875b")](b), c = window[d("7dad0290ec3b0b91578e5b40007031bf")](b)[d("7dad0283f1390b81519f4645156528bf")](d("78a704b7e62456904c9b12701b6532a8")), window.document[d("78a712aa")][d("68ad1bbcf533388c4a875b")](b), c && -1 !== c.indexOf(d(w.tH)) && -1 !== c.indexOf(d(w.uH)) && (a.Ii = !1)) : (a.Ii = null, a.Ii = !1)) } Cl.prototype.lm = function (a) { a.qf.setTransform(a.Dd, 0, 0, a.Dd, 0, 0); null === this.Ii && Mn(this); return 0 < this.Ii && this !== this.KD ? !0 : !1 }; Cl.prototype.t = function () { this.KD = null }; function Dl(a, b) { void 0 !== b && null !== b || w.k("Diagram setup requires an argument DIV."); null !== a.Mb && w.k("Diagram has already completed setup."); "string" === typeof b ? a.Mb = window.document.getElementById(b) : b instanceof HTMLDivElement ? a.Mb = b : w.k("No DIV or DIV id supplied: " + b); null === a.Mb && w.k("Invalid DIV id; could not get element with id: " + b); void 0 !== a.Mb.$ && w.k("Invalid div id; div already has a Diagram associated with it."); "static" === window.getComputedStyle(a.Mb, null).position && (a.Mb.style.position = "relative"); a.Mb.style["-webkit-tap-highlight-color"] = "rgba(255, 255, 255, 0)"; a.Mb.style["-ms-touch-action"] = "none"; a.Mb.innerHTML = ""; a.Mb.$ = a; var c = new Wc(a); c.Jd.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.Mb, null).getPropertyValue("direction") && (a.Mr = !0), c.style.zIndex = "2", c.style.XL = "none", c.style.webkitUserSelect = "none", c.style.MozUserSelect = "none"); a.Ib = a.Mb.clientWidth || 1; a.Lb = a.Mb.clientHeight || 1; a.Fb = c; a.qf = c.xk; var d = a.qf; a.jD = (window.devicePixelRatio || 1) / (d.ta.webkitBackingStorePixelRatio || d.ta.mozBackingStorePixelRatio || d.ta.msBackingStorePixelRatio || d.ta.oBackingStorePixelRatio || d.ta.backingStorePixelRatio || 1); a.Dd = a.computePixelRatio(); Km(a, a.Ib, a.Lb); a.wv = d[w.Lg("7eba17a4ca3b1a8346")][w.Lg("78a118b7")](d, w.lm, 4, 4); a.Mb.insertBefore(c.Jd, a.Mb.firstChild); c = new Wc(null); c.width = 1; c.height = 1; a.Xy = c; a.DC = c.xk; var c = w.createElement("div"), e = w.createElement("div"); c.style.position = "absolute"; c.style.overflow = "auto"; c.style.width = a.Ib + "px"; c.style.height = a.Lb + "px"; c.style.zIndex = "1"; e.style.position = "absolute"; e.style.width = "1px"; e.style.height = "1px"; a.Mb.appendChild(c); c.appendChild(e); c.onscroll = Jl; c.onmousedown = Ll; c.ontouchstart = Ll; c.$ = a; c.UG = !0; c.VG = !0; a.ww = c; a.Ss = e; a.Xx = w.AE(function () { a.kk = null; a.na() }, 300, !1); a.EB = w.AE(function () { Sk(a) }, 250, !1); a.preventDefault = function (a) { a.preventDefault(); return !1 }; a.Pn = function (b) { if (a.isEnabled) { a.Dm = !0; var c = a.Vc; w.Fn && c.vj ? (b.preventDefault(), b.simulated = !0, a.at = b) : (a.Vc = a.Rb, a.Rb = c, Ul(a, a, b, c, !0), a.simulatedMouseMove(b, null, b.target.$) || (a.doMouseMove(), a.$a.isBeyondDragSize() && (a.ml = 0), Yl(c, b))) } }; a.On = function (b) { if (a.isEnabled) { a.Dm = !0; var c = a.Vc; if (w.Fn && null !== a.at) a.at = b, b.preventDefault(); else if (w.Fn && 400 > b.timeStamp - a.Hm) b.preventDefault(); else if (a.jl) b.preventDefault(); else { a.Vc = a.Rb; a.Rb = c; Ul(a, a, b, c, !0); c.Pl = !0; c.Ge = b.detail; if (w.oF || w.pF) b.timeStamp - a.Hm < a.XD && !a.$a.isBeyondDragSize() ? a.ml++ : a.ml = 1, a.Hm = b.timeStamp, c.Ge = a.ml; a.Ki = c; !0 === c.vr.simulated ? (b.preventDefault(), b.simulated = !0) : (Oh = null, a.doMouseDown(), a.Ki = a.Ki.copy(), 1 === b.button ? b.preventDefault() : Yl(c, b)) } } }; a.Rn = function (b) { if (a.isEnabled) if (a.jl && 2 === b.button) b.preventDefault(); else if (a.jl && 0 === b.button && (a.jl = !1), a.it) b.preventDefault(); else { a.Dm = !0; var c = a.Vc; if (w.Fn) { if (400 > b.timeStamp - a.Hm) { b.preventDefault(); return } a.Hm = b.timeStamp } if (w.Fn && null !== a.at) a.at = null, b.preventDefault(); else { a.Vc = a.Rb; a.Rb = c; Ul(a, a, b, c, !0); c.up = !0; c.Ge = b.detail; if (w.oF || w.pF) c.Ge = a.ml; c.bubbles = b.bubbles; b.target.$ && (c.Yg = b.target.$); a.simulatedMouseUp(b, null, new z, c.Yg) || (a.doMouseUp(), Uh(a), Yl(c, b)) } } }; a.Rg = function (b) { if (a.isEnabled) { var c = a.Vc; a.Vc = a.Rb; a.Rb = c; Ul(a, a, b, c, !0); c.bubbles = !0; c.Ol = void 0 !== b.wheelDelta ? b.wheelDelta : -40 * b.detail; a.doMouseWheel(); Yl(c, b) } }; a.Qn = function () { if (a.isEnabled) { a.Dm = !1; var b = a.$a; b.cancelWaitAfter(); b instanceof hh && b.hideToolTip() } }; a.yB = function (b) { if (a.isEnabled) { a.it = !1; a.jl = !0; var c = a.Vc; a.Vc = a.Rb; a.Rb = c; Wl(a, b, b.targetTouches[0], c, 1 < b.touches.length); a.doMouseDown(); Yl(c, b) } }; a.xB = function (b) { if (a.isEnabled) { var c = a.Vc; a.Vc = a.Rb; a.Rb = c; var d = null; 0 < b.changedTouches.length ? d = b.changedTouches[0] : 0 < b.targetTouches.length && (d = b.targetTouches[0]); Xl(a, b, d, c, 1 < b.touches.length); a.simulatedMouseMove(d ? d : b, null, c.Yg) || a.doMouseMove(); Yl(c, b) } }; a.wB = function (b) { if (a.isEnabled) if (a.it) b.preventDefault(); else { var c = a.Vc; a.Vc = a.Rb; a.Rb = c; if (!(1 < b.touches.length)) { var d = null, e = null; 0 < b.changedTouches.length ? e = b.changedTouches[0] : 0 < b.targetTouches.length && (e = b.targetTouches[0]); c.g = a; c.Ge = 1; if (null !== e) { d = window.document.elementFromPoint(e.clientX, e.clientY); null !== d && d.$ instanceof D && d.$ !== a && Vl(d.$, e, c); Vl(a, b.changedTouches[0], c); var m = e.screenX, n = e.screenY, p = a.$C; b.timeStamp - a.Hm < a.XD && !(25 < Math.abs(p.x - m) || 25 < Math.abs(p.y - n)) ? a.ml++ : a.ml = 1; c.Ge = a.ml; a.Hm = b.timeStamp; a.$C.m(m, n) } c.zd = 0; c.button = 0; c.buttons = 1; c.Pl = !1; c.up = !0; c.Ol = 0; c.Cc = !1; c.bubbles = !1; c.event = b; c.timestamp = Date.now(); c.Yg = null === d ? b.target.$ : d.$ ? d.$ : null; c.Qe = null; a.simulatedMouseUp(e ? e : b, null, new z, c.Yg) || a.doMouseUp(); Yl(c, b); a.jl = !1 } } }; a.MF = function (b) { if ("touch" === b.pointerType) { var c = a.vD; void 0 === c[b.pointerId] && (a.ow++ , c[b.pointerId] = b); a.$i[0] = null; a.$i[1] = null; for (var d in c) if (null === a.$i[0]) a.$i[0] = c[d]; else if (null === a.$i[1]) { a.$i[1] = c[d]; break } a.isEnabled && (a.it = !1, a.jl = !0, c = a.Vc, a.Vc = a.Rb, a.Rb = c, Wl(a, b, b, c, 1 < a.ow), a.doMouseDown(), Yl(c, b)) } }; a.OF = function (b) { if ("touch" === b.pointerType && !(2 > a.ow)) { var c = a.$i; c[0].pointerId === b.pointerId && (c[0] = b); c[1].pointerId === b.pointerId && (c[1] = b); a.isEnabled && (c = a.Vc, a.Vc = a.Rb, a.Rb = c, Xl(a, b, b, c, !0), a.simulatedMouseMove(b, null, c.Yg) || (a.doMouseMove(), Yl(c, b))) } }; a.NF = function (b) { if ("touch" === b.pointerType) { var c = a.vD; void 0 !== c[b.pointerId] && (a.ow-- , delete c[b.pointerId], c = a.$i, null !== c[0] && c[0].pointerId === b.pointerId && (c[0] = null), null !== c[1] && c[1].pointerId === b.pointerId && (c[1] = null)) } }; d.Fe(!0); Gl(a) } function Nn(a) { 1 < arguments.length && w.k("Palette constructor can only take one optional argument, the DIV HTML element or its id."); D.call(this, a); this.At = !0; this.Fl = !1; this.hb = !0; this.$z = yb; this.Tb = new On } w.Ka(Nn, D); w.ga("Palette", Nn); function zl(a) { 1 < arguments.length && w.k("Overview constructor can only take one optional argument, the DIV HTML element or its id."); D.call(this, a); this.Oa.isEnabled = !1; this.Tc = !0; this.gk = null; this.xv = !0; this.FJ("drawShadows", !1); var b = new T, c = new Y; c.stroke = "magenta"; c.lb = 2; c.fill = "transparent"; c.name = "BOXSHAPE"; b.dm = !0; b.gB = "BOXSHAPE"; b.HA = "BOXSHAPE"; b.$F = "BOXSHAPE"; b.cursor = "move"; b.add(c); this.tm = b; c = new jh; c.type = Mj; c.Ef = Hb; var d = new Nj; d.Yf = !0; c.add(d); d = new Y; d.qh = Hb; d.Cb = "Rectangle"; d.Ca = new ia(64, 64); d.cursor = "se-resize"; d.alignment = Nb; c.add(d); b.YF = c; this.hn = this.tk = !1; this.vf = this.Ct = !0; this.rE = new db(0, 0, 0, 0); this.Iz = new Wc(null); this.XG = this.Iz.xk; this.eb.te = new Pn; this.eb.aG = new Qn; var e = this; this.click = function () { var a = e.gk; if (null !== a) { var b = a.pb, c = e.R.da; a.position = new z(c.x - b.width / 2, c.y - b.height / 2) } }; this.JF = function () { Rn(e) }; this.IF = function () { null !== e.gk && (e.sc(), e.na()) }; this.Hl = Sl; this.Tc = !1 } w.Ka(zl, D); w.ga("Overview", zl); function Sn(a) { a.Tc || a.$d || !1 !== a.Sf || (a.Sf = !0, requestAnimationFrame(function () { if (a.Sf && !a.$d && (a.Sf = !1, null !== a.Mb)) { a.$d = !0; Hi(a); a.se.I() || Rl(a, a.uh()); null === a.Mb && w.k("No div specified"); null === a.Fb && w.k("No canvas specified"); if (a.Ce) { var b = a.gk; if (null !== b && !b.Oa.mf && !b.Oa.qc) { var b = a.qf, c = a.Iz; b.setTransform(1, 0, 0, 1, 0, 0); b.clearRect(0, 0, a.Fb.width, a.Fb.height); b.drawImage(c.Jd, 0, 0); c = a.fd; c.reset(); 1 !== a.scale && c.scale(a.scale); 0 === a.position.x && 0 === a.position.y || c.translate(-a.position.x, -a.position.y); b.scale(a.Dd, a.Dd); b.transform(c.m11, c.m12, c.m21, c.m22, c.dx, c.dy); for (var c = a.cc.n, d = c.length, e = 0; e < d; e++)c[e].ue(b, a); a.il = !1; a.Ce = !1 } } a.$d = !1 } })) } zl.prototype.computePixelRatio = function () { return 1 }; zl.prototype.ue = function () { null === this.Mb && w.k("No div specified"); null === this.Fb && w.k("No canvas specified"); if (this.Ce) { var a = this.gk; if (null !== a && !a.Oa.mf) { Fm(this); var b = a.Dn; (null !== b && b.visible && isNaN(b.width) || isNaN(b.height)) && bm(a); var c = this.Fb, b = this.qf, d = this.Iz, e = this.XG; d.width = c.width; d.height = c.height; b.Fe(!0); b.setTransform(1, 0, 0, 1, 0, 0); b.clearRect(0, 0, c.width, c.height); d = this.fd; d.reset(); 1 !== this.scale && d.scale(this.scale); 0 === this.position.x && 0 === this.position.y || d.translate(-this.position.x, -this.position.y); b.scale(this.Dd, this.Dd); b.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy); for (var d = this.xv, f = this.pb, h = a.cc.n, k = h.length, a = 0; a < k; a++) { var l = h[a], m = b, n = f, p = d; if (l.visible && 0 !== l.yc && (void 0 === p && (p = !0), p || !l.Mc)) { 1 !== l.yc && (m.globalAlpha = l.yc); for (var p = this.scale, l = l.zb.n, q = l.length, r = 0; r < q; r++) { var s = l[r], u = s.Y; u.Wf(n) && (1 < u.width * p || 1 < u.height * p ? s.ue(m, this) : ll(s, m)) } m.globalAlpha = 1 } } e.drawImage(c.Jd, 0, 0); c = this.cc.n; e = c.length; for (a = 0; a < e; a++)c[a].ue(b, this); this.Ce = this.il = !1 } } }; w.defineProperty(zl, { UA: "observed" }, function () { return this.gk }, function (a) { var b = this.gk; null !== a && w.G(a, D, zl, "observed"); a instanceof zl && w.k("Overview.observed Diagram may not be an Overview itself: " + a); b !== a && (null !== b && (this.remove(this.th), b.$A("ViewportBoundsChanged", this.JF), b.$A("DocumentBoundsChanged", this.IF), b.lw.remove(this)), this.gk = a, null !== a && (a.Nw("ViewportBoundsChanged", this.JF), a.Nw("DocumentBoundsChanged", this.IF), a.lw.add(this), this.add(this.th), Rn(this)), this.sc(), this.h("observed", b, a)) }); w.defineProperty(zl, { th: "box" }, function () { return this.tm }, function (a) { var b = this.tm; b !== a && (this.tm = a, this.remove(b), this.add(this.tm), Rn(this), this.h("box", b, a)) }); w.defineProperty(zl, { VK: "drawsTemporaryLayers" }, function () { return this.xv }, function (a) { this.xv !== a && (this.xv = a, this.Wx()) }); function Rn(a) { var b = a.th; if (null !== b) { var c = a.gk; if (null !== c) { a.Ce = !0; var c = c.pb, d = b.Hu, e = w.jm(); e.m(c.width, c.height); d.Ca = e; w.Bk(e); a = 2 / a.scale; d instanceof Y && (d.lb = a); b.location = new z(c.x - a / 2, c.y - a / 2) } } } zl.prototype.uh = function () { var a = this.gk; return null === a ? fd : a.se }; zl.prototype.jF = function () { !0 !== this.Ce && (this.Ce = !0, Sn(this)) }; zl.prototype.xu = function (a, b, c, d, e) { this.Tc || (Ml(this), this.na(), Zl(this), this.sc(), Rn(this), this.ph.scale = c, this.ph.position.x = a.x, this.ph.position.y = a.y, this.ph.bounds.set(a), this.ph.isScroll = e, this.Aa("ViewportBoundsChanged", this.ph, a)) }; function Pn() { nh.call(this); this.sl = null } w.Ka(Pn, nh); Pn.prototype.canStart = function () { if (!this.isEnabled) return !1; var a = this.g; if (null === a || !a.Fl || !a.vf) return !1; var b = a.UA; if (null === b) return !1; if (null === this.findDraggablePart()) { var c = b.pb; this.sl = new z(c.width / 2, c.height / 2); a = a.Bc.da; b.position = new z(a.x - this.sl.x, a.y - this.sl.y) } return !0 }; Pn.prototype.doActivate = function () { this.sl = null; nh.prototype.doActivate.call(this) }; Pn.prototype.moveParts = function () { var a = this.g, b = a.UA; if (null !== b) { var c = a.th; if (null !== c) { if (null === this.sl) { var d = a.Bc.da, c = c.location; this.sl = new z(d.x - c.x, d.y - c.y) } a = a.R.da; b.position = new z(a.x - this.sl.x, a.y - this.sl.y) } } }; function Qn() { Lj.call(this) } w.Ka(Qn, Lj); Qn.prototype.resize = function (a) { var b = this.g.UA; if (null !== b) { var c = b.pb.copy(); b.position = a.position; (c.width !== a.width || c.height !== a.height) && 0 < a.width && 0 < a.height && (b.scale = Math.min(c.width / a.width, c.height / a.height)) } }; function Tn() { this.eg = this.Yc = this.Ad = this.Dc = 0 } function ha(a) { 1 < arguments.length && w.k("Brush constructor can take at most one optional argument, the Brush type."); w.nc(this); this.Q = !1; void 0 === a ? (this.ma = ng, this.qo = "black") : "string" === typeof a ? (this.ma = ng, this.qo = a) : (this.ma = a, this.qo = "black"); var b = this.ma; b === og ? (this.pp = yb, this.Eo = Mb) : this.Eo = b === cd ? this.pp = Hb : this.pp = tb; this.Cw = 0; this.yv = NaN; this.eh = this.nw = this.dh = null; this.My = this.ro = 0 } w.ga("Brush", ha); var ng; ha.Solid = ng = w.p(ha, "Solid", 0); var og; ha.Linear = og = w.p(ha, "Linear", 1); var cd; ha.Radial = cd = w.p(ha, "Radial", 2); var Un; ha.Pattern = Un = w.p(ha, "Pattern", 4); var Vn; ha.Lab = Vn = w.p(ha, "Lab", 5); var Wn; ha.HSL = Wn = w.p(ha, "HSL", 6); ha.prototype.copy = function () { var a = new ha; a.ma = this.ma; a.qo = this.qo; a.pp = this.pp.S(); a.Eo = this.Eo.S(); a.Cw = this.Cw; a.yv = this.yv; null !== this.dh && (a.dh = this.dh.copy()); a.nw = this.nw; return a }; g = ha.prototype; g.Ha = function () { this.freeze(); Object.freeze(this); return this }; g.freeze = function () { this.Q = !0; null !== this.dh && this.dh.freeze(); return this }; g.Qa = function () { Object.isFrozen(this) && w.k("cannot thaw constant: " + this); this.Q = !1; null !== this.dh && this.dh.Qa(); return this }; g.ic = function (a) { a.Ee === ha ? this.type = a : w.Ej(this, a) }; g.toString = function () { var a = "Brush("; if (this.type === ng) a += this.color; else if (a = this.type === og ? a + "Linear " : this.type === cd ? a + "Radial " : this.type === Un ? a + "Pattern " : a + "(unknown) ", a += this.start + " " + this.end, null !== this.uk) for (var b = this.uk.i; b.next();)a += " " + b.key + ":" + b.value; return a + ")" }; ha.prototype.addColorStop = ha.prototype.addColorStop = function (a, b) { this.Q && w.la(this); ("number" !== typeof a || !isFinite(a) || 1 < a || 0 > a) && w.Fa(a, "0 <= loc <= 1", ha, "addColorStop:loc"); w.j(b, "string", ha, "addColorStop:color"); null === this.dh && (this.dh = new la("number", "string")); this.dh.add(a, b); this.ma === ng && (this.type = og); this.eh = null }; w.defineProperty(ha, { type: "type" }, function () { return this.ma }, function (a) { this.Q && w.la(this, a); w.mb(a, ha, ha, "type"); this.ma = a; this.start.Rd() && (a === og ? this.start = yb : a === cd && (this.start = Hb)); this.end.Rd() && (a === og ? this.end = Mb : a === cd && (this.end = Hb)); this.eh = null }); w.defineProperty(ha, { color: "color" }, function () { return this.qo }, function (a) { this.Q && w.la(this, a); this.qo = a; this.eh = null }); w.defineProperty(ha, { start: "start" }, function () { return this.pp }, function (a) { this.Q && w.la(this, a); w.G(a, L, ha, "start"); this.pp = a.S(); this.eh = null }); w.defineProperty(ha, { end: "end" }, function () { return this.Eo }, function (a) { this.Q && w.la(this, a); w.G(a, L, ha, "end"); this.Eo = a.S(); this.eh = null }); w.defineProperty(ha, { Nu: "startRadius" }, function () { return this.Cw }, function (a) { this.Q && w.la(this, a); w.vd(a, ha, "startRadius"); 0 > a && w.Fa(a, ">= zero", ha, "startRadius"); this.Cw = a; this.eh = null }); w.defineProperty(ha, { Jt: "endRadius" }, function () { return this.yv }, function (a) { this.Q && w.la(this, a); w.vd(a, ha, "endRadius"); 0 > a && w.Fa(a, ">= zero", ha, "endRadius"); this.yv = a; this.eh = null }); w.defineProperty(ha, { uk: "colorStops" }, function () { return this.dh }, function (a) { this.Q && w.la(this, a); this.dh = a; this.eh = null }); w.defineProperty(ha, { pattern: "pattern" }, function () { return this.nw }, function (a) { this.Q && w.la(this, a); this.nw = a; this.eh = null }); ha.randomColor = function (a, b) { void 0 === a && (a = 128); void 0 === b && (b = Math.max(a, 255)); var c = Math.abs(b - a), d = Math.floor(a + Math.random() * c).toString(16), e = Math.floor(a + Math.random() * c).toString(16), c = Math.floor(a + Math.random() * c).toString(16); 2 > d.length && (d = "0" + d); 2 > e.length && (e = "0" + e); 2 > c.length && (c = "0" + c); return "#" + d + e + c }; var Xn = (new Wc(null)).xk, fa; ha.isValidColor = fa = function (a) { if ("black" === a) return !0; if ("" === a) return !1; Xn.fillStyle = "#000000"; var b = Xn.fillStyle; Xn.fillStyle = a; if (Xn.fillStyle !== b) return !0; Xn.fillStyle = "#FFFFFF"; b = Xn.fillStyle; Xn.fillStyle = a; return Xn.fillStyle !== b }; var Yn = new Tn, Zn = new Tn, $n = new Tn, ao = new Tn; ha.lighten = function (a) { return bo(a) }; ha.prototype.lightenBy = function (a, b) { this.Q && w.la(this); var c = void 0 === a || "number" !== typeof a ? .2 : a, d = void 0 === b ? Vn : b; if (this.type === ng) co(this.color), this.color = eo(c, d); else if ((this.type === og || this.type === cd) && null !== this.uk) for (var e = this.uk.i; e.next();)co(e.value), this.addColorStop(e.key, eo(c, d)); return this }; var bo; ha.lightenBy = bo = function (a, b, c) { b = void 0 === b || "number" !== typeof b ? .2 : b; c = void 0 === c ? Vn : c; co(a); return eo(b, c) }; ha.darken = function (a) { return fo(a) }; ha.prototype.darkenBy = function (a, b) { this.Q && w.la(this); var c = void 0 === a || "number" !== typeof a ? .2 : a, d = void 0 === b ? Vn : b; if (this.type === ng) co(this.color), this.color = eo(-c, d); else if ((this.type === og || this.type === cd) && null !== this.uk) for (var e = this.uk.i; e.next();)co(e.value), this.addColorStop(e.key, eo(-c, d)); return this }; var fo; ha.darkenBy = fo = function (a, b, c) { b = void 0 === b || "number" !== typeof b ? .2 : b; c = void 0 === c ? Vn : c; co(a); return eo(-b, c) }; function eo(a, b) { switch (b) { case Vn: var c = 100 * ho(Yn.Dc), d = 100 * ho(Yn.Ad), e = 100 * ho(Yn.Yc); $n.Dc = .4124564 * c + .3575761 * d + .1804375 * e; $n.Ad = .2126729 * c + .7151522 * d + .072175 * e; $n.Yc = .0193339 * c + .119192 * d + .9503041 * e; $n.eg = Yn.eg; c = io($n.Dc / jo[0]); d = io($n.Ad / jo[1]); e = io($n.Yc / jo[2]); ao.Dc = 116 * d - 16; ao.Ad = 500 * (c - d); ao.Yc = 200 * (d - e); ao.eg = $n.eg; ao.Dc = Math.min(100, Math.max(0, ao.Dc + 100 * a)); c = (ao.Dc + 16) / 116; d = c - ao.Yc / 200; $n.Dc = jo[0] * ko(ao.Ad / 500 + c); $n.Ad = jo[1] * (ao.Dc > lo * mo ? Math.pow(c, 3) : ao.Dc / lo); $n.Yc = jo[2] * ko(d); $n.eg = ao.eg; c = -.969266 * $n.Dc + 1.8760108 * $n.Ad + .041556 * $n.Yc; d = .0556434 * $n.Dc + -.2040259 * $n.Ad + 1.0572252 * $n.Yc; Yn.Dc = 255 * no((3.2404542 * $n.Dc + -1.5371385 * $n.Ad + -.4985314 * $n.Yc) / 100); Yn.Ad = 255 * no(c / 100); Yn.Yc = 255 * no(d / 100); Yn.eg = $n.eg; Yn.Dc = Math.round(Yn.Dc); 255 < Yn.Dc ? Yn.Dc = 255 : 0 > Yn.Dc && (Yn.Dc = 0); Yn.Ad = Math.round(Yn.Ad); 255 < Yn.Ad ? Yn.Ad = 255 : 0 > Yn.Ad && (Yn.Ad = 0); Yn.Yc = Math.round(Yn.Yc); 255 < Yn.Yc ? Yn.Yc = 255 : 0 > Yn.Yc && (Yn.Yc = 0); return "rgba(" + Yn.Dc + ", " + Yn.Ad + ", " + Yn.Yc + ", " + Yn.eg + ")"; case Wn: var e = Yn.Dc / 255, f = Yn.Ad / 255, h = Yn.Yc / 255, k = Math.max(e, f, h), d = Math.min(e, f, h), l = k - d, d = (k + d) / 2; if (0 === l) c = e = 0; else { switch (k) { case e: c = (f - h) / l % 6; break; case f: c = (h - e) / l + 2; break; case h: c = (e - f) / l + 4 }c *= 60; 0 > c && (c += 360); e = l / (1 - Math.abs(2 * d - 1)) } Zn.Dc = Math.round(c); Zn.Ad = Math.round(100 * e); Zn.Yc = Math.round(100 * d); Zn.eg = Yn.eg; Zn.Yc = Math.min(100, Math.max(0, Zn.Yc + 100 * a)); return "hsla(" + Zn.Dc + ", " + Zn.Ad + "%, " + Zn.Yc + "%, " + Zn.eg + ")"; default: return w.k("Unknown color space: " + b), "rgba(0, 0, 0, 1)" } } function co(a) { Xn.clearRect(0, 0, 1, 1); Xn.fillStyle = "#000000"; var b = Xn.fillStyle; Xn.fillStyle = a; Xn.fillStyle !== b ? (Xn.fillRect(0, 0, 1, 1), a = Xn.getImageData(0, 0, 1, 1).data, Yn.Dc = a[0], Yn.Ad = a[1], Yn.Yc = a[2], Yn.eg = a[3] / 255) : (Xn.fillStyle = "#FFFFFF", Xn.fillStyle = a, Yn.Dc = 0, Yn.Ad = 0, Yn.Yc = 0, Yn.eg = 1) } function ho(a) { a /= 255; return .04045 >= a ? a / 12.92 : Math.pow((a + .055) / 1.055, 2.4) } function no(a) { return .0031308 >= a ? 12.92 * a : 1.055 * Math.pow(a, 1 / 2.4) - .055 } var mo = 216 / 24389, lo = 24389 / 27, jo = [95.047, 100, 108.883]; function io(a) { return a > mo ? Math.pow(a, 1 / 3) : (lo * a + 16) / 116 } function ko(a) { var b = a * a * a; return b > mo ? b : (116 * a - 16) / lo } function G() { w.nc(this); this.P = 4225027; this.yc = 1; this.nh = null; this.Sb = ""; this.bc = this.Eb = null; this.jb = (new z(NaN, NaN)).freeze(); this.Se = Gd; this.Zh = rd; this.Yh = Ed; this.fd = new ja; this.pm = new ja; this.Ri = new ja; this.ub = this.Co = 1; this.lg = 0; this.Fg = oo; this.Mm = gd; this.rd = (new B(NaN, NaN, NaN, NaN)).freeze(); this.oc = (new B(NaN, NaN, NaN, NaN)).freeze(); this.Uc = (new B(0, 0, NaN, NaN)).freeze(); this.W = this.Cs = this.Ds = null; this.om = this.ie = rc; this.Ps = 0; this.bj = 1; this.Uq = 0; this.Ai = 1; this.et = null; this.Ts = -Infinity; this.Xm = 0; this.Ym = ed; this.Zm = kj; this.cr = ""; this.vc = this.ia = null; this.oo = -1; this.cn = this.og = this.al = this.op = null; this.zz = nj; this.Tm = null } w.ni(G); w.ga("GraphObject", G); G.prototype.cloneProtected = function (a) { a.P = this.P | 6144; a.yc = this.yc; a.Sb = this.Sb; a.Eb = this.Eb; a.bc = this.bc; a.jb.assign(this.jb); a.Se = this.Se.S(); a.Zh = this.Zh.S(); a.Yh = this.Yh.S(); a.Ri = this.Ri.copy(); a.ub = this.ub; a.lg = this.lg; a.Fg = this.Fg; a.Mm = this.Mm.S(); a.rd.assign(this.rd); a.oc.assign(this.oc); a.Uc.assign(this.Uc); a.Cs = this.Cs; null !== this.W && (a.W = this.W.copy()); a.ie = this.ie.S(); a.om = this.om.S(); a.Ps = this.Ps; a.bj = this.bj; a.Uq = this.Uq; a.Ai = this.Ai; a.et = this.et; a.Ts = this.Ts; a.Xm = this.Xm; a.Ym = this.Ym.S(); a.Zm = this.Zm; a.cr = this.cr; null !== this.ia && (a.ia = this.ia.copy()); a.vc = this.vc; a.oo = this.oo; null !== this.al && (a.al = w.Jl(this.al)); null !== this.og && (a.og = this.og.copy()); a.cn = this.cn }; G.prototype.addCopyProperty = G.prototype.eH = function (a) { var b = this.al; if (w.isArray(b)) for (var c = 0; c < b.length; c++) { if (b[c] === a) return } else this.al = b = []; b.push(a) }; G.prototype.oi = function (a) { a.Ds = null; a.Tm = null; a.H() }; G.prototype.clone = function () { var a = new this.constructor; this.cloneProtected(a); if (null !== this.al) for (var b = 0; b < this.al.length; b++) { var c = this.al[b]; a[c] = this[c] } return a }; G.prototype.copy = function () { return this.clone() }; G.prototype.ic = function (a) { a.Ee === W ? 0 === a.name.indexOf("Orient") ? this.qq = a : w.k("Unknown Link enum value for GraphObject.segmentOrientation property: " + a) : a.Ee === G ? this.stretch = a : w.Ej(this, a) }; G.prototype.toString = function () { return w.kf(Object.getPrototypeOf(this)) + "#" + w.Nd(this) }; var Oj; G.None = Oj = w.p(G, "None", 0); var oo; G.Default = oo = w.p(G, "Default", 0); var po; G.Vertical = po = w.p(G, "Vertical", 4); var qo; G.Horizontal = qo = w.p(G, "Horizontal", 5); var Fe; G.Fill = Fe = w.p(G, "Fill", 3); var Qj; G.Uniform = Qj = w.p(G, "Uniform", 1); var Rj; G.UniformToFill = Rj = w.p(G, "UniformToFill", 2); var ro; G.FlipVertical = ro = w.p(G, "FlipVertical", 1); var so; G.FlipHorizontal = so = w.p(G, "FlipHorizontal", 2); var to; G.FlipBoth = to = w.p(G, "FlipBoth", 3); function uo(a) { null === a.ia && (a.ia = new vo) } G.prototype.Od = function () { if (null === this.W) { var a = new wo; a.Sj = tb; a.pk = tb; a.Qj = 10; a.nk = 10; a.Pj = xo; a.mk = xo; a.Rj = 0; a.ok = 0; this.W = a } }; function yo(a, b, c, d, e, f, h) { var k = .001, l = f.length; a.moveTo(b, c); d -= b; k = e - c; 0 === d && (d = .001); e = k / d; for (var m = Math.sqrt(d * d + k * k), n = 0, p = !0, q = 0 === h ? !1 : !0; .1 <= m;) { if (q) { k = f[n++ % l]; for (k -= h; 0 > k;)k += f[n++ % l], p = !p; q = !1 } else k = f[n++ % l]; k > m && (k = m); var r = Math.sqrt(k * k / (1 + e * e)); 0 > d && (r = -r); b += r; c += e * r; p ? a.lineTo(b, c) : a.moveTo(b, c); m -= k; p = !p } } G.prototype.raiseChangedEvent = G.prototype.Zc = function (a, b, c, d, e, f, h) { var k = this.U; if (null !== k && (k.Vn(a, b, c, d, e, f, h), zo(this) && c === this && a === Of && Ao(this, k, b), c === k && 0 !== (k.P & 16777216) && null !== k.data)) for (a = this.xa.n, c = a.length, d = 0; d < c; d++)e = a[d], e instanceof C && Mm(e, function (a) { null !== a.data && 0 !== (a.P & 16777216) && a.Hb(b) }) }; function Ao(a, b, c) { var d = a.Rl(); if (null !== d) for (var e = a.vc.i; e.next();) { var f = e.value, h = null; if (null !== f.xq) { h = dh(f, d, a); if (null === h) continue; f.py(a, h, c, null) } else if (f.Dx) { var k = b.g; null === k || k.Oe || f.py(a, k.ba.Hk, c, d) } else { var l = d.data; if (null === l) continue; k = b.g; null === k || k.Oe || f.py(a, l, c, d) } h === a && (k = d.mx(f.im), null !== k && f.CG(k, h, c)) } } G.prototype.mx = function (a) { return this.oo === a ? this : null }; G.prototype.raiseChanged = G.prototype.h = function (a, b, c) { this.Zc(Of, a, this, b, c) }; function Bo(a, b, c, d, e) { var f = a.rd, h = a.Ri; h.reset(); Co(a, h, b, c, d, e); a.Ri = h; f.x = b; f.y = c; f.width = d; f.height = e; h.gu() || h.zG(f) } function Do(a, b, c, d) { if (!1 === a.Wg) return !1; d.multiply(a.transform); return c ? a.Wf(b, d) : a.rn(b, d) } G.prototype.QE = function (a, b, c) { if (!1 === this.Wg) return !1; var d = this.Ja; b = a.wf(b); var e = !1; c && (e = Ma(a.x, a.y, 0, 0, 0, d.height) < b || Ma(a.x, a.y, 0, d.height, d.width, d.height) < b || Ma(a.x, a.y, d.width, d.height, d.width, 0) < b || Ma(a.x, a.y, d.width, 0, 0, 0) < b); c || (e = Ma(a.x, a.y, 0, 0, 0, d.height) < b && Ma(a.x, a.y, 0, d.height, d.width, d.height) < b && Ma(a.x, a.y, d.width, d.height, d.width, 0) < b && Ma(a.x, a.y, d.width, 0, 0, 0) < b); return e }; G.prototype.ah = function () { return !0 }; G.prototype.containsPoint = G.prototype.Ia = function (a) { var b = w.K(); b.assign(a); this.transform.nb(b); var c = this.Y; if (!c.I()) return w.v(b), !1; var d = this.g; if (null !== d && d.jl) { var e = d.Xt("extraTouchThreshold"), f = d.Xt("extraTouchArea"), h = f / 2, k = this.Ja, d = this.pj() * d.scale, l = 1 / d; if (k.width * d < e && k.height * d < e) return a = cb(c.x - h * l, c.y - h * l, c.width + f * l, c.height + f * l, b.x, b.y), w.v(b), a } if (this instanceof jh || this instanceof Y ? cb(c.x - 5, c.y - 5, c.width + 10, c.height + 10, b.x, b.y) : c.Ia(b)) return e = !1, e = this.og && !this.og.Ia(b) ? !1 : null !== this.bc && c.Ia(b) ? !0 : null !== this.Eb && this.Uc.Ia(a) ? !0 : this.vk(a), w.v(b), e; w.v(b); return !1 }; G.prototype.vk = function (a) { var b = this.Ja; return cb(0, 0, b.width, b.height, a.x, a.y) }; G.prototype.containsRect = G.prototype.wk = function (a) { if (0 === this.angle) return this.Y.wk(a); var b = this.Ja, b = w.jg(0, 0, b.width, b.height), c = this.transform, d = !1, e = w.xb(a.x, a.y); b.Ia(c.pi(e)) && (e.m(a.x, a.bottom), b.Ia(c.pi(e)) && (e.m(a.right, a.bottom), b.Ia(c.pi(e)) && (e.m(a.right, a.y), b.Ia(c.pi(e)) && (d = !0)))); w.v(e); w.Db(b); return d }; G.prototype.containedInRect = G.prototype.rn = function (a, b) { if (void 0 === b) return a.wk(this.Y); var c = this.Ja, d = !1, e = w.xb(0, 0); a.Ia(b.nb(e)) && (e.m(0, c.height), a.Ia(b.nb(e)) && (e.m(c.width, c.height), a.Ia(b.nb(e)) && (e.m(c.width, 0), a.Ia(b.nb(e)) && (d = !0)))); w.v(e); return d }; G.prototype.intersectsRect = G.prototype.Wf = function (a, b) { if (void 0 === b && (b = this.transform, 0 === this.angle)) return a.Wf(this.Y); var c = this.Ja, d = b, e = w.xb(0, 0), f = w.xb(0, c.height), h = w.xb(c.width, c.height), k = w.xb(c.width, 0), l = !1; if (a.Ia(d.nb(e)) || a.Ia(d.nb(f)) || a.Ia(d.nb(h)) || a.Ia(d.nb(k))) l = !0; else { var c = w.jg(0, 0, c.width, c.height), m = w.xb(a.x, a.y); c.Ia(d.pi(m)) ? l = !0 : (m.m(a.x, a.bottom), c.Ia(d.pi(m)) ? l = !0 : (m.m(a.right, a.bottom), c.Ia(d.pi(m)) ? l = !0 : (m.m(a.right, a.y), c.Ia(d.pi(m)) && (l = !0)))); w.v(m); w.Db(c); !l && (oe(a, e, f) || oe(a, f, h) || oe(a, h, k) || oe(a, k, e)) && (l = !0) } w.v(e); w.v(f); w.v(h); w.v(k); return l }; G.prototype.getDocumentPoint = G.prototype.Wa = function (a, b) { void 0 === b && (b = new z); if (a instanceof L) { a.Rd() && w.k("getDocumentPoint:s Spot must be specific: " + a.toString()); var c = this.Ja; b.m(a.x * c.width + a.offsetX, a.y * c.height + a.offsetY) } else b.set(a); this.rh.nb(b); return b }; G.prototype.getDocumentAngle = G.prototype.Tl = function () { var a; a = this.rh; 1 === a.m11 && 0 === a.m12 ? a = 0 : (a = 180 * Math.atan2(a.m12, a.m11) / Math.PI, 0 > a && (a += 360)); return a }; G.prototype.getDocumentScale = G.prototype.pj = function () { if (0 !== (this.P & 4096) === !1) return this.Co; var a = this.ub; return null !== this.O ? a * this.O.pj() : a }; G.prototype.getLocalPoint = G.prototype.WE = function (a, b) { void 0 === b && (b = new z); b.assign(a); this.rh.pi(b); return b }; G.prototype.getNearestIntersectionPoint = G.prototype.XE = function (a, b, c) { return this.Bn(a.x, a.y, b.x, b.y, c) }; g = G.prototype; g.Bn = 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.kn) return f = this.Y, me(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 = me(0, 0, d.width, d.height, h, a, b, c, e); e.transform(f); return c }; function xk(a, b, c, d, e) { if (!1 !== Cm(a)) { var f = a.margin, h = f.right + f.left, f = f.top + f.bottom; b = Math.max(b - h, 0); c = Math.max(c - f, 0); e = e || 0; d = Math.max((d || 0) - h, 0); e = Math.max(e - f, 0); var h = a.angle, f = 0, f = a.Ca, k = 0; a instanceof Y && (k = a.lb); 90 === h || 270 === h ? (b = isFinite(f.height) ? f.height + k : b, c = isFinite(f.width) ? f.width + k : c) : (b = isFinite(f.width) ? f.width + k : b, c = isFinite(f.height) ? f.height + k : c); var f = d || 0, k = e || 0, l = a instanceof C; switch (Eo(a, !0)) { case Oj: k = f = 0; l && (c = b = Infinity); break; case Fe: isFinite(b) && b > d && (f = b); isFinite(c) && c > e && (k = c); break; case qo: isFinite(b) && b > d && (f = b); k = 0; l && (c = Infinity); break; case po: isFinite(c) && c > e && (k = c), f = 0, l && (b = Infinity) }var l = a.Ff, m = a.Bh; 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.rd.Qa(); a.Nn(b, c, d, e); a.rd.freeze(); a.rd.I() || w.k("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.rd.toString()); am(a, !1) } } g.Nn = function () { }; g.tj = function () { return !1 }; g.jc = function (a, b, c, d, e) { this.Li(); var f = w.If(); f.assign(this.oc); this.oc.Qa(); if (!1 === Dm(this)) { var h = this.oc; h.x = a; h.y = b; h.width = c; h.height = d } else this.jj(a, b, c, d); this.oc.freeze(); this.og = void 0 === e ? null : e; c = !1; void 0 !== e ? c = !0 : null !== this.O && (e = this.O.Uc, d = this.za, null !== this.kn && (d = this.oc), c = b + d.height, d = a + d.width, c = !(0 <= a + .05 && d <= e.width + .05 && 0 <= b + .05 && c <= e.height + .05), this instanceof Hh && (a = this.Uc, this.Zv > a.height || this.sf.Ve > a.width)) && (c = !0); this.P = c ? this.P | 256 : this.P & -257; this.oc.I() || w.k("Non-real actualBounds has been set. Object " + this + ", actualBounds: " + this.oc.toString()); this.Px(f, this.oc); Fo(this, !1); w.Db(f) }; g.jj = function () { }; function Go(a, b, c, d, e) { var f = a.Y; f.x = b; f.y = c; f.width = d; f.height = e; if (!a.Ca.I()) { f = a.rd; c = a.margin; b = c.right + c.left; var h = c.top + c.bottom; c = f.width + b; f = f.height + h; d += b; e += h; b = Eo(a, !0); c === d && f === e && (b = Oj); switch (b) { case Oj: if (c > d || f > e) am(a, !0), xk(a, c > d ? d : c, f > e ? e : f); break; case Fe: am(a, !0); xk(a, d, e, 0, 0); break; case qo: am(a, !0); xk(a, d, f, 0, 0); break; case po: am(a, !0), xk(a, c, e, 0, 0) } } } g.Px = function (a, b) { var c = this.U; null !== c && null !== c.g && (c.Hu !== this && c.ZF !== this && c.bG !== this || Ho(c, !0), this.na(), Qa(a, b) || (c.Fk(), this.us(c))) }; g.us = function (a) { null !== this.Td && (Ho(a, !0), a instanceof U && Io(a, this)) }; w.defineProperty(G, { uq: "shadowVisible" }, function () { return this.cn }, function (a) { var b = this.cn; b !== a && (this.cn = a, this.na(), this.h("shadowVisible", b, a)) }); G.prototype.ue = function (a, b) { if (this.visible) { var c = this.oc; if (0 !== c.width && 0 !== c.height && !isNaN(c.x) && !isNaN(c.y)) { var d = this.opacity, e = 1; if (1 !== d) { if (0 === d) return; e = a.globalAlpha; a.globalAlpha = e * d } if (a instanceof Oc) a: { if (this.visible) { var f = null, h = a.Fx; if (this instanceof C && (this.type === Jo || this.type === Ko)) Lo(this, a, b); else { var k = this.oc; if (0 !== k.width && 0 !== k.height && !isNaN(k.x) && !isNaN(k.y)) { var l = this.transform, m = this.O; 0 !== (this.P & 4096) === !0 && Mo(this); var c = 0 !== (this.P & 256), n = !1; this instanceof Hh && (a.font = this.font); if (c) { n = m.ah() ? m.Ja : m.Y; if (null !== this.og) var p = this.og, q = p.x, r = p.y, s = p.width, p = p.height; else q = Math.max(k.x, n.x), r = Math.max(k.y, n.y), s = Math.min(k.right, n.right) - q, p = Math.min(k.bottom, n.bottom) - r; if (q > k.width + k.x || k.x > n.width + n.x || r > k.height + k.y || k.y > n.height + n.y) break a; n = !0; Qc(a, 1, 0, 0, 1, 0, 0); a.save(); a.beginPath(); a.rect(q, r, s, p); a.clip() } if (this.tj()) { var u = this; if (!u.isVisible()) break a } a.wh.Ub = [1, 0, 0, 1, 0, 0]; q = !1; this.tj() && this.am && b.qj("drawShadows") && (r = this.bn, a.pB(r.x * b.scale * b.Dd, r.y * b.scale * b.Dd, u.Eg), a.Zn(), a.shadowColor = u.an); u = !1; this.U && b.qj("drawShadows") && (u = this.U.am); !0 === this.uq ? (a.Zn(), !1 === q && u && (Qc(a, 1, 0, 0, 1, 0, 0), a.bb(), q = !0)) : !1 === this.uq && a.Yn(); null !== this.bc && (No(this, a, this.bc, !0, !0), !1 === q && u && (Qc(a, 1, 0, 0, 1, 0, 0), a.bb(), q = !0), this.bc instanceof ha && this.bc.type === cd ? (a.beginPath(), a.rect(k.x, k.y, k.width, k.height), a.Mg(this.bc)) : a.fillRect(k.x, k.y, k.width, k.height)); this instanceof C ? Qc(a, l.m11, l.m12, l.m21, l.m22, l.dx, l.dy) : a.wh.Ub = [l.m11, l.m12, l.m21, l.m22, l.dx, l.dy]; null !== this.Eb && (!1 === q && u && (Qc(a, 1, 0, 0, 1, 0, 0), a.bb(), q = !0), s = this.Ja, l = k = 0, r = s.width, s = s.height, p = 0, this instanceof Y && (s = this.Ua.gb, k = s.x, l = s.y, r = s.width, s = s.height, p = this.ji), No(this, a, this.Eb, !0, !1), this.Eb instanceof ha && this.Eb.type === cd ? (a.beginPath(), a.rect(k - p / 2, l - p / 2, r + p, s + p), a.Mg(this.Eb)) : a.fillRect(k - p / 2, l - p / 2, r + p, s + p)); u && (null !== this.Eb || null !== this.bc || null !== m && 0 !== (m.P & 512) || null !== m && (m.type === Fl || m.type === Mj) && m.Kd() !== this) ? (Oo(this, !0), null === this.uq && a.Yn()) : Oo(this, !1); this.yk(a, b); u && 0 !== (this.P & 512) === !0 && a.Zn(); this.tj() && u && a.Yn(); c && (a.restore(), n && a.yf.pop()); this instanceof C && (f = a.yf.pop()); !0 === q && a.yf.pop(); null !== a.IE && (null === f && (h === a.Fx ? (Qc(a, 1, 0, 0, 1, 0, 0), f = a.yf.pop()) : f = a.Fx), a.IE(this, f)) } } } } else { if (this instanceof C && (this.type === Jo || this.type === Ko)) { Lo(this, a, b); 1 !== d && (a.globalAlpha = e); return } this instanceof W && this.pu(!1); f = this.transform; h = this.O; 0 !== (this.P & 4096) === !0 && Mo(this); m = 0 !== (this.P & 256); a.Hp && (m = !1); this instanceof Hh && (a.font = this.font); if (m) { n = h.ah() ? h.Ja : h.Y; null !== this.og ? (q = this.og, k = q.x, l = q.y, u = q.width, q = q.height) : (k = Math.max(c.x, n.x), l = Math.max(c.y, n.y), u = Math.min(c.right, n.right) - k, q = Math.min(c.bottom, n.bottom) - l); if (k > c.width + c.x || c.x > n.width + n.x || l > c.height + c.y || c.y > n.height + n.y) { 1 !== d && (a.globalAlpha = e); return } a.save(); a.beginPath(); a.rect(k, l, u, q); a.clip() } if (this.tj()) { if (!this.isVisible()) { 1 !== d && (a.globalAlpha = e); return } this.am && b.qj("drawShadows") && (n = this.bn, a.pB(n.x * b.scale * b.Dd, n.y * b.scale * b.Dd, this.Eg), a.Zn(), a.shadowColor = this.an) } n = !1; this.U && b.qj("drawShadows") && (n = this.U.am); !0 === this.uq ? a.Zn() : !1 === this.uq && a.Yn(); null !== this.bc && (No(this, a, this.bc, !0, !0), this.bc instanceof ha && this.bc.type === cd ? (a.beginPath(), a.rect(c.x, c.y, c.width, c.height), a.Mg(this.bc)) : a.fillRect(c.x, c.y, c.width, c.height)); f.gu() || a.transform(f.m11, f.m12, f.m21, f.m22, f.dx, f.dy); null !== this.Eb && (u = this.Ja, k = c = 0, l = u.width, u = u.height, q = 0, this instanceof Y && (u = this.Ua.gb, c = u.x, k = u.y, l = u.width, u = u.height, q = this.ji), No(this, a, this.Eb, !0, !1), this.Eb instanceof ha && this.Eb.type === cd ? (a.beginPath(), a.rect(c - q / 2, k - q / 2, l + q, u + q), a.Mg(this.Eb)) : a.fillRect(c - q / 2, k - q / 2, l + q, u + q)); n && (null !== this.Eb || null !== this.bc || null !== h && 0 !== (h.P & 512) || null !== h && (h.type === Fl || h.type === Mj) && h.Kd() !== this) ? (Oo(this, !0), null === this.uq && a.Yn()) : Oo(this, !1); this.yk(a, b); n && 0 !== (this.P & 512) === !0 && a.Zn(); this.tj() && n && a.Yn(); m ? (a.restore(), this instanceof C ? a.Fe(!0) : a.Fe(!1)) : f.gu() || (h = 1 / (f.m11 * f.m22 - f.m12 * f.m21), a.transform(f.m22 * h, -f.m12 * h, -f.m21 * h, f.m11 * h, h * (f.m21 * f.dy - f.m22 * f.dx), h * (f.m12 * f.dx - f.m11 * f.dy))) } 1 !== d && (a.globalAlpha = e) } } }; function Lo(a, b, c) { var d = a.oc; 0 === d.width || 0 === d.height || isNaN(d.x) || isNaN(d.y) || (null !== a.bc && (No(a, b, a.bc, !0, !0), a.bc instanceof ha && a.bc.type === cd ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), b.Mg(a.bc)) : b.fillRect(d.x, d.y, d.width, d.height)), null !== a.Eb && (No(a, b, a.Eb, !0, !1), a.Eb instanceof ha && a.Eb.type === cd ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), b.Mg(a.Eb)) : b.fillRect(d.x, d.y, d.width, d.height)), a.yk(b, c)) } G.prototype.yk = function () { }; function No(a, b, c, d, e) { if (null !== c) { var f = 1, h = 1; if ("string" === typeof c) d ? b.fillStyle = c : b.strokeStyle = c; else if (c.type === ng) d ? b.fillStyle = c.color : b.strokeStyle = c.color; else { var k, h = a.Ja, f = h.width, h = h.height; if (e) var l = a.Y, f = l.width, h = l.height; var m = b instanceof Xc; if (m && c.eh && (c.type === Un || c.ro === f && c.My === h)) k = c.eh; else { var n = l = 0, p = 0, q = 0, r = 0, s = 0, s = r = 0; e && (l = a.Y, f = l.width, h = l.height, r = l.x, s = l.y); l = c.start.x * f + c.start.offsetX; n = c.start.y * h + c.start.offsetY; p = c.end.x * f + c.end.offsetX; q = c.end.y * h + c.end.offsetY; l += r; p += r; n += s; q += s; if (c.type === og) k = b.createLinearGradient(l, n, p, q); else if (c.type === cd) s = isNaN(c.Jt) ? Math.max(f, h) / 2 : c.Jt, isNaN(c.Nu) ? (r = 0, s = Math.max(f, h) / 2) : r = c.Nu, k = b.createRadialGradient(l, n, r, p, q, s); else if (c.type === Un) try { k = b.createPattern(c.pattern, "repeat") } catch (u) { k = null } else w.Bd(c.type, "Brush type"); if (c.type !== Un && (e = c.uk, null !== e)) for (e = e.i; e.next();)k.addColorStop(e.key, e.value); if (m && (c.eh = k, null !== k && (c.ro = f, c.My = h), null === k && c.type === Un && -1 !== c.ro)) { c.ro = -1; var t = a.g; null !== t && -1 === c.ro && w.setTimeout(function () { t.Wx() }, 600) } } d ? b.fillStyle = k : b.strokeStyle = k } } } G.prototype.isContainedBy = G.prototype.Zl = function (a) { if (a instanceof C) a: { if (this !== a && null !== a) for (var b = this.O; null !== b;) { if (b === a) { a = !0; break a } b = b.O } a = !1 } else a = !1; return a }; G.prototype.isVisibleObject = G.prototype.xj = function () { if (!this.visible) return !1; var a = this.O; return null !== a ? a.xj() : !0 }; G.prototype.isEnabledObject = G.prototype.eu = function () { for (var a = this instanceof C ? this : this.O; null !== a && a.isEnabled;)a = a.O; return null === a }; w.defineProperty(G, { JE: "enabledChanged" }, function () { return null !== this.ia ? this.ia.tr : null }, function (a) { uo(this); var b = this.ia.tr; b !== a && (null !== a && w.j(a, "function", G, "enabledChanged"), this.ia.tr = a, this.h("enabledChanged", b, a)) }); function Mo(a) { if (0 !== (a.P & 2048) === !0) { var b = a.fd; b.reset(); if (!a.oc.I() || !a.rd.I()) { Po(a, !1); return } b.translate(a.oc.x, a.oc.y); b.translate(-a.za.x, -a.za.y); var c = a.Ja; Co(a, b, c.x, c.y, c.width, c.height); Po(a, !1); Qo(a, !0) } 0 !== (a.P & 4096) === !0 && (b = a.O, null === b ? (a.pm.set(a.fd), a.Co = a.scale, Qo(a, !1)) : null !== b.rh && (c = a.pm, c.reset(), b.ah() ? c.multiply(b.pm) : null !== b.O && c.multiply(b.O.pm), c.multiply(a.fd), a.Co = a.scale * b.Co, Qo(a, !1))) } function Co(a, b, c, d, e, f) { 1 !== a.scale && b.scale(a.scale); if (0 !== a.angle) { var h = Hb; a.tj() && a.Ef.Xc() && (h = a.Ef); var k = w.K(); if (a instanceof T && a.$f !== a) for (c = a.$f, d = c.Ja, k.Ku(d.x, d.y, d.width, d.height, h), c.Ri.nb(k), k.offset(-c.za.x, -c.za.y), h = c.O; null !== h && h !== a;)h.Ri.nb(k), k.offset(-h.za.x, -h.za.y), h = h.O; else k.Ku(c, d, e, f, h); b.rotate(a.angle, k.x, k.y); w.v(k) } } g = G.prototype; g.H = function (a) { void 0 === a && (a = !1); if (!0 !== Cm(this)) { am(this, !0); Fo(this, !0); var b = this.O; null === b || a || b.H() } }; g.Zp = function () { !0 !== Cm(this) && (am(this, !0), Fo(this, !0)) }; function Ro(a) { if (!1 === Dm(a)) { var b = a.O; null !== b ? b.H() : a.tj() && (b = a.g, null !== b && (b.vg.add(a), a instanceof U && a.Xf(), b.Me())); Fo(a, !0) } } g.Li = function () { 0 !== (this.P & 2048) === !1 && (Po(this, !0), Qo(this, !0)) }; g.zA = function () { Qo(this, !0) }; g.na = function () { var a = this.U; null !== a && a.na() }; function Eo(a, b) { var c = a.stretch, d = a.O; if (null !== d && d.ma === So) return To(a, d.Md(a.Vb), d.Ld(a.column), b); if (null !== d && d.ma === Fl && d.Kd() === a) return Uo(a, Fe, b); if (c === oo) { if (null !== d) { if (d.ma === Mj && d.Kd() === a) return Uo(a, Fe, b); c = d.be; return c === oo ? Uo(a, Oj, b) : Uo(a, c, b) } return Uo(a, Oj, b) } return Uo(a, c, b) } function To(a, b, c, d) { var e = a.stretch; if (e !== oo) return Uo(a, e, d); var f = e = null; switch (b.stretch) { case po: f = !0; break; case Fe: f = !0 }switch (c.stretch) { case qo: e = !0; break; case Fe: e = !0 }b = a.O.be; null === e && (e = b === qo || b === Fe); null === f && (f = b === po || b === Fe); return !0 === e && !0 === f ? Uo(a, Fe, d) : !0 === e ? Uo(a, qo, d) : !0 === f ? Uo(a, po, d) : Uo(a, Oj, d) } function Uo(a, b, c) { if (c) return b; if (b === Oj) return Oj; c = a.Ca; if (c.I()) return Oj; a = a.angle; if (!isNaN(c.width)) if (90 !== a && 270 !== a) { if (b === qo) return Oj; if (b === Fe) return po } else { if (b === po) return Oj; if (b === Fe) return qo } if (!isNaN(c.height)) if (90 !== a && 270 !== a) { if (b === po) return Oj; if (b === Fe) return qo } else { if (b === qo) return Oj; if (b === Fe) return po } return b } w.defineProperty(G, { qq: "segmentOrientation" }, function () { return this.Zm }, function (a) { var b = this.Zm; b !== a && (this.Zm = a, this.H(), this.h("segmentOrientation", b, a), a === kj && (this.angle = 0)) }); w.defineProperty(G, { Ne: "segmentIndex" }, function () { return this.Ts }, function (a) { a = Math.round(a); var b = this.Ts; b !== a && (this.Ts = a, this.H(), this.h("segmentIndex", b, a)) }); w.defineProperty(G, { eB: "segmentFraction" }, function () { return this.Xm }, function (a) { isNaN(a) ? a = 0 : 0 > a ? a = 0 : 1 < a && (a = 1); var b = this.Xm; b !== a && (this.Xm = a, this.H(), this.h("segmentFraction", b, a)) }); w.defineProperty(G, { fB: "segmentOffset" }, function () { return this.Ym }, function (a) { var b = this.Ym; b.L(a) || (this.Ym = a = a.S(), this.H(), this.h("segmentOffset", b, a)) }); w.defineProperty(G, { stretch: "stretch" }, function () { return this.Fg }, function (a) { var b = this.Fg; b !== a && (this.Fg = a, this.H(), this.h("stretch", b, a)) }); w.defineProperty(G, { name: "name" }, function () { return this.Sb }, function (a) { var b = this.Sb; b !== a && (this.Sb = a, null !== this.U && (this.U.Om = null), this.h("name", b, a)) }); w.defineProperty(G, { opacity: "opacity" }, function () { return this.yc }, function (a) { var b = this.yc; b !== a && (w.j(a, "number", G, "opacity"), (0 > a || 1 < a) && w.Fa(a, "0 <= value <= 1", G, "opacity"), this.yc = a, this.h("opacity", b, a), a = this.g, b = this.U, null !== a && null !== b && a.na(nl(b, b.Y))) }); w.defineProperty(G, { visible: "visible" }, function () { return 0 !== (this.P & 1) }, function (a) { var b = 0 !== (this.P & 1); b !== a && (this.P ^= 1, this.h("visible", b, a), b = this.O, null !== b ? b.H() : this.tj() && this.yd(a), this.na(), Vo(this)) }); w.defineProperty(G, { Wg: "pickable" }, function () { return 0 !== (this.P & 2) }, function (a) { var b = 0 !== (this.P & 2); b !== a && (this.P ^= 2, this.h("pickable", b, a)) }); w.defineProperty(G, { WH: "fromLinkableDuplicates" }, function () { return 0 !== (this.P & 4) }, function (a) { var b = 0 !== (this.P & 4); b !== a && (this.P ^= 4, this.h("fromLinkableDuplicates", b, a)) }); w.defineProperty(G, { XH: "fromLinkableSelfNode" }, function () { return 0 !== (this.P & 8) }, function (a) { var b = 0 !== (this.P & 8); b !== a && (this.P ^= 8, this.h("fromLinkableSelfNode", b, a)) }); w.defineProperty(G, { QJ: "toLinkableDuplicates" }, function () { return 0 !== (this.P & 16) }, function (a) { var b = 0 !== (this.P & 16); b !== a && (this.P ^= 16, this.h("toLinkableDuplicates", b, a)) }); w.defineProperty(G, { RJ: "toLinkableSelfNode" }, function () { return 0 !== (this.P & 32) }, function (a) { var b = 0 !== (this.P & 32); b !== a && (this.P ^= 32, this.h("toLinkableSelfNode", b, a)) }); w.defineProperty(G, { Yf: "isPanelMain" }, function () { return 0 !== (this.P & 64) }, function (a) { var b = 0 !== (this.P & 64); b !== a && (this.P ^= 64, this.H(), this.h("isPanelMain", b, a)) }); w.defineProperty(G, { wx: "isActionable" }, function () { return 0 !== (this.P & 128) }, function (a) { var b = 0 !== (this.P & 128); b !== a && (this.P ^= 128, this.h("isActionable", b, a)) }); w.defineProperty(G, { kn: "areaBackground" }, function () { return this.bc }, function (a) { var b = this.bc; b !== a && (a instanceof ha && a.freeze(), this.bc = a, this.na(), this.h("areaBackground", b, a)) }); w.defineProperty(G, { background: "background" }, function () { return this.Eb }, function (a) { var b = this.Eb; b !== a && (a instanceof ha && a.freeze(), this.Eb = a, this.na(), this.h("background", b, a)) }); function Oo(a, b) { a.P = b ? a.P | 512 : a.P & -513 } function zo(a) { return 0 !== (a.P & 1024) } function Wo(a, b) { a.P = b ? a.P | 1024 : a.P & -1025 } function Po(a, b) { a.P = b ? a.P | 2048 : a.P & -2049 } function Qo(a, b) { a.P = b ? a.P | 4096 : a.P & -4097 } function Cm(a) { return 0 !== (a.P & 8192) } function am(a, b) { a.P = b ? a.P | 8192 : a.P & -8193 } function Dm(a) { return 0 !== (a.P & 16384) } function Fo(a, b) { a.P = b ? a.P | 16384 : a.P & -16385 } w.u(G, { U: "part" }, function () { if (this.tj()) return this; if (null !== this.Tm) return this.Tm; var a; for (a = this.O; a;) { if (a instanceof T) return this.Tm = a; a = a.O } return null }); w.u(G, { O: "panel" }, function () { return this.nh }); G.prototype.em = function (a) { this.nh = a }; w.u(G, { layer: "layer" }, function () { var a = this.U; return null !== a ? a.layer : null }, { configurable: !0 }); w.u(G, { g: "diagram" }, function () { var a = this.U; return null !== a ? a.g : null }, { configurable: !0 }); w.defineProperty(G, { position: "position" }, function () { return this.jb }, function (a) { var b = a.x, c = a.y, d = this.jb, e = d.x, f = d.y; (e === b || isNaN(e) && isNaN(b)) && (f === c || isNaN(f) && isNaN(c)) ? this.mB() : (a = a.S(), this.lB(a, d) && this.h("position", d, a)) }); G.prototype.mB = function () { }; G.prototype.lB = function (a) { this.jb = a; Ro(this); this.Li(); return !0 }; G.prototype.my = function (a, b) { this.jb.m(a, b); this.Li() }; w.u(G, { Y: "actualBounds" }, function () { return this.oc }); w.defineProperty(G, { scale: "scale" }, function () { return this.ub }, function (a) { var b = this.ub; b !== a && (0 >= a && w.k("GraphObject.scale for " + this + " must be greater than zero, not: " + a), this.ub = a, this.Li(), this.H(), this.h("scale", b, a)) }); w.defineProperty(G, { angle: "angle" }, function () { return this.lg }, function (a) { var b = this.lg; b !== a && (a %= 360, 0 > a && (a += 360), b !== a && (this.lg = a, Vo(this), this.H(), this.Li(), this.h("angle", b, a))) }); w.defineProperty(G, { Ca: "desiredSize" }, function () { return this.Se }, function (a) { var b = a.width, c = a.height, d = this.Se, e = d.width, f = d.height; (e === b || isNaN(e) && isNaN(b)) && (f === c || isNaN(f) && isNaN(c)) || (this.Se = a = a.S(), this.H(), this instanceof Y && this.Le(), this.h("desiredSize", d, a), zo(this) && (a = this.U, null !== a && (Ao(this, a, "width"), Ao(this, a, "height")))) }); w.defineProperty(G, { width: "width" }, function () { return this.Se.width }, function (a) { var b = this.Se.width; b === a || isNaN(b) && isNaN(a) || (b = this.Se, this.Se = a = (new ia(a, this.Se.height)).freeze(), this.H(), this instanceof Y && this.Le(), this.h("desiredSize", b, a), zo(this) && (a = this.U, null !== a && Ao(this, a, "width"))) }); w.defineProperty(G, { height: "height" }, function () { return this.Se.height }, function (a) { var b = this.Se.height; b === a || isNaN(b) && isNaN(a) || (b = this.Se, this.Se = a = (new ia(this.Se.width, a)).freeze(), this.H(), this instanceof Y && this.Le(), this.h("desiredSize", b, a), zo(this) && (a = this.U, null !== a && Ao(this, a, "height"))) }); w.defineProperty(G, { Bh: "minSize" }, function () { return this.Zh }, function (a) { var b = this.Zh; b.L(a) || (a = a.copy(), isNaN(a.width) && (a.width = 0), isNaN(a.height) && (a.height = 0), a.freeze(), this.Zh = a, this.H(), this.h("minSize", b, a)) }); w.defineProperty(G, { Ff: "maxSize" }, function () { return this.Yh }, function (a) { var b = this.Yh; b.L(a) || (a = a.copy(), isNaN(a.width) && (a.width = Infinity), isNaN(a.height) && (a.height = Infinity), a.freeze(), this.Yh = a, this.H(), this.h("maxSize", b, a)) }); w.u(G, { za: "measuredBounds" }, function () { return this.rd }); w.u(G, { Ja: "naturalBounds" }, function () { return this.Uc }, { configurable: !0 }); w.defineProperty(G, { margin: "margin" }, function () { return this.Mm }, function (a) { "number" === typeof a && (a = new db(a)); var b = this.Mm; b.L(a) || (this.Mm = a = a.S(), this.H(), this.h("margin", b, a)) }); w.u(G, { transform: null }, function () { 0 !== (this.P & 2048) === !0 && Mo(this); return this.fd }); w.u(G, { rh: null }, function () { 0 !== (this.P & 4096) === !0 && Mo(this); return this.pm }); w.defineProperty(G, { alignment: "alignment" }, function () { return this.ie }, function (a) { var b = this.ie; b.L(a) || (a.Rd() && !a.Wc() && w.k("GraphObject.alignment for " + this + " must be a real Spot or Spot.Default, not: " + a), this.ie = a = a.S(), Ro(this), this.h("alignment", b, a)) }); w.defineProperty(G, { column: "column" }, function () { return this.Uq }, function (a) { a = Math.round(a); var b = this.Uq; b !== a && (0 > a && w.Fa(a, ">= 0", G, "column"), this.Uq = a, this.H(), this.h("column", b, a)) }); w.defineProperty(G, { wH: "columnSpan" }, function () { return this.Ai }, function (a) { a = Math.round(a); var b = this.Ai; b !== a && (1 > a && w.Fa(a, ">= 1", G, "columnSpan"), this.Ai = a, this.H(), this.h("columnSpan", b, a)) }); w.defineProperty(G, { Vb: "row" }, function () { return this.Ps }, function (a) { a = Math.round(a); var b = this.Ps; b !== a && (0 > a && w.Fa(a, ">= 0", G, "row"), this.Ps = a, this.H(), this.h("row", b, a)) }); w.defineProperty(G, { rowSpan: "rowSpan" }, function () { return this.bj }, function (a) { a = Math.round(a); var b = this.bj; b !== a && (1 > a && w.Fa(a, ">= 1", G, "rowSpan"), this.bj = a, this.H(), this.h("rowSpan", b, a)) }); w.defineProperty(G, { ny: "spanAllocation" }, function () { return this.et }, function (a) { var b = this.et; b !== a && (null !== a && w.j(a, "function", G, "spanAllocation"), this.et = a, this.H(), this.h("spanAllocation", b, a)) }); w.defineProperty(G, { qh: "alignmentFocus" }, function () { return this.om }, function (a) { var b = this.om; b.L(a) || (!a.Rd() || a.Wc() || a.L(tb) && this instanceof U || w.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: " + a), this.om = a = a.S(), this.H(), this.h("alignmentFocus", b, a)) }); w.defineProperty(G, { Td: "portId" }, function () { return this.Cs }, function (a) { var b = this.Cs; if (b !== a) { var c = this.U; null === c || c instanceof U || (w.k("Cannot set portID on a Link: " + a), c = null); null !== b && null !== c && Xo(c, this); this.Cs = a; if (null !== a && c) { c.Ek = !0; null === c.ne && Yo(c); var d = this.Td; null !== d && c.ne.add(d, this) } this.h("portId", b, a) } }); function Zo(a) { var b = a.U; if (b instanceof U && (null !== a.Td || a === b.port)) { var c = b.g; null === c || c.oa.ab || Io(b, a) } } function Vo(a) { var b = a.g; null === b || b.oa.ab || (a instanceof C ? a instanceof U ? a.Xf() : $o(a, a, function (a) { Zo(a) }) : Zo(a)) } w.defineProperty(G, { Bb: "toSpot" }, function () { return null !== this.W ? this.W.pk : tb }, function (a) { this.Od(); var b = this.W.pk; b.L(a) || (a = a.S(), this.W.pk = a, this.h("toSpot", b, a), Zo(this)) }); w.defineProperty(G, { km: "toEndSegmentLength" }, function () { return null !== this.W ? this.W.nk : 10 }, function (a) { this.Od(); var b = this.W.nk; b !== a && (0 > a && w.Fa(a, ">= 0", G, "toEndSegmentLength"), this.W.nk = a, this.h("toEndSegmentLength", b, a), Zo(this)) }); w.defineProperty(G, { Ou: "toEndSegmentDirection" }, function () { return null !== this.W ? this.W.mk : xo }, function (a) { this.Od(); var b = this.W.mk; b !== a && (w.Ht("GraphObject.toEndSegmentDirection", "2.0"), this.W.mk = a, this.h("toEndSegmentDirection", b, a), Zo(this)) }); w.defineProperty(G, { Pu: "toShortLength" }, function () { return null !== this.W ? this.W.ok : 0 }, function (a) { this.Od(); var b = this.W.ok; b !== a && (this.W.ok = a, this.h("toShortLength", b, a), Zo(this)) }); w.defineProperty(G, { tG: "toLinkable" }, function () { return null !== this.W ? this.W.mt : null }, function (a) { this.Od(); var b = this.W.mt; b !== a && (this.W.mt = a, this.h("toLinkable", b, a)) }); w.defineProperty(G, { SJ: "toMaxLinks" }, function () { return null !== this.W ? this.W.nt : Infinity }, function (a) { this.Od(); var b = this.W.nt; b !== a && (0 > a && w.Fa(a, ">= 0", G, "toMaxLinks"), this.W.nt = a, this.h("toMaxLinks", b, a)) }); w.defineProperty(G, { Ab: "fromSpot" }, function () { return null !== this.W ? this.W.Sj : tb }, function (a) { this.Od(); var b = this.W.Sj; b.L(a) || (a = a.S(), this.W.Sj = a, this.h("fromSpot", b, a), Zo(this)) }); w.defineProperty(G, { Sl: "fromEndSegmentLength" }, function () { return null !== this.W ? this.W.Qj : 10 }, function (a) { this.Od(); var b = this.W.Qj; b !== a && (0 > a && w.Fa(a, ">= 0", G, "fromEndSegmentLength"), this.W.Qj = a, this.h("fromEndSegmentLength", b, a), Zo(this)) }); w.defineProperty(G, { Vt: "fromEndSegmentDirection" }, function () { return null !== this.W ? this.W.Pj : xo }, function (a) { this.Od(); var b = this.W.Pj; b !== a && (w.Ht("GraphObject.fromEndSegmentDirection", "2.0"), this.W.Pj = a, this.h("fromEndSegmentDirection", b, a), Zo(this)) }); w.defineProperty(G, { Wt: "fromShortLength" }, function () { return null !== this.W ? this.W.Rj : 0 }, function (a) { this.Od(); var b = this.W.Rj; b !== a && (this.W.Rj = a, this.h("fromShortLength", b, a), Zo(this)) }); w.defineProperty(G, { TE: "fromLinkable" }, function () { return null !== this.W ? this.W.wr : null }, function (a) { this.Od(); var b = this.W.wr; b !== a && (this.W.wr = a, this.h("fromLinkable", b, a)) }); w.defineProperty(G, { oA: "fromMaxLinks" }, function () { return null !== this.W ? this.W.xr : Infinity }, function (a) { this.Od(); var b = this.W.xr; b !== a && (0 > a && w.Fa(a, ">= 0", G, "fromMaxLinks"), this.W.xr = a, this.h("fromMaxLinks", b, a)) }); w.defineProperty(G, { cursor: "cursor" }, function () { return this.cr }, function (a) { var b = this.cr; b !== a && (w.j(a, "string", G, "cursor"), this.cr = a, this.h("cursor", b, a)) }); w.defineProperty(G, { click: "click" }, function () { return null !== this.ia ? this.ia.zi : null }, function (a) { uo(this); var b = this.ia.zi; b !== a && (null !== a && w.j(a, "function", G, "click"), this.ia.zi = a, this.h("click", b, a)) }); w.defineProperty(G, { It: "doubleClick" }, function () { return null !== this.ia ? this.ia.Hi : null }, function (a) { uo(this); var b = this.ia.Hi; b !== a && (null !== a && w.j(a, "function", G, "doubleClick"), this.ia.Hi = a, this.h("doubleClick", b, a)) }); w.defineProperty(G, { aA: "contextClick" }, function () { return null !== this.ia ? this.ia.Bi : null }, function (a) { uo(this); var b = this.ia.Bi; b !== a && (null !== a && w.j(a, "function", G, "contextClick"), this.ia.Bi = a, this.h("contextClick", b, a)) }); w.defineProperty(G, { ru: "mouseEnter" }, function () { return null !== this.ia ? this.ia.ms : null }, function (a) { uo(this); var b = this.ia.ms; b !== a && (null !== a && w.j(a, "function", G, "mouseEnter"), this.ia.ms = a, this.h("mouseEnter", b, a)) }); w.defineProperty(G, { su: "mouseLeave" }, function () { return null !== this.ia ? this.ia.ns : null }, function (a) { uo(this); var b = this.ia.ns; b !== a && (null !== a && w.j(a, "function", G, "mouseLeave"), this.ia.ns = a, this.h("mouseLeave", b, a)) }); w.defineProperty(G, { QA: "mouseOver" }, function () { return null !== this.ia ? this.ia.Wi : null }, function (a) { uo(this); var b = this.ia.Wi; b !== a && (null !== a && w.j(a, "function", G, "mouseOver"), this.ia.Wi = a, this.h("mouseOver", b, a)) }); w.defineProperty(G, { PA: "mouseHover" }, function () { return null !== this.ia ? this.ia.Vi : null }, function (a) { uo(this); var b = this.ia.Vi; b !== a && (null !== a && w.j(a, "function", G, "mouseHover"), this.ia.Vi = a, this.h("mouseHover", b, a)) }); w.defineProperty(G, { OA: "mouseHold" }, function () { return null !== this.ia ? this.ia.Ui : null }, function (a) { uo(this); var b = this.ia.Ui; b !== a && (null !== a && w.j(a, "function", G, "mouseHold"), this.ia.Ui = a, this.h("mouseHold", b, a)) }); w.defineProperty(G, { aJ: "mouseDragEnter" }, function () { return null !== this.ia ? this.ia.ks : null }, function (a) { uo(this); var b = this.ia.ks; b !== a && (null !== a && w.j(a, "function", G, "mouseDragEnter"), this.ia.ks = a, this.h("mouseDragEnter", b, a)) }); w.defineProperty(G, { bJ: "mouseDragLeave" }, function () { return null !== this.ia ? this.ia.ls : null }, function (a) { uo(this); var b = this.ia.ls; b !== a && (null !== a && w.j(a, "function", G, "mouseDragLeave"), this.ia.ls = a, this.h("mouseDragLeave", b, a)) }); w.defineProperty(G, { NA: "mouseDrop" }, function () { return null !== this.ia ? this.ia.Ti : null }, function (a) { uo(this); var b = this.ia.Ti; b !== a && (null !== a && w.j(a, "function", G, "mouseDrop"), this.ia.Ti = a, this.h("mouseDrop", b, a)) }); w.defineProperty(G, { fE: "actionDown" }, function () { return null !== this.ia ? this.ia.Cq : null }, function (a) { uo(this); var b = this.ia.Cq; b !== a && (null !== a && w.j(a, "function", G, "actionDown"), this.ia.Cq = a, this.h("actionDown", b, a)) }); w.defineProperty(G, { gE: "actionMove" }, function () { return null !== this.ia ? this.ia.Dq : null }, function (a) { uo(this); var b = this.ia.Dq; b !== a && (null !== a && w.j(a, "function", G, "actionMove"), this.ia.Dq = a, this.h("actionMove", b, a)) }); w.defineProperty(G, { hE: "actionUp" }, function () { return null !== this.ia ? this.ia.Eq : null }, function (a) { uo(this); var b = this.ia.Eq; b !== a && (null !== a && w.j(a, "function", G, "actionUp"), this.ia.Eq = a, this.h("actionUp", b, a)) }); w.defineProperty(G, { eE: "actionCancel" }, function () { return null !== this.ia ? this.ia.Bq : null }, function (a) { uo(this); var b = this.ia.Bq; b !== a && (null !== a && w.j(a, "function", G, "actionCancel"), this.ia.Bq = a, this.h("actionCancel", b, a)) }); w.defineProperty(G, { vB: "toolTip" }, function () { return null !== this.ia ? this.ia.ej : null }, function (a) { uo(this); var b = this.ia.ej; b !== a && (this.ia.ej = a, this.h("toolTip", b, a)) }); w.defineProperty(G, { contextMenu: "contextMenu" }, function () { return null !== this.ia ? this.ia.Ci : null }, function (a) { uo(this); var b = this.ia.Ci; b !== a && (this.ia.Ci = a, this.h("contextMenu", b, a)) }); G.prototype.bind = G.prototype.bind = function (a) { a.Gg = this; var b = this.Rl(); null !== b && ap(b) && w.k("Cannot add a Binding to a template that has already been copied: " + a); null === this.vc && (this.vc = new H(ah)); this.vc.add(a) }; G.prototype.findTemplateBinder = G.prototype.Rl = function () { for (var a = this instanceof C ? this : this.O; null !== a;) { if (null !== a.Zk) return a; a = a.O } return null }; G.prototype.setProperties = function (a) { w.Iu(this, a) }; var bp; G.make = bp = function (a, b) { var c = arguments, d = null, e = null; if ("function" === typeof a) e = a; else if ("string" === typeof a) { var f = cp.ja(a); "function" === typeof f ? (c = w.Jl(arguments), d = f(c), w.Pa(d) || w.k('GraphObject.make invoked object builder "' + a + '", but it did not return an Object')) : e = ca[a] } null === d && (void 0 !== e && null !== e && e.constructor || w.k("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: " + a), d = new e); f = 1; if (d instanceof D && 1 < c.length) { var h = d, e = c[1]; if ("string" === typeof e || e instanceof HTMLDivElement) Dl(h, e), f++ } for (; f < c.length; f++)e = c[f], void 0 === e ? w.k("Undefined value at argument " + f + " for object being constructed by GraphObject.make: " + d) : dp(d, e); return d }; function dp(a, b) { if ("string" === typeof b) if (a instanceof Hh) a.text = b; else if (a instanceof Y) a.Cb = b; else if (a instanceof xl) a.source = b; else if (a instanceof C) { var c = pa(C, b); null !== c ? a.type = c : w.k("Unknown Panel type as an argument to GraphObject.make: " + b) } else a instanceof ha ? (c = pa(ha, b), null !== c ? a.type = c : w.k("Unknown Brush type as an argument to GraphObject.make: " + b)) : a instanceof Ce ? (c = pa(Ce, b), null !== c ? a.type = c : w.k("Unknown Geometry type as an argument to GraphObject.make: " + b)) : a instanceof zf ? (c = pa(zf, b), null !== c ? a.type = c : w.k("Unknown PathSegment type as an argument to GraphObject.make: " + b)) : w.k("Unable to use a string as an argument to GraphObject.make: " + b); else if (b instanceof G) c = b, a instanceof C || w.k("A GraphObject can only be added to a Panel, not to: " + a), a.add(c); else if (b instanceof Vg) { var d = b, c = a, e; d.xe && c.getRowDefinition ? e = c.getRowDefinition(d.index) : !d.xe && c.getColumnDefinition ? e = c.getColumnDefinition(d.index) : w.k("A RowColumnDefinition can only be added to a Panel, not to: " + a); e.Jp(d) } else if (b instanceof ea) "function" === typeof a.ic ? a.ic(b) : w.Ej(a, b); else if (b instanceof ah) a instanceof G ? a.bind(b) : a instanceof Vg ? a.bind(b) : w.k("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: " + a); else if (b instanceof Ee) a instanceof Ce ? a.fc.add(b) : w.k("A PathFigure can only be added to a Geometry, not to: " + a); else if (b instanceof zf) a instanceof Ee ? a.vb.add(b) : w.k("A PathSegment can only be added to a PathFigure, not to: " + a); else if (b instanceof sg) a instanceof D ? a.Tb = b : a instanceof V ? a.Tb = b : w.k("A Layout can only be assigned to a Diagram or a Group, not to: " + a); else if (Array.isArray(b)) for (c = 0; c < b.length; c++)dp(a, b[c]); else if ("object" === typeof b && null !== b) if (a instanceof ha) { e = new sa; for (c in b) d = parseFloat(c), isNaN(d) ? e[c] = b[c] : a.addColorStop(d, b[c]); w.Iu(a, e) } else if (a instanceof Vg) { void 0 !== b.row ? (e = b.row, (void 0 === e || null === e || Infinity === e || isNaN(e) || 0 > e) && w.k("Must specify non-negative integer row for RowColumnDefinition " + b + ", not: " + e), a.xe = !0, a.index = e) : void 0 !== b.column && (e = b.column, (void 0 === e || null === e || Infinity === e || isNaN(e) || 0 > e) && w.k("Must specify non-negative integer column for RowColumnDefinition " + b + ", not: " + e), a.xe = !1, a.index = e); e = new sa; for (c in b) "row" !== c && "column" !== c && (e[c] = b[c]); w.Iu(a, e) } else w.Iu(a, b); else w.k('Unknown initializer "' + b + '" for object being constructed by GraphObject.make: ' + a) } var cp = new la("string", "function"); G.getBuilders = function () { var a = new la("string", "function"), b; for (b in cp) if (b !== b.toLowerCase()) { var c = cp.ja(b); "function" === typeof c && a.add(b, c) } a.freeze(); return a }; var ep; G.defineBuilder = ep = function (a, b) { w.j(a, "string", G, "defineBuilder:name"); w.j(b, "function", G, "defineBuilder:func"); var c = a.toLowerCase(); "" !== a && "none" !== c && a !== c || w.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: " + a); cp.add(a, b) }; var fp; G.takeBuilderArgument = fp = function (a, b, c) { void 0 === c && (c = null); var d = a[1]; if ("function" === typeof c ? c(d) : "string" === typeof d) return a.splice(1, 1), d; if (void 0 === b) throw Error("no " + ("function" === typeof c ? "satisfactory" : "string") + " argument for GraphObject builder " + a[0]); return b }; ep("Button", function () { var a = new ha(og); a.addColorStop(0, "white"); a.addColorStop(1, "lightgray"); var b = new ha(og); b.addColorStop(0, "white"); b.addColorStop(1, "dodgerblue"); a = bp(C, Fl, { wx: !0, JE: function (a, b) { var e = a.xd("ButtonBorder"); null !== e && (e.fill = b ? a._buttonFillNormal : a._buttonFillDisabled) }, _buttonFillNormal: a, _buttonStrokeNormal: "gray", _buttonFillOver: b, _buttonStrokeOver: "blue", _buttonFillDisabled: "darkgray" }, bp(Y, { name: "ButtonBorder", Cb: "Rectangle", A: new L(0, 0, 2.761423749153968, 2.761423749153968), B: new L(1, 1, -2.761423749153968, -2.761423749153968), fill: a, stroke: "gray" })); a.ru = function (a, b) { if (b.eu()) { var e = b.xd("ButtonBorder"); if (e instanceof Y) { var f = b._buttonFillOver; b._buttonFillNormal = e.fill; e.fill = f; f = b._buttonStrokeOver; b._buttonStrokeNormal = e.stroke; e.stroke = f } } }; a.su = function (a, b) { if (b.eu()) { var e = b.xd("ButtonBorder"); e instanceof Y && (e.fill = b._buttonFillNormal, e.stroke = b._buttonStrokeNormal) } }; return a }); ep("TreeExpanderButton", function () { var a = bp("Button", { _treeExpandedFigure: "MinusLine", _treeCollapsedFigure: "PlusLine" }, bp(Y, { name: "ButtonIcon", Cb: "MinusLine", Ca: Bd }, (new ah("figure", "isTreeExpanded", function (a, c) { var d = c.O; return a ? d._treeExpandedFigure : d._treeCollapsedFigure })).Ox()), { visible: !1 }, (new ah("visible", "isTreeLeaf", function (a) { return !a })).Ox()); a.click = function (a, c) { var d = c.U; d instanceof jh && (d = d.uf); if (d instanceof U) { var e = d.g; if (null !== e) { e = e.ob; if (d.tc) { if (!e.canCollapseTree(d)) return } else if (!e.canExpandTree(d)) return; a.Cc = !0; d.tc ? e.collapseTree(d) : e.expandTree(d) } } }; return a }); ep("SubGraphExpanderButton", function () { var a = bp("Button", { _subGraphExpandedFigure: "MinusLine", _subGraphCollapsedFigure: "PlusLine" }, bp(Y, { name: "ButtonIcon", Cb: "MinusLine", Ca: Bd }, (new ah("figure", "isSubGraphExpanded", function (a, c) { var d = c.O; return a ? d._subGraphExpandedFigure : d._subGraphCollapsedFigure })).Ox())); a.click = function (a, c) { var d = c.U; d instanceof jh && (d = d.uf); if (d instanceof V) { var e = d.g; if (null !== e) { e = e.ob; if (d.hd) { if (!e.canCollapseSubGraph(d)) return } else if (!e.canExpandSubGraph(d)) return; a.Cc = !0; d.hd ? e.collapseSubGraph(d) : e.expandSubGraph(d) } } }; return a }); ep("ContextMenuButton", function () { var a = bp("Button"); a.stretch = qo; var b = a.xd("ButtonBorder"); b instanceof Y && (b.Cb = "Rectangle", b.A = new L(0, 0, 2, 3), b.B = new L(1, 1, -2, -2)); return a }); ep("PanelExpanderButton", function (a) { var b = fp(a, "COLLAPSIBLE"), c = bp("Button", { _buttonExpandedFigure: "TriangleUp", _buttonCollapsedFigure: "TriangleDown" }, bp(Y, "TriangleUp", { name: "ButtonIcon", Ca: new ia(6, 4) }, (new ah("figure", "visible", function (a) { return a ? c._buttonExpandedFigure : c._buttonCollapsedFigure })).Ox(b))); a = c.xd("ButtonBorder"); a instanceof Y && (a.stroke = null, a.fill = "transparent"); c.click = function (a, c) { var f = c.g; if (null !== f && !f.hb) { var h = c.Rl(); null === h && (h = c.U); null !== h && (h = h.xd(b), null !== h && (f.Pb("Collapse/Expand Panel"), h.visible = !h.visible, f.wd("Collapse/Expand Panel"))) } }; return c }); ep("CheckBoxButton", function (a) { var b = fp(a); a = bp("Button", { "ButtonBorder.fill": "white", "ButtonBorder.stroke": "gray", width: 14, height: 14 }, bp(Y, { name: "ButtonIcon", YH: "M0 4 L3 9 9 0", lb: 2, stretch: Fe, pA: Qj, visible: !1 }, "" !== b ? (new ah("visible", b)).QI() : [])); a.click = function (a, d) { var e = a.g; if (!(null === e || e.hb || "" !== b && e.ba.hb)) { a.Cc = !0; var f = d.xd("ButtonIcon"); e.Pb("checkbox"); f.visible = !f.visible; "function" === typeof d._doClick && d._doClick(a, d); e.wd("checkbox") } }; return a }); ep("CheckBox", function (a) { a = fp(a); a = bp("CheckBoxButton", a, { name: "Button", margin: new db(0, 1, 0, 0) }); var b = bp(C, "Horizontal", a, { wx: !0, margin: 1, _buttonFillNormal: a._buttonFillNormal, _buttonStrokeNormal: a._buttonStrokeNormal, _buttonFillOver: a._buttonFillOver, _buttonStrokeOver: a._buttonStrokeOver, _buttonFillDisabled: a._buttonFillDisabled, ru: a.ru, su: a.su, click: a.click, _buttonClick: a.click }); a.ru = null; a.su = null; a.click = null; return b }); function vo() { this.tr = this.Ci = this.ej = this.Bq = this.Eq = this.Dq = this.Cq = this.Ti = this.ls = this.ks = this.Ui = this.Vi = this.Wi = this.ns = this.ms = this.Bi = this.Hi = this.zi = null } vo.prototype.copy = function () { var a = new vo; a.zi = this.zi; a.Hi = this.Hi; a.Bi = this.Bi; a.ms = this.ms; a.ns = this.ns; a.Wi = this.Wi; a.Vi = this.Vi; a.Ui = this.Ui; a.ks = this.ks; a.ls = this.ls; a.Ti = this.Ti; a.Cq = this.Cq; a.Dq = this.Dq; a.Eq = this.Eq; a.Bq = this.Bq; a.ej = this.ej; a.Ci = this.Ci; a.tr = this.tr; return a }; function C(a) { G.call(this); void 0 === a ? this.ma = Tj : (w.mb(a, C, C, "type"), this.ma = a); this.xa = new H(G); this.gf = gd; this.ma === Il && (this.Gn = !0); this.gr = rc; this.Fi = oo; this.ma === So && gp(this); this.Bp = Qj; this.Fr = Dd; this.Gr = ed; this.Cr = 0; this.Br = 100; this.Er = 10; this.Dr = 0; this.Zk = this.Yd = this.Tj = this.ym = this.Am = null; this.Sr = NaN; this.xg = this.$j = null; this.To = "category"; this.wg = null; this.gj = new B(NaN, NaN, NaN, NaN); this.lk = this.Qs = this.en = null; this.Hj = "" } w.Ka(C, G); w.ni(C); w.ga("Panel", C); function gp(a) { a.Lj = gd; a.Qh = 1; a.Ei = null; a.wm = null; a.Ph = 1; a.Oh = null; a.vm = null; a.ae = []; a.Wd = []; a.Wm = hp; a.um = hp; a.fj = 0; a.Pi = 0 } C.prototype.cloneProtected = function (a) { G.prototype.cloneProtected.call(this, a); a.ma = this.ma; a.gf = this.gf.S(); a.gr = this.gr.S(); a.Fi = this.Fi; if (a.ma === So) { a.Lj = this.Lj.S(); a.Qh = this.Qh; a.Ei = this.Ei; a.wm = this.wm; a.Ph = this.Ph; a.Oh = this.Oh; a.vm = this.vm; var b = []; if (0 < this.ae.length) for (var c = this.ae, d = c.length, e = 0; e < d; e++)if (void 0 !== c[e]) { var f = c[e].copy(); f.em(a); b[e] = f } a.ae = b; b = []; if (0 < this.Wd.length) for (c = this.Wd, d = c.length, e = 0; e < d; e++)void 0 !== c[e] && (f = c[e].copy(), f.em(a), b[e] = f); a.Wd = b; a.Wm = this.Wm; a.um = this.um; a.fj = this.fj; a.Pi = this.Pi } a.Bp = this.Bp; a.Fr = this.Fr.S(); a.Gr = this.Gr.S(); a.Cr = this.Cr; a.Br = this.Br; a.Er = this.Er; a.Dr = this.Dr; a.Am = this.Am; a.Tj = this.Tj; a.Yd = this.Yd; a.Zk = this.Zk; a.Sr = this.Sr; a.$j = this.$j; a.xg = this.xg; a.To = this.To; a.gj.assign(this.gj); a.Hj = this.Hj; null !== this.Qs && (a.Qs = this.Qs) }; C.prototype.oi = function (a) { G.prototype.oi.call(this, a); a.xa = this.xa; for (var b = a.xa.n, c = b.length, d = 0; d < c; d++)b[d].nh = a; a.en = null }; C.prototype.copy = function () { var a = G.prototype.copy.call(this); if (null !== a) { for (var b = this.xa.n, c = b.length, d = 0; d < c; d++) { var e = b[d].copy(), f = a; e.em(f); e.Tm = null; var h = f.xa, k = h.count; h.Pd(k, e); h = f.U; if (null !== h) { h.Om = null; null !== e.Td && h instanceof U && (h.Ek = !0); var l = f.g; null !== l && l.oa.ab || h.Zc(Qf, "elements", f, null, e, null, k) } } return a } return null }; C.prototype.ic = function (a) { a.Ee === C ? this.type = a : G.prototype.ic.call(this, a) }; C.prototype.toString = function () { return "Panel(" + this.type + ")#" + w.Nd(this) }; var Tj; C.Position = Tj = w.p(C, "Position", 0); C.Horizontal = w.p(C, "Horizontal", 1); var El; C.Vertical = El = w.p(C, "Vertical", 2); var Mj; C.Spot = Mj = w.p(C, "Spot", 3); var Fl; C.Auto = Fl = w.p(C, "Auto", 4); var So; C.Table = So = w.p(C, "Table", 5); C.Viewbox = w.p(C, "Viewbox", 6); var Jo; C.TableRow = Jo = w.p(C, "TableRow", 7); var Ko; C.TableColumn = Ko = w.p(C, "TableColumn", 8); var hj; C.Link = hj = w.p(C, "Link", 9); var Il; C.Grid = Il = w.p(C, "Grid", 10); var ip; C.Graduated = ip = w.p(C, "Graduated", 11); w.defineProperty(C, { type: "type" }, function () { return this.ma }, function (a) { var b = this.ma; b !== a && (b !== Jo && b !== Ko || w.k("Cannot change Panel.type when it is already a TableRow or a TableColumn: " + a), this.ma = a, this.ma === Il ? this.Gn = !0 : this.ma === So && gp(this), this.H(), this.h("type", b, a)) }); w.u(C, { elements: "elements" }, function () { return this.xa.i }); w.u(C, { Ja: "naturalBounds" }, function () { return this.Uc }); w.defineProperty(C, { padding: "padding" }, function () { return this.gf }, function (a) { "number" === typeof a ? (0 > a && w.Fa(a, ">= 0", C, "padding"), a = new db(a)) : (w.G(a, db, C, "padding"), 0 > a.left && w.Fa(a.left, ">= 0", C, "padding:value.left"), 0 > a.right && w.Fa(a.right, ">= 0", C, "padding:value.right"), 0 > a.top && w.Fa(a.top, ">= 0", C, "padding:value.top"), 0 > a.bottom && w.Fa(a.bottom, ">= 0", C, "padding:value.bottom")); var b = this.gf; b.L(a) || (this.gf = a = a.S(), this.H(), this.h("padding", b, a)) }); w.defineProperty(C, { Nl: "defaultAlignment" }, function () { return this.gr }, function (a) { var b = this.gr; b.L(a) || (this.gr = a = a.S(), this.H(), this.h("defaultAlignment", b, a)) }); w.defineProperty(C, { be: "defaultStretch" }, function () { return this.Fi }, function (a) { var b = this.Fi; b !== a && (w.mb(a, G, C, "defaultStretch"), this.Fi = a, this.H(), this.h("defaultStretch", b, a)) }); w.defineProperty(C, { QK: "defaultSeparatorPadding" }, function () { return void 0 === this.Lj ? gd : this.Lj }, function (a) { if (void 0 !== this.Lj) { "number" === typeof a && (a = new db(a)); var b = this.Lj; b.L(a) || (this.Lj = a = a.S(), this.H(), this.h("defaultSeparatorPadding", b, a)) } }); w.defineProperty(C, { OK: "defaultRowSeparatorStroke" }, function () { return void 0 === this.Ei ? null : this.Ei }, function (a) { var b = this.Ei; b !== a && (null === a || "string" === typeof a || a instanceof ha) && (a instanceof ha && a.freeze(), this.Ei = a, this.na(), this.h("defaultRowSeparatorStroke", b, a)) }); w.defineProperty(C, { PK: "defaultRowSeparatorStrokeWidth" }, function () { return void 0 === this.Qh ? 1 : this.Qh }, function (a) { if (void 0 !== this.Qh) { var b = this.Qh; b !== a && isFinite(a) && 0 <= a && (this.Qh = a, this.H(), this.h("defaultRowSeparatorStrokeWidth", b, a)) } }); w.defineProperty(C, { NK: "defaultRowSeparatorDashArray" }, function () { return void 0 === this.wm ? null : this.wm }, function (a) { if (void 0 !== this.wm) { var b = this.wm; if (b !== a) { null === a || Array.isArray(a) || w.Bd(a, "Array", C, "defaultRowSeparatorDashArray:value"); if (null !== a) { for (var c = a.length, d = 0, e = 0; e < c; e++) { var f = a[e]; "number" === typeof f && 0 <= f && isFinite(f) || w.k("defaultRowSeparatorDashArray value " + f + " at index " + e + " must be a positive number or zero."); d += f } if (0 === d) { if (null === b) return; a = null } } this.wm = a; this.na(); this.h("defaultRowSeparatorDashArray", b, a) } } }); w.defineProperty(C, { IK: "defaultColumnSeparatorStroke" }, function () { return void 0 === this.Oh ? null : this.Oh }, function (a) { if (void 0 !== this.Oh) { var b = this.Oh; b !== a && (null === a || "string" === typeof a || a instanceof ha) && (a instanceof ha && a.freeze(), this.Oh = a, this.na(), this.h("defaultColumnSeparatorStroke", b, a)) } }); w.defineProperty(C, { JK: "defaultColumnSeparatorStrokeWidth" }, function () { return void 0 === this.Ph ? 1 : this.Ph }, function (a) { if (void 0 !== this.Ph) { var b = this.Ph; b !== a && isFinite(a) && 0 <= a && (this.Ph = a, this.H(), this.h("defaultColumnSeparatorStrokeWidth", b, a)) } }); w.defineProperty(C, { HK: "defaultColumnSeparatorDashArray" }, function () { return void 0 === this.vm ? null : this.vm }, function (a) { if (void 0 !== this.vm) { var b = this.vm; if (b !== a) { null === a || Array.isArray(a) || w.Bd(a, "Array", C, "defaultColumnSeparatorDashArray:value"); if (null !== a) { for (var c = a.length, d = 0, e = 0; e < c; e++) { var f = a[e]; "number" === typeof f && 0 <= f && isFinite(f) || w.k("defaultColumnSeparatorDashArray value " + f + " at index " + e + " must be a positive number or zero."); d += f } if (0 === d) { if (null === b) return; a = null } } this.vm = a; this.na(); this.h("defaultColumnSeparatorDashArray", b, a) } } }); w.defineProperty(C, { $L: "viewboxStretch" }, function () { return this.Bp }, function (a) { var b = this.Bp; b !== a && (w.mb(a, G, C, "viewboxStretch"), this.Bp = a, this.H(), this.h("viewboxStretch", b, a)) }); w.defineProperty(C, { ux: "gridCellSize" }, function () { return this.Fr }, function (a) { var b = this.Fr; if (!b.L(a)) { w.G(a, ia, C, "gridCellSize"); a.I() && 0 !== a.width && 0 !== a.height || w.k("Invalid Panel.gridCellSize: " + a); this.Fr = a.S(); var c = this.g; null !== c && this === c.Dn && bm(c); this.na(); this.h("gridCellSize", b, a) } }); w.defineProperty(C, { cF: "gridOrigin" }, function () { return this.Gr }, function (a) { var b = this.Gr; if (!b.L(a)) { w.G(a, z, C, "gridOrigin"); a.I() || w.k("Invalid Panel.gridOrigin: " + a); this.Gr = a.S(); var c = this.g; null !== c && this === c.Dn && bm(c); this.na(); this.h("gridOrigin", b, a) } }); w.defineProperty(C, { Dk: "graduatedMin" }, function () { return this.Cr }, function (a) { w.vd(a, C, "graduatedMin"); var b = this.Cr; b !== a && (this.Cr = a, this.H(), this.h("graduatedMin", b, a), zo(this) && (a = this.U, null !== a && Ao(this, a, "graduatedRange"))) }); w.defineProperty(C, { sA: "graduatedMax" }, function () { return this.Br }, function (a) { w.vd(a, C, "graduatedMax"); var b = this.Br; b !== a && (this.Br = a, this.H(), this.h("graduatedMax", b, a), zo(this) && (a = this.U, null !== a && Ao(this, a, "graduatedRange"))) }); w.u(C, { Yt: "graduatedRange" }, function () { return this.sA - this.Dk }); w.defineProperty(C, { tA: "graduatedTickUnit" }, function () { return this.Er }, function (a) { w.vd(a, C, "graduatedTickUnit"); var b = this.Er; b !== a && 0 < a && (this.Er = a, this.H(), this.h("graduatedTickUnit", b, a)) }); w.defineProperty(C, { bF: "graduatedTickBase" }, function () { return this.Dr }, function (a) { w.vd(a, C, "graduatedTickBase"); var b = this.Dr; b !== a && (this.Dr = a, this.H(), this.h("graduatedTickBase", b, a)) }); g = C.prototype; g.us = function (a) { G.prototype.us.call(this, a); for (var b = this.xa.n, c = b.length, d = 0; d < c; d++)b[d].us(a) }; g.yk = function (a, b) { if (this.ma === Il) { var c = this.pj() * b.scale; 0 >= c && (c = 1); var d = this.ux, e = d.width, d = d.height, f = this.Ja, h = f.width, f = f.height, k = Math.ceil(h / e), l = Math.ceil(f / d), m = this.cF; a.save(); a.beginPath(); a.rect(0, 0, h, f); a.clip(); for (var n = [], p = this.xa.n, q = p.length, r = 0; r < q; r++) { var s = p[r], u = []; n.push(u); if (s.visible) for (var s = Xm(s.Cb), t = r + 1; t < q; t++) { var x = p[t]; x.visible && Xm(x.Cb) === s && (x = x.interval, 2 <= x && u.push(x)) } } p = this.xa.n; q = p.length; for (r = 0; r < q; r++) { var v = p[r]; if (v.visible && (u = v.interval, !(2 > e * u * c))) { s = v.opacity; t = 1; if (1 !== s) { if (0 === s) continue; t = a.globalAlpha; a.globalAlpha = t * s } var x = n[r], A = !1, y = !0, K = v.qG; null !== K && (A = !0, y = a.kA(K, v.tf)); if ("LineV" === v.Cb && null !== v.stroke) { a.lineWidth = v.lb; No(this, a, v.stroke, !1, !1); a.beginPath(); for (var E = Math.floor(-m.x / e), Q = E; Q <= E + k; Q++) { var X = Q * e + m.x; 0 <= X && X <= h && jp(Q, u, x) && (A && !y ? yo(a, X, 0, X, f, K, v.tf) : (a.moveTo(X, 0), a.lineTo(X, f))) } a.stroke() } else if ("LineH" === v.Cb && null !== v.stroke) { a.lineWidth = v.lb; No(this, a, v.stroke, !1, !1); a.beginPath(); for (Q = E = Math.floor(-m.y / d); Q <= E + l; Q++)X = Q * d + m.y, 0 <= X && X <= f && jp(Q, u, x) && (A && !y ? yo(a, 0, X, h, X, K, v.tf) : (a.moveTo(0, X), a.lineTo(h, X))); a.stroke() } else if ("BarV" === v.Cb && null !== v.fill) for (No(this, a, v.fill, !0, !1), v = v.width, isNaN(v) && (v = e), Q = E = Math.floor(-m.x / e); Q <= E + k; Q++)X = Q * e + m.x, 0 <= X && X <= h && jp(Q, u, x) && a.fillRect(X, 0, v, f); else if ("BarH" === v.Cb && null !== v.fill) for (No(this, a, v.fill, !0, !1), v = v.height, isNaN(v) && (v = d), Q = E = Math.floor(-m.y / d); Q <= E + l; Q++)X = Q * d + m.y, 0 <= X && X <= f && jp(Q, u, x) && a.fillRect(0, X, h, v); A && a.hA(); 1 !== s && (a.globalAlpha = t) } } a.restore(); a.Fe(!1) } else if (this.ma === ip) { e = this.Ja; c = e.width; e = e.height; a.save(); a.beginPath(); a.rect(-1, -1, c + 1, e + 1); a.clip(); c = this.Kd(); c.ue(a, b); e = this.pj() * b.scale; 0 >= e && (e = 1); d = c.Y; h = this.xa.n; f = this.Am; k = h.length; for (l = 0; l < k; l++)if (q = h[l], m = f[l], n = m.length, q.visible && q !== c && 0 !== m.length) if (q instanceof Y) { if (!(2 > this.tA * q.interval * c.jf.Rt / this.Yt * e)) for (r = q.za, u = q.lb * q.scale, s = q.qh, s.Rd() && (s = yb), p = 0; p < n; p++)t = q, x = m[p][0], A = d, E = m[p][1], Q = r, v = u, y = s, K = t.fd, K.reset(), K.translate(x.x + A.x, x.y + A.y), K.rotate(E + t.angle, 0, 0), K.translate(-Q.width * y.x + y.offsetX + v / 2, -Q.height * y.y + y.offsetY + v / 2), K.scale(t.scale, t.scale), Po(t, !1), t.pm.set(t.fd), t.Co = t.scale, Qo(t, !1), q.ue(a, b), q.fd.reset() } else if (q instanceof Hh) for (null === this.lk && (this.lk = new Hh), r = this.lk, kp(q, r), p = 0; p < n; p++)x = m[p], 3 < x.length && (s = x[6], r.Hd = x[2], r.lg = x[3], r.le = x[4], r.sf = x[5], r.Uc = x[8], r.jc(s.x, s.y, s.width, s.height), q = r, u = d, t = x[7], x = x[8], A = q.fd, A.reset(), A.translate(s.x + u.x, s.y + u.y), A.translate(-t.x, -t.y), Co(q, A, x.x, x.y, x.width, x.height), Po(q, !1), q.pm.set(q.fd), q.Co = q.scale, Qo(q, !1), r.ue(a, b)); a.restore(); a.Fe(!0) } else { this.ma === So && (a.lineCap = "butt", Jp(this, a, !0, this.ae, !0), Jp(this, a, !1, this.Wd, !0), Kp(this, a, !0, this.ae), Kp(this, a, !1, this.Wd), Jp(this, a, !0, this.ae, !1), Jp(this, a, !1, this.Wd, !1)); (c = this.cu) && a.save(); e = this.Kd(); d = this.xa.n; h = d.length; for (f = 0; f < h; f++)k = d[f], c && k === e && (a.Hp = !0), k.ue(a, b), c && k === e && (a.Hp = !1); c && (a.restore(), a.Fe(!0)) } }; function kp(a, b) { b.P = a.P | 6144; b.yc = a.yc; b.Eb = a.Eb; b.bc = a.bc; b.Se = a.Se.S(); b.Zh = a.Zh.S(); b.Yh = a.Yh.S(); b.Ri = a.Ri.copy(); b.ub = a.ub; b.lg = a.lg; b.Fg = a.Fg; b.Mm = a.Mm.S(); b.ie = a.ie.S(); b.om = a.om.S(); b.Xm = a.Xm; b.Ym = a.Ym.S(); b.Zm = a.Zm; null !== a.og && (b.og = a.og.copy()); b.cn = a.cn; a instanceof Hh && (b.Hd = a.Hd, b.rc = a.rc, b.qg = a.qg, b.xl = a.xl, b.pg = a.pg, b.Bl = a.Bl, b.Em = a.Em, b.Zj = a.Zj, b.Yj = a.Yj, b.Yi = a.Yi, b.rk = a.rk, b.sf.Oj = null, b.fi = a.fi, b.gi = a.gi, b.hh = a.hh, b.Wo = a.Wo, b.ug = a.ug, b.tg = a.tg, b.sg = a.sg, b.zm = a.zm) } function Kp(a, b, c, d) { for (var e = d.length, f = a.Y, h = c ? a.Md(0) : a.Ld(0), k = 0; k < e; k++) { var l = d[k]; if (void 0 !== l && l !== h && 0 !== l.Ya) { if (c) { if (l.position > f.height) continue } else if (l.position > f.width) continue; var m = l.sq; isNaN(m) && (m = c ? a.Qh : a.Ph); var n = l.rq; null === n && (n = c ? a.Ei : a.Oh); 0 !== m && null !== n && (No(a, b, n, !1, !1), b.beginPath(), n = l.position + m, c ? n > f.height && (m -= n - f.height) : n > f.width && (m -= n - f.width), l = l.position + m / 2, b.lineWidth = m, n = a.padding, c ? (l += n.top, m = n.left, n = f.width - n.right, b.moveTo(m, l), b.lineTo(n, l)) : (l += n.left, m = n.top, n = f.height - n.bottom, b.moveTo(l, m), b.lineTo(l, n)), b.stroke()) } } } function Jp(a, b, c, d, e) { for (var f = d.length, h = a.Y, k = 0; k < f; k++) { var l = d[k]; if (void 0 !== l && null !== l.background && l.fA !== e && 0 !== l.Ya) { var m = c ? h.height : h.width; if (!(l.position > m)) { var n = l.Ze(), p = l.sq; isNaN(p) && (p = c ? a.Qh : a.Ph); var q = l.rq; null === q && (q = c ? a.Ei : a.Oh); null === q && (p = 0); n -= p; p = l.position + p; n += l.Ya; p + n > m && (n = m - p); 0 >= n || (m = a.padding, No(a, b, l.background, !0, !1), c ? b.fillRect(m.left, p + m.top, h.width - (m.left + m.right), n) : b.fillRect(p + m.left, m.top, n, h.height - (m.top + m.bottom))) } } } } function jp(a, b, c) { if (0 !== a % b) return !1; b = c.length; for (var d = 0; d < b; d++)if (0 === a % c[d]) return !1; return !0 } function Xm(a) { return "LineV" === a || "BarV" === a } g.Bn = function (a, b, c, d, e) { var f = this.ah(), h = this.transform, k = 1 / (h.m11 * h.m22 - h.m12 * h.m21), l = h.m22 * k, m = -h.m12 * k, n = -h.m21 * k, p = h.m11 * k, q = k * (h.m21 * h.dy - h.m22 * h.dx), r = k * (h.m12 * h.dx - h.m11 * h.dy); if (null !== this.kn) return h = this.Y, me(h.left, h.top, h.right, h.bottom, a, b, c, d, e); if (null !== this.background) f = a * l + b * n + q, k = a * m + b * p + r, a = c * l + d * n + q, l = c * m + d * p + r, e.m(0, 0), c = this.Ja, c = me(0, 0, c.width, c.height, f, k, a, l, e), e.transform(h); else { f || (l = 1, n = m = 0, p = 1, r = q = 0); k = a * l + b * n + q; a = a * m + b * p + r; l = c * l + d * n + q; d = c * m + d * p + r; e.m(l, d); m = (l - k) * (l - k) + (d - a) * (d - a); c = !1; p = this.xa.n; r = p.length; n = w.K(); q = null; b = Infinity; var s = null; this.cu && (s = w.K(), q = this.Kd(), (c = q.Bn(k, a, l, d, s)) && (b = (k - s.x) * (k - s.x) + (a - s.y) * (a - s.y))); for (var u = 0; u < r; u++) { var t = p[u]; t.visible && t !== q && t.Bn(k, a, l, d, n) && (c = !0, t = (k - n.x) * (k - n.x) + (a - n.y) * (a - n.y), t < m && (m = t, e.set(n))) } this.cu && (b > m && e.set(s), w.v(s)); w.v(n); f && e.transform(h) } return c }; g.H = function (a) { G.prototype.H.call(this, a); if (this.ma === Fl || this.ma === hj) a = this.Kd(), null !== a && a.H(!0); a = this.xa.n; for (var b = a.length, c = 0; c < b; c++) { var d = a[c]; if (!d.Ca.I()) { var e = Eo(d, !1); (d instanceof Nj || d instanceof C || d instanceof Hh || e !== Oj) && d.H(!0) } } }; g.Zp = function () { if (!1 === Cm(this)) { am(this, !0); Fo(this, !0); for (var a = this.xa.n, b = a.length, c = 0; c < b; c++)a[c].Zp() } }; g.Li = function () { if (0 !== (this.P & 2048) === !1) { Po(this, !0); Qo(this, !0); for (var a = this.xa.n, b = a.length, c = 0; c < b; c++)a[c].zA() } }; g.zA = function () { Qo(this, !0); for (var a = this.xa.n, b = a.length, c = 0; c < b; c++)a[c].zA() }; g.Nn = function (a, b, c, d) { var e = this.gj; e.width = 0; e.height = 0; var f = this.Ca, h = this.Bh; void 0 === c && (c = h.width, d = h.height); c = Math.max(c, h.width); d = Math.max(d, h.height); var k = this.Ff; isNaN(f.width) || (a = Math.min(f.width, k.width)); isNaN(f.height) || (b = Math.min(f.height, k.height)); a = Math.max(c, a); b = Math.max(d, b); var l = this.padding; a = Math.max(a - l.left - l.right, 0); b = Math.max(b - l.top - l.bottom, 0); var m = this.xa.n; if (0 !== m.length) { var n = this.ma.Sb; switch (n) { case "Position": var p = a, q = b, r = c, s = d, u = m.length; e.x = 0; e.y = 0; e.width = 0; e.height = 0; for (var t = Lp(this), x = 0; x < u; x++) { var v = m[x]; if (v.visible || v === t) { var A = v.margin, y = A.right + A.left, K = A.top + A.bottom; xk(v, p, q, r, s); var E = v.za, Q = Math.max(E.width + y, 0), X = Math.max(E.height + K, 0), O = v.position.x, aa = v.position.y; isFinite(O) || (O = 0); isFinite(aa) || (aa = 0); if (v instanceof Y) { var da = v; if (da.nF) var S = da.lb / 2, O = O - S, aa = aa - S } $a(e, O, aa, Q, X) } } break; case "Vertical": for (var Ra = a, gb = c, qa = m.length, Ja = w.cb(), za = Lp(this), Tb = 0; Tb < qa; Tb++) { var Ob = m[Tb]; if (Ob.visible || Ob === za) { var $d = Eo(Ob, !1); if ($d !== Oj && $d !== po) Ja.push(Ob); else { var sd = Ob.margin, uc = sd.right + sd.left, Ag = sd.top + sd.bottom; xk(Ob, Ra, Infinity, gb, 0); var Ff = Ob.za, Ua = Math.max(Ff.width + uc, 0), nb = Math.max(Ff.height + Ag, 0); e.width = Math.max(e.width, Ua); e.height += nb } } } var na = Ja.length; if (0 !== na) { this.Ca.width ? Ra = Math.min(this.Ca.width, this.Ff.width) : 0 !== e.width && (Ra = Math.min(e.width, this.Ff.width)); for (Tb = 0; Tb < na; Tb++)if (Ob = Ja[Tb], Ob.visible || Ob === za) sd = Ob.margin, uc = sd.right + sd.left, Ag = sd.top + sd.bottom, xk(Ob, Ra, Infinity, gb, 0), Ff = Ob.za, Ua = Math.max(Ff.width + uc, 0), nb = Math.max(Ff.height + Ag, 0), e.width = Math.max(e.width, Ua), e.height += nb; w.ua(Ja) } break; case "Horizontal": for (var ma = b, hb = d, ib = m.length, fb = w.cb(), qe = Lp(this), Hd = 0; Hd < ib; Hd++) { var ub = m[Hd]; if (ub.visible || ub === qe) { var Ie = Eo(ub, !1); if (Ie !== Oj && Ie !== qo) fb.push(ub); else { var hd = ub.margin, cg = hd.right + hd.left, Gf = hd.top + hd.bottom; xk(ub, Infinity, ma, 0, hb); var Bg = ub.za, jb = Math.max(Bg.width + cg, 0), zc = Math.max(Bg.height + Gf, 0); e.width += jb; e.height = Math.max(e.height, zc) } } } var td = fb.length; if (0 !== td) { this.Ca.height ? ma = Math.min(this.Ca.height, this.Ff.height) : 0 !== e.height && (ma = Math.min(e.height, this.Ff.height)); for (Hd = 0; Hd < td; Hd++)if (ub = fb[Hd], ub.visible || ub === qe) hd = ub.margin, cg = hd.right + hd.left, Gf = hd.top + hd.bottom, xk(ub, Infinity, ma, 0, hb), Bg = ub.za, jb = Math.max(Bg.width + cg, 0), zc = Math.max(Bg.height + Gf, 0), e.width += jb, e.height = Math.max(e.height, zc); w.ua(fb) } break; case "Spot": a: { var dg = a, Eb = b, Pb = c, re = d, Cg = m.length, Id = this.Kd(), ob = Id.margin, Nc = 0, Hf = 0, Je = ob.right + ob.left, ai = ob.top + ob.bottom; xk(Id, dg, Eb, Pb, re); for (var Sa = Id.za, ab = Sa.width, Ac = Sa.height, vc = Math.max(ab + Je, 0), Yc = Math.max(Ac + ai, 0), ph = this.cu, Wa = w.jg(-ob.left, -ob.top, vc, Yc), zb = !0, vb = Lp(this), Bc = 0; Bc < Cg; Bc++) { var Ab = m[Bc]; if (Ab !== Id && (Ab.visible || Ab === vb)) { ob = Ab.margin; Nc = ob.right + ob.left; Hf = ob.top + ob.bottom; xk(Ab, dg, Eb, 0, 0); var Sa = Ab.za, vc = Math.max(Sa.width + Nc, 0), Yc = Math.max(Sa.height + Hf, 0), pb = Ab.alignment; pb.Wc() && (pb = this.Nl); pb.Xc() || (pb = Hb); var Ib = Ab.qh; Ib.Wc() && (Ib = Hb); var ae = null; Ab instanceof C && "" !== Ab.Hj && (Ab.jc(0, 0, Sa.width, Sa.height), ae = Ab.xd(Ab.Hj), ae === Ab && (ae = null)); var Fb, Ub; if (null !== ae) { for (var id = ae.Ja, bi = ae.margin, Qb = w.xb(Ib.x * id.width + Ib.offsetX - bi.left, Ib.y * id.height + Ib.offsetY - bi.top); ae !== Ab;)ae.transform.nb(Qb), ae = ae.O; Fb = pb.x * ab + pb.offsetX - Qb.x; Ub = pb.y * Ac + pb.offsetY - Qb.y; w.v(Qb) } else Fb = pb.x * ab + pb.offsetX - (Ib.x * Sa.width - Ib.offsetX) - ob.left, Ub = pb.y * Ac + pb.offsetY - (Ib.y * Sa.height - Ib.offsetY) - ob.top; zb ? (zb = !1, e.x = Fb, e.y = Ub, e.width = vc, e.height = Yc) : $a(e, Fb, Ub, vc, Yc) } } zb ? e.assign(Wa) : ph ? e.hF(Wa.x, Wa.y, Wa.width, Wa.height) : $a(e, Wa.x, Wa.y, Wa.width, Wa.height); w.Db(Wa); var Rb = Id.stretch; Rb === oo && (Rb = Eo(Id, !1)); switch (Rb) { case Oj: break a; case Fe: if (!isFinite(dg) && !isFinite(Eb)) break a; break; case qo: if (!isFinite(dg)) break a; break; case po: if (!isFinite(Eb)) break a }Sa = Id.za; ab = Sa.width; Ac = Sa.height; vc = Math.max(ab + Je, 0); Yc = Math.max(Ac + ai, 0); ob = Id.margin; Wa = w.jg(-ob.left, -ob.top, vc, Yc); for (Bc = 0; Bc < Cg; Bc++)Ab = m[Bc], Ab === Id || !Ab.visible && Ab !== vb || (ob = Ab.margin, Nc = ob.right + ob.left, Hf = ob.top + ob.bottom, Sa = Ab.za, vc = Math.max(Sa.width + Nc, 0), Yc = Math.max(Sa.height + Hf, 0), pb = Ab.alignment, pb.Wc() && (pb = this.Nl), pb.Xc() || (pb = Hb), Ib = Ab.qh, Ib.Wc() && (Ib = Hb), zb ? (zb = !1, e.x = pb.x * ab + pb.offsetX - (Ib.x * Sa.width - Ib.offsetX) - ob.left, e.y = pb.y * Ac + pb.offsetY - (Ib.y * Sa.height - Ib.offsetY) - ob.top, e.width = vc, e.height = Yc) : $a(e, pb.x * ab + pb.offsetX - (Ib.x * Sa.width - Ib.offsetX) - ob.left, pb.y * Ac + pb.offsetY - (Ib.y * Sa.height - Ib.offsetY) - ob.top, vc, Yc)); zb ? e.assign(Wa) : ph ? e.hF(Wa.x, Wa.y, Wa.width, Wa.height) : $a(e, Wa.x, Wa.y, Wa.width, Wa.height); w.Db(Wa) } break; case "Auto": var Cc = a, Zc = b, ud = c, Dg = d, ci = m.length, qb = this.Kd(), $c = qb.margin, di = Cc, Ke = Zc, jc = $c.right + $c.left, se = $c.top + $c.bottom; xk(qb, Cc, Zc, ud, Dg); var bc = qb.za, Dc = 0, vd = null; qb instanceof Y && (vd = qb, Dc = vd.lb * vd.scale); var kc = Math.max(bc.width + jc, 0), Ta = Math.max(bc.height + se, 0), lc = Mp(qb), ei = lc.x * kc + lc.offsetX, Ze = lc.y * Ta + lc.offsetY, Jd = Np(qb), Le = Jd.x * kc + Jd.offsetX, qh = Jd.y * Ta + Jd.offsetY; isFinite(Cc) && (di = Math.max(Math.abs(ei - Le) - Dc, 0)); isFinite(Zc) && (Ke = Math.max(Math.abs(Ze - qh) - Dc, 0)); var Kd = w.jm(); Kd.m(0, 0); for (var rh = Lp(this), pj = 0; pj < ci; pj++) { var sh = m[pj]; if (sh !== qb && (sh.visible || sh === rh)) { var $c = sh.margin, Ek = $c.right + $c.left, rb = $c.top + $c.bottom; xk(sh, di, Ke, 0, 0); bc = sh.za; kc = Math.max(bc.width + Ek, 0); Ta = Math.max(bc.height + rb, 0); Kd.m(Math.max(kc, Kd.width), Math.max(Ta, Kd.height)) } } if (1 === ci) e.width = kc, e.height = Ta, w.Bk(Kd); else { var lc = Mp(qb), Jd = Np(qb), be = 0, jd = 0; Jd.x !== lc.x && Jd.y !== lc.y && (be = Kd.width / Math.abs(Jd.x - lc.x), jd = Kd.height / Math.abs(Jd.y - lc.y)); w.Bk(Kd); Dc = 0; null !== vd && (Dc = vd.lb * vd.scale, Pj(vd) === Qj && (be = jd = Math.max(be, jd))); var be = be + (Math.abs(lc.offsetX) + Math.abs(Jd.offsetX) + Dc), jd = jd + (Math.abs(lc.offsetY) + Math.abs(Jd.offsetY) + Dc), Me = qb.stretch; Me === oo && (Me = Eo(qb, !1)); switch (Me) { case Oj: Dg = ud = 0; break; case Fe: isFinite(Cc) && (be = Cc); isFinite(Zc) && (jd = Zc); break; case qo: isFinite(Cc) && (be = Cc); Dg = 0; break; case po: ud = 0, isFinite(Zc) && (jd = Zc) }qb.Zp(); xk(qb, be, jd, ud, Dg); e.width = qb.za.width + jc; e.height = qb.za.height + se } break; case "Table": for (var fi = a, gi = b, qj = c, rj = d, Bb = m.length, th = w.cb(), uh = w.cb(), ga = 0; ga < Bb; ga++) { var ba = m[ga], ce = ba instanceof C ? ba : null; if (null === ce || ce.type !== Jo && ce.type !== Ko || !ba.visible) th.push(ba); else { uh.push(ce); for (var eg = ce.xa.n, hi = eg.length, Cb = 0; Cb < hi; Cb++) { var ii = eg[Cb]; ce.type === Jo ? ii.Vb = ba.Vb : ce.type === Ko && (ii.column = ba.column); th.push(ii) } } } Bb = th.length; 0 === Bb && (this.Md(0), this.Ld(0)); for (var Sb = [], ga = 0; ga < Bb; ga++)ba = th[ga], am(ba, !0), Fo(ba, !0), Sb[ba.Vb] || (Sb[ba.Vb] = []), Sb[ba.Vb][ba.column] || (Sb[ba.Vb][ba.column] = []), Sb[ba.Vb][ba.column].push(ba); w.ua(th); for (var $e = w.cb(), Ne = w.cb(), af = w.cb(), te = { count: 0 }, ue = { count: 0 }, ad = fi, Ld = gi, vh = this.ae, Bb = vh.length, ga = 0; ga < Bb; ga++) { var Z = vh[ga]; void 0 !== Z && (Z.Ya = 0) } vh = this.Wd; Bb = vh.length; for (ga = 0; ga < Bb; ga++)Z = vh[ga], void 0 !== Z && (Z.Ya = 0); for (var kd = Sb.length, fg = 0, ga = 0; ga < kd; ga++)Sb[ga] && (fg = Math.max(fg, Sb[ga].length)); for (var ji = Math.min(this.fj, kd - 1), wh = Math.min(this.Pi, fg - 1), mc = 0, kd = Sb.length, xh = Lp(this), ga = 0; ga < kd; ga++)if (Sb[ga]) for (var fg = Sb[ga].length, kb = this.Md(ga), Cb = kb.Ya = 0; Cb < fg; Cb++)if (Sb[ga][Cb]) { var lb = this.Ld(Cb); void 0 === $e[Cb] && (lb.Ya = 0, $e[Cb] = !0); for (var dm = Sb[ga][Cb], bf = dm.length, Fk = 0; Fk < bf; Fk++)if (ba = dm[Fk], ba.visible || ba === xh) { var ki = 1 < ba.bj || 1 < ba.Ai; ki && (ga < ji || Cb < wh || Ne.push(ba)); var wc = ba.margin, If = wc.right + wc.left, gg = wc.top + wc.bottom, Jb = To(ba, kb, lb, !1), cf = ba.Ca, Gk = !isNaN(cf.height), em = !isNaN(cf.width) && Gk; ki || Jb === Oj || em || ga < ji || Cb < wh || (void 0 !== te[Cb] || Jb !== Fe && Jb !== qo || (te[Cb] = -1, te.count++), void 0 !== ue[ga] || Jb !== Fe && Jb !== po || (ue[ga] = -1, ue.count++), af.push(ba)); xk(ba, Infinity, Infinity, 0, 0); if (!(ga < ji || Cb < wh)) { var Jf = ba.za, df = Math.max(Jf.width + If, 0), ef = Math.max(Jf.height + gg, 0); if (1 === ba.bj && (Jb === Oj || Jb === qo)) { var Z = this.Md(ga), nc = Z.Ze(), mc = Math.max(ef - Z.Ya, 0); mc + nc > Ld && (mc = Math.max(Ld - nc, 0)); var hg = 0 === Z.Ya; Z.Ya += mc; Ld = Math.max(Ld - (mc + (hg ? nc : 0)), 0) } 1 !== ba.Ai || Jb !== Oj && Jb !== po || (Z = this.Ld(Cb), nc = Z.Ze(), mc = Math.max(df - Z.Ya, 0), mc + nc > ad && (mc = Math.max(ad - nc, 0)), hg = 0 === Z.Ya, Z.Ya += mc, ad = Math.max(ad - (mc + (hg ? nc : 0)), 0)); ki && ba.Zp() } } } w.ua($e); for (var Ec = 0, wb = 0, Bb = this.Ip, ga = 0; ga < Bb; ga++) { var li = this.Wd[ga]; void 0 !== li && (Ec += li.Ra, 0 !== li.Ra && (Ec += li.Ze())) } Bb = this.pq; for (ga = 0; ga < Bb; ga++) { var Eg = this.ae[ga]; void 0 !== Eg && (wb += Eg.Ra, 0 !== Eg.Ra && (wb += Eg.Ze())) } for (var ad = Math.max(fi - Ec, 0), sj = Ld = Math.max(gi - wb, 0), lp = ad, Bb = af.length, ga = 0; ga < Bb; ga++) { var ba = af[ga], kb = this.Md(ba.Vb), lb = this.Ld(ba.column), Fg = ba.za, wc = ba.margin, If = wc.right + wc.left, gg = wc.top + wc.bottom; te[ba.column] = 0 === lb.Ya && void 0 !== te[ba.column] ? Math.max(Fg.width + If, te[ba.column]) : null; ue[ba.Vb] = 0 === kb.Ya && void 0 !== ue[ba.Vb] ? Math.max(Fg.height + gg, ue[ba.Vb]) : null } var Kf = 0, Gg = 0, Hg; for (Hg in ue) "count" !== Hg && (Kf += ue[Hg]); for (Hg in te) "count" !== Hg && (Gg += te[Hg]); for (var mb = w.jm(), ga = 0; ga < Bb; ga++)if (ba = af[ga], ba.visible || ba === xh) { var kb = this.Md(ba.Vb), lb = this.Ld(ba.column), Vb = 0; isFinite(lb.width) ? Vb = lb.width : (Vb = isFinite(ad) && null !== te[ba.column] ? 0 === Gg ? lb.Ya + ad : te[ba.column] / Gg * lp : null !== te[ba.column] ? ad : lb.Ya || ad, Vb = Math.max(0, Vb - lb.Ze())); var Fc = 0; isFinite(kb.height) ? Fc = kb.height : (Fc = isFinite(Ld) && null !== ue[ba.Vb] ? 0 === Kf ? kb.Ya + Ld : ue[ba.Vb] / Kf * sj : null !== ue[ba.Vb] ? Ld : kb.Ya || Ld, Fc = Math.max(0, Fc - kb.Ze())); mb.m(Math.max(lb.Ch, Math.min(Vb, lb.he)), Math.max(kb.Ch, Math.min(Fc, kb.he))); Jb = To(ba, kb, lb, !1); switch (Jb) { case qo: mb.height = Math.max(mb.height, kb.Ya + Ld); break; case po: mb.width = Math.max(mb.width, lb.Ya + ad) }wc = ba.margin; If = wc.right + wc.left; gg = wc.top + wc.bottom; ba.Zp(); xk(ba, mb.width, mb.height, lb.Ch, kb.Ch); Jf = ba.za; df = Math.max(Jf.width + If, 0); ef = Math.max(Jf.height + gg, 0); isFinite(ad) && (df = Math.min(df, mb.width)); isFinite(Ld) && (ef = Math.min(ef, mb.height)); var ff = 0, ff = kb.Ya; kb.Ya = Math.max(kb.Ya, ef); mc = kb.Ya - ff; Ld = Math.max(Ld - mc, 0); ff = lb.Ya; lb.Ya = Math.max(lb.Ya, df); mc = lb.Ya - ff; ad = Math.max(ad - mc, 0) } w.ua(af); var Md = w.jm(), Bb = Ne.length; if (0 !== Bb) for (var wd = w.cb(), gf = w.cb(), ga = 0; ga < kd; ga++)if (Sb[ga]) for (fg = Sb[ga].length, kb = this.Md(ga), wd[ga] = kb.Ya, Cb = 0; Cb < fg; Cb++)Sb[ga][Cb] && (lb = this.Ld(Cb), gf[Cb] = lb.Ya); for (ga = 0; ga < Bb; ga++)if (ba = Ne[ga], ba.visible || ba === xh) { kb = this.Md(ba.Vb); lb = this.Ld(ba.column); mb.m(Math.max(lb.Ch, Math.min(fi, lb.he)), Math.max(kb.Ch, Math.min(gi, kb.he))); Jb = To(ba, kb, lb, !1); switch (Jb) { case Fe: 0 !== gf[lb.index] && (mb.width = Math.min(mb.width, gf[lb.index])); 0 !== wd[kb.index] && (mb.height = Math.min(mb.height, wd[kb.index])); break; case qo: 0 !== gf[lb.index] && (mb.width = Math.min(mb.width, gf[lb.index])); break; case po: 0 !== wd[kb.index] && (mb.height = Math.min(mb.height, wd[kb.index])) }isFinite(lb.width) && (mb.width = lb.width); isFinite(kb.height) && (mb.height = kb.height); Md.m(0, 0); for (var bb = 1; bb < ba.bj && !(ba.Vb + bb >= this.pq); bb++)Z = this.Md(ba.Vb + bb), mc = Jb === Fe || Jb === po ? Math.max(Z.Ch, 0 === wd[ba.Vb + bb] ? Z.he : Math.min(wd[ba.Vb + bb], Z.he)) : Math.max(Z.Ch, isNaN(Z.hf) ? Z.he : Math.min(Z.hf, Z.he)), Md.height += mc; for (bb = 1; bb < ba.Ai && !(ba.column + bb >= this.Ip); bb++)Z = this.Ld(ba.column + bb), mc = Jb === Fe || Jb === qo ? Math.max(Z.Ch, 0 === gf[ba.column + bb] ? Z.he : Math.min(gf[ba.column + bb], Z.he)) : Math.max(Z.Ch, isNaN(Z.hf) ? Z.he : Math.min(Z.hf, Z.he)), Md.width += mc; mb.width += Md.width; mb.height += Md.height; wc = ba.margin; If = wc.right + wc.left; gg = wc.top + wc.bottom; xk(ba, mb.width, mb.height, qj, rj); for (var Jf = ba.za, df = Math.max(Jf.width + If, 0), ef = Math.max(Jf.height + gg, 0), hf = 0, bb = 0; bb < ba.bj && !(ba.Vb + bb >= this.pq); bb++)Z = this.Md(ba.Vb + bb), hf += Z.total || 0; if (hf < ef) { var ld = ef - hf, Ig = ef - hf; if (null !== ba.ny) for (var jf = ba.ny, bb = 0; bb < ba.bj && !(0 >= ld) && !(ba.Vb + bb >= this.pq); bb++) { var Z = this.Md(ba.Vb + bb), Gc = Z.Ra || 0, mi = jf(ba, Z, Ig); Z.Ya = Math.min(Z.he, Gc + mi); Z.Ra !== Gc && (ld -= Z.Ra - Gc) } for (; 0 < ld;) { Gc = Z.Ra || 0; isNaN(Z.height) && Z.he > Gc && (Z.Ya = Math.min(Z.he, Gc + ld), Z.Ra !== Gc && (ld -= Z.Ra - Gc)); if (0 === Z.index) break; Z = this.Md(Z.index - 1) } } for (var Oe = 0, bb = 0; bb < ba.Ai && !(ba.column + bb >= this.Ip); bb++)Z = this.Ld(ba.column + bb), Oe += Z.total || 0; if (Oe < df) { ld = df - Oe; Ig = df - Oe; if (null !== ba.ny) for (jf = ba.ny, bb = 0; bb < ba.Ai && !(0 >= ld) && !(ba.column + bb >= this.Ip); bb++)Z = this.Ld(ba.column + bb), Gc = Z.Ra || 0, mi = jf(ba, Z, Ig), Z.Ya = Math.min(Z.he, Gc + mi), Z.Ra !== Gc && (ld -= Z.Ra - Gc); for (; 0 < ld;) { Gc = Z.Ra || 0; isNaN(Z.width) && Z.he > Gc && (Z.Ya = Math.min(Z.he, Gc + ld), Z.Ra !== Gc && (ld -= Z.Ra - Gc)); if (0 === Z.index) break; Z = this.Ld(Z.index - 1) } } } w.ua(Ne); w.Bk(Md); w.Bk(mb); void 0 !== wd && w.ua(wd); void 0 !== gf && w.ua(gf); for (var Jg = 0, Kg = 0, Jb = Eo(this, !0), tj = this.Ca, Hk = this.Ff, ve = wb = Ec = 0, bd = 0, Bb = this.Ip, ga = 0; ga < Bb; ga++)void 0 !== this.Wd[ga] && (Z = this.Ld(ga), isFinite(Z.width) ? (ve += Z.width, ve += Z.Ze()) : Op(Z) === Pp ? (ve += Z.Ra, ve += Z.Ze()) : 0 !== Z.Ra && (Ec += Z.Ra, Ec += Z.Ze())); var Jg = isFinite(tj.width) ? Math.min(tj.width, Hk.width) : Jb !== Oj && isFinite(fi) ? fi : Ec, Jg = Math.max(Jg, this.Bh.width), Jg = Math.max(Jg - ve, 0), Ik = Math.max(Jg / Ec, 1); isFinite(Ik) || (Ik = 1); for (ga = 0; ga < Bb; ga++)void 0 !== this.Wd[ga] && (Z = this.Ld(ga), isFinite(Z.width) || Op(Z) === Pp || (Z.Ya = Z.Ra * Ik), Z.position = e.width, 0 !== Z.Ra && (e.width += Z.Ra, e.width += Z.Ze())); Bb = this.pq; for (ga = 0; ga < Bb; ga++)void 0 !== this.ae[ga] && (Z = this.Md(ga), isFinite(Z.height) ? (bd += Z.height, bd += Z.Ze()) : Op(Z) === Pp ? (bd += Z.Ra, bd += Z.Ze()) : 0 !== Z.Ra && (wb += Z.Ra, 0 !== Z.Ra && (wb += Z.Ze()))); var Kg = isFinite(tj.height) ? Math.min(tj.height, Hk.height) : Jb !== Oj && isFinite(gi) ? gi : wb, Kg = Math.max(Kg, this.Bh.height), Kg = Math.max(Kg - bd, 0), yh = Math.max(Kg / wb, 1); isFinite(yh) || (yh = 1); for (ga = 0; ga < Bb; ga++)void 0 !== this.ae[ga] && (Z = this.Md(ga), isFinite(Z.height) || Op(Z) === Pp || (Z.Ya = Z.Ra * yh), Z.position = e.height, 0 !== Z.Ra && (e.height += Z.Ra, 0 !== Z.Ra && (e.height += Z.Ze()))); Bb = uh.length; for (ga = 0; ga < Bb; ga++) { var md = uh[ga]; md.type === Jo ? (Vb = e.width, Z = this.Md(md.Vb), Fc = Z.Ya) : (Z = this.Ld(md.column), Vb = Z.Ya, Fc = e.height); md.rd.m(0, 0, Vb, Fc); am(md, !1); Sb[md.Vb] || (Sb[md.Vb] = []); Sb[md.Vb][md.column] || (Sb[md.Vb][md.column] = []); Sb[md.Vb][md.column].push(md) } w.ua(uh); this.Qs = Sb; break; case "Viewbox": var uj = a, gm = b, lt = c, mt = d; 1 < m.length && w.k("Viewbox Panel cannot contain more than one GraphObject."); var kf = m[0]; kf.ub = 1; kf.Zp(); xk(kf, Infinity, Infinity, lt, mt); var Jk = kf.za, hm = kf.margin, nt = hm.right + hm.left, ot = hm.top + hm.bottom; if (isFinite(uj) || isFinite(gm)) { var dw = kf.scale, im = Jk.width, jm = Jk.height, pt = Math.max(uj - nt, 0), qt = Math.max(gm - ot, 0), Kk = 1; this.Bp === Qj ? 0 !== im && 0 !== jm && (Kk = Math.min(pt / im, qt / jm)) : 0 !== im && 0 !== jm && (Kk = Math.max(pt / im, qt / jm)); 0 === Kk && (Kk = 1E-4); kf.ub *= Kk; dw !== kf.scale && (am(kf, !0), xk(kf, Infinity, Infinity, lt, mt)) } Jk = kf.za; e.width = isFinite(uj) ? uj : Math.max(Jk.width + nt, 0); e.height = isFinite(gm) ? gm : Math.max(Jk.height + ot, 0); break; case "Link": var rt = m.length; if (this instanceof jh || this instanceof W) { var oi = null; this instanceof W && (oi = this); this instanceof jh && (oi = this.uf); if (oi instanceof W) { var Lk = oi; if (0 === rt) { var km = this.Ja; Pa(km, 0, 0); var we = this.za; we.m(0, 0, 0, 0) } else { var lm = this instanceof jh ? null : oi.path, Lg = oi.Wn, lf = this.gj; lf.assign(Lg); lf.x = 0; lf.y = 0; var zh = Lk.points, pi = oi.qa; this.pu(!1); var st = Lg.width, tt = Lg.height; this.Si.m(Lg.x, Lg.y); null === this.bh && (this.bh = new H(B)); this.bh.clear(); null !== lm && (Qp(lm, st, tt, this), we = lm.za, lf.Kh(we), this.bh.add(we)); for (var Mg = w.Jf(), Mk = w.K(), Ng = w.K(), mp = 0; mp < rt; mp++) { var cc = m[mp]; if (cc !== lm) if (cc.Yf && cc instanceof Y) Qp(cc, st, tt, this), we = cc.za, lf.Kh(we), this.bh.add(we); else if (2 > pi) xk(cc, Infinity, Infinity), we = cc.za, lf.Kh(we), this.bh.add(we); else { var xd = cc.Ne, vt = cc.eB, np = cc.qh; np.Rd() && (np = Hb); var ig = cc.qq, ew = cc.fB, Nk = 0, Ok = 0, mm = 0; if (xd < -pi || xd >= pi) { var wt = Lk.EF, Lf = Lk.DF; ig !== kj && (mm = Lk.computeAngle(cc, ig, Lf), cc.lg = mm); Nk = wt.x - Lg.x; Ok = wt.y - Lg.y } else { var Nd, mf; if (0 <= xd) Nd = zh.ea(xd), mf = xd < pi - 1 ? zh.ea(xd + 1) : Nd; else { var qi = pi + xd; Nd = zh.ea(qi); mf = 0 < qi ? zh.ea(qi - 1) : Nd } if (Nd.Kc(mf)) { var ri, si; 0 <= xd ? (ri = 0 < xd ? zh.ea(xd - 1) : Nd, si = xd < pi - 2 ? zh.ea(xd + 2) : mf) : (ri = qi < pi - 1 ? zh.ea(qi + 1) : Nd, si = 1 < qi ? zh.ea(qi - 2) : mf); var xt = ri.wf(Nd), yt = mf.wf(si), Lf = xt > yt + 10 ? 0 <= xd ? ri.Ob(Nd) : Nd.Ob(ri) : yt > xt + 10 ? 0 <= xd ? mf.Ob(si) : si.Ob(mf) : 0 <= xd ? ri.Ob(si) : si.Ob(ri) } else Lf = 0 <= xd ? Nd.Ob(mf) : mf.Ob(Nd); ig !== kj && (mm = Lk.computeAngle(cc, ig, Lf), cc.lg = mm); Nk = Nd.x + (mf.x - Nd.x) * vt - Lg.x; Ok = Nd.y + (mf.y - Nd.y) * vt - Lg.y } xk(cc, Infinity, Infinity); var we = cc.za, km = cc.Ja, Pk = 0; cc instanceof Y && (Pk = cc.lb); var ti = km.width + Pk, vj = km.height + Pk; Mg.reset(); Mg.translate(-we.x, -we.y); Mg.scale(cc.scale, cc.scale); Mg.rotate(ig === kj ? cc.angle : Lf, ti / 2, vj / 2); ig !== Rp && ig !== Sp || Mg.rotate(90, ti / 2, vj / 2); ig !== Tp && ig !== Up || Mg.rotate(-90, ti / 2, vj / 2); ig === Vp && (45 < Lf && 135 > Lf || 225 < Lf && 315 > Lf) && Mg.rotate(-Lf, ti / 2, vj / 2); var wj = new B(0, 0, ti, vj); Mk.Xn(wj, np); Mg.nb(Mk); var fw = -Mk.x + Pk / 2, gw = -Mk.y + Pk / 2; Ng.assign(ew); isNaN(Ng.x) && (Ng.x = 0 <= xd ? ti / 2 + 3 : -(ti / 2 + 3)); isNaN(Ng.y) && (Ng.y = -(vj / 2 + 3)); Ng.rotate(Lf); Nk += Ng.x; Ok += Ng.y; wj.set(we); wj.x = Nk + fw; wj.y = Ok + gw; this.bh.add(wj); lf.Kh(wj) } } if (this instanceof W) for (var zt = this.Df; zt.next();)xk(zt.value, Infinity, Infinity); this.gj = lf; var op = this.Si; op.m(op.x + lf.x, op.y + lf.y); Pa(e, lf.width || 0, lf.height || 0); w.we(Mg); w.v(Mk); w.v(Ng) } } } break; case "Grid": break; case "Graduated": var hw = a, iw = b, jw = c, kw = d, Og = this.Kd(); this.ym = []; var xj = Og.margin, lw = xj.right + xj.left, mw = xj.top + xj.bottom; xk(Og, hw, iw, jw, kw); var At = Og.za, nw = At.height, ow = Math.max(At.width + lw, 0), pw = Math.max(nw + mw, 0), Bt = new B(-xj.left, -xj.top, ow, pw); this.ym.push(Bt); e.assign(Bt); for (var Uk = Og.jf, Ct = Og.lb, pp = Uk.qx, yj = Uk.Qt, ui = Uk.Rt, qw = pp.length, qp = 0, rp = 0, zj = w.cb(), sp = 0; sp < qw; sp++) { for (var tp = pp[sp], Dt = [], rp = qp = 0, rw = tp.length, Aj = 0; Aj < rw; Aj += 2) { var Et = tp[Aj], Ft = tp[Aj + 1]; if (0 !== Aj) { var yd = 180 * Math.atan2(Ft - rp, Et - qp) / Math.PI; 0 > yd && (yd += 360); Dt.push(yd) } qp = Et; rp = Ft } zj.push(Dt) } var Gt; if (null === this.Tj) { for (var Ht = [], up = this.xa.n, It = up.length, vp = 0; vp < It; vp++) { var Vk = up[vp], Jt = []; Ht.push(Jt); if (Vk.visible) for (var sw = Vk.interval, wp = 0; wp < It; wp++) { var Wk = up[wp]; if (Wk.visible && Vk !== Wk && !(Vk instanceof Y && !(Wk instanceof Y) || Vk instanceof Hh && !(Wk instanceof Hh))) { var Kt = Wk.interval; Kt > sw && Jt.push(Kt) } } } this.Tj = Ht } Gt = this.Tj; var Lt = this.xa.n, tw = Lt.length, Ah = 0, Mt = 0, Nt = ui; this.Am = []; for (var om = [], pm = 0; pm < tw; pm++) { var Bh = Lt[pm], om = []; if (Bh.visible && Bh !== Og) { var Ot = Bh.interval, Pt = this.tA; if (!(2 > Pt * Ot * ui / this.Yt)) { var de = this.bF, Qt = Gt[pm], vi = yj[0][0], Mf = 0, zd = 0, Mt = ui * Bh.aF - 1E-4, Nt = ui * Bh.ZE + 1E-4, Bj = Pt * Ot; if (de < this.Dk) var wi = (this.Dk - de) / Bj, wi = 0 === wi % 1 ? wi : Math.floor(wi + 1), de = de + wi * Bj; else de > this.Dk + Bj && (wi = Math.floor((de - this.Dk) / Bj), de -= wi * Bj); for (; de <= this.sA;) { var xp; a: { for (var uw = Qt.length, yp = 0; yp < uw; yp++)if (Va((de - this.bF) % (Qt[yp] * this.tA), 0)) { xp = !1; break a } xp = !0 } if (xp && (Ah = (de - this.Dk) * ui / this.Yt, Ah > ui && (Ah = ui), Mt <= Ah && Ah <= Nt)) { for (var yd = zj[Mf][zd], Cj = yj[Mf][zd]; Mf < yj.length;) { for (; Ah > vi && zd < yj[Mf].length - 1;)zd++ , yd = zj[Mf][zd], Cj = yj[Mf][zd], vi += Cj; if (Ah <= vi) break; Mf++; zd = 0; yd = zj[Mf][zd]; Cj = yj[Mf][zd]; vi += Cj } var Od = pp[Mf], Rt = Od[2 * zd], St = Od[2 * zd + 1], qm = (Ah - (vi - Cj)) / Cj, zp = new z(Rt + (Od[2 * zd + 2] - Rt) * qm + Ct / 2 - Uk.gb.x, St + (Od[2 * zd + 3] - St) * qm + Ct / 2 - Uk.gb.y); zp.scale(Og.scale, Og.scale); var jg = yd, Dj = zj[Mf]; 1E-4 > qm ? 0 < zd ? jg = Dj[zd - 1] : Va(Od[0], Od[Od.length - 2]) && Va(Od[1], Od[Od.length - 1]) && (jg = Dj[Dj.length - 1]) : .9999 < qm && (zd + 1 < Dj.length ? jg = Dj[zd + 1] : Va(Od[0], Od[Od.length - 2]) && Va(Od[1], Od[Od.length - 1]) && (jg = Dj[0])); yd !== jg && (180 < Math.abs(yd - jg) && (yd < jg ? yd += 360 : jg += 360), yd = (yd + jg) / 2 % 360); if (Bh instanceof Hh) { var Ap = "", Ap = null !== Bh.$E ? Bh.$E(de) : (+de.toFixed(2)).toString(); "" !== Ap && om.push([zp, yd, Ap]) } else om.push([zp, yd]) } de += Bj } } } this.Am.push(om) } w.ua(zj); for (var vw = this.Am, ww = m.length, rm = 0; rm < ww; rm++) { var xi = m[rm], Bp = vw[rm]; if (xi.visible && xi !== Og && 0 !== Bp.length) { if (xi instanceof Y) { var Ch = xi, Tt = Bp, xw = e, Cp = Ch.qh; Cp.Rd() && (Cp = yb); var yw = Ch.angle; Ch.lg = 0; xk(Ch, Infinity, Infinity); Ch.lg = yw; var Ut = Ch.za, Dp = Ut.width, Ep = Ut.height, Vt = w.jg(0, 0, Dp, Ep), ee = w.K(); ee.Xn(Vt, Cp); w.Db(Vt); for (var sm = -ee.x, tm = -ee.y, yi = new B, zw = Tt.length, um = 0; um < zw; um++)for (var Fp = Tt[um], Wt = Fp[0].x, Xt = Fp[0].y, Yt = Fp[1], vm = 0; 4 > vm; vm++) { switch (vm) { case 0: ee.m(sm, tm); break; case 1: ee.m(sm + Dp, tm); break; case 2: ee.m(sm, tm + Ep); break; case 3: ee.m(sm + Dp, tm + Ep) }ee.rotate(Yt + Ch.angle); ee.offset(Wt, Xt); 0 === um && 0 === vm ? yi.m(ee.x, ee.y, 0, 0) : yi.ui(ee); ee.offset(-Wt, -Xt); ee.rotate(-Yt - Ch.angle) } w.v(ee); this.ym.push(yi); $a(xw, yi.x, yi.y, yi.width, yi.height) } else if (xi instanceof Hh) { var wm = xi, Zt = Bp, Aw = e; null === this.lk && (this.lk = new Hh); var Nf = this.lk; kp(wm, Nf); var Gp = wm.qh; Gp.Rd() && (Gp = yb); for (var Dh = wm.qq, Bw = wm.fB, zi = null, xm = 0, ym = 0, Pg = 0, Hp = 0, Cw = Zt.length, zm = 0; zm < Cw; zm++) { var kg = Zt[zm], xm = kg[0].x, ym = kg[0].y, Pg = kg[1]; Dh !== kj && (Hp = W.computeAngle(Dh, Pg), Nf.lg = Hp); Nf.text = kg[2]; xk(Nf, Infinity, Infinity); var Eh = Nf.za, Ej = Nf.Ja, Fj = Ej.width, Gj = Ej.height, Qg = w.Jf(); Qg.reset(); Qg.translate(-Eh.x, -Eh.y); Qg.scale(Nf.scale, Nf.scale); Qg.rotate(Dh === kj ? Nf.angle : Pg, Fj / 2, Gj / 2); Dh !== Rp && Dh !== Sp || Qg.rotate(90, Fj / 2, Gj / 2); Dh !== Tp && Dh !== Up || Qg.rotate(-90, Fj / 2, Gj / 2); Dh === Vp && (45 < Pg && 135 > Pg || 225 < Pg && 315 > Pg) && Qg.rotate(-Pg, Fj / 2, Gj / 2); var $t = w.jg(0, 0, Fj, Gj), Xk = w.K(); Xk.Xn($t, Gp); Qg.nb(Xk); var Dw = -Xk.x, Ew = -Xk.y, Rg = w.K(); Rg.assign(Bw); isNaN(Rg.x) && (Rg.x = Fj / 2 + 3); isNaN(Rg.y) && (Rg.y = -(Gj / 2 + 3)); Rg.rotate(Pg); var xm = xm + (Rg.x + Dw), ym = ym + (Rg.y + Ew), Ip = new B(xm, ym, Eh.width, Eh.height), Fw = new B(Eh.x, Eh.y, Eh.width, Eh.height), Gw = new B(Ej.x, Ej.y, Ej.width, Ej.height), au = new Wp; au.Jp(Nf.sf); kg.push(Hp); kg.push(Nf.le); kg.push(au); kg.push(Ip); kg.push(Fw); kg.push(Gw); 0 === zm ? zi = Ip.copy() : zi.Kh(Ip); w.v(Rg); w.v(Xk); w.Db($t); w.we(Qg) } this.ym.push(zi); $a(Aw, zi.x, zi.y, zi.width, zi.height) } am(xi, !1) } } break; case "TableRow": case "TableColumn": w.k(this.toString() + " is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel."); break; default: w.k("Unknown panel type: " + n) } } var nf = e.width, of = e.height, Am = this.padding, Hw = Am.top + Am.bottom, nf = nf + (Am.left + Am.right), of = of + Hw; isFinite(f.width) && (nf = f.width); isFinite(f.height) && (of = f.height); nf = Math.min(k.width, nf); of = Math.min(k.height, of); nf = Math.max(h.width, nf); of = Math.max(h.height, of); nf = Math.max(c, nf); of = Math.max(d, of); e.width = nf; e.height = of; Pa(this.Uc, nf, of); Bo(this, 0, 0, nf, of) }; C.prototype.findMainElement = C.prototype.Kd = function () { if (null === this.en) { var a = this.xa.n, b = a.length; if (0 === b) return null; for (var c = 0; c < b; c++) { var d = a[c]; if (!0 === d.Yf) return this.en = d } this.en = a[0] } return this.en }; function Lp(a) { return null !== a.U ? a.U.$f : null } C.prototype.jj = function (a, b, c, d) { var e = this.gj, f = this.xa.n, h = w.jg(0, 0, 0, 0); if (0 === f.length) { var k = this.Y; k.x = a; k.y = b; k.width = c; k.height = d } else { if (!this.Ca.I()) { var l = Eo(this, !0), m = this.rd, n = m.width, p = m.height, q = this.margin, r = q.left + q.right, s = q.top + q.bottom; n === c && p === d && (l = Oj); switch (l) { case Oj: if (n > c || p > d) this.H(), xk(this, n > c ? c : n, p > d ? d : p); break; case Fe: this.H(!0); xk(this, c + r, d + s, 0, 0); break; case qo: this.H(!0); xk(this, c + r, p + s, 0, 0); break; case po: this.H(!0), xk(this, n + r, d + s, 0, 0) } } k = this.Y; k.x = a; k.y = b; k.width = c; k.height = d; var u = this.ma.Sb; switch (u) { case "Position": for (var t = f.length, x = e.x - this.padding.left, v = e.y - this.padding.top, A = 0; A < t; A++) { var y = f[A], K = y.za, E = y.margin, Q = y.position.x, X = y.position.y; h.x = isNaN(Q) ? -x : Q - x; h.y = isNaN(X) ? -v : X - v; if (y instanceof Y) { var O = y; if (O.nF) { var aa = O.lb / 2; h.x -= aa; h.y -= aa } } h.x += E.left; h.y += E.top; h.width = K.width; h.height = K.height; y.visible && y.jc(h.x, h.y, h.width, h.height) } break; case "Vertical": for (var da = f.length, S = this.padding.left, Ra = this.uF, gb = Ra ? e.height : this.padding.top, qa = 0; qa < da; qa++) { var Ja = S, za = f[qa]; if (za.visible) { var Tb = za.za, Ob = za.margin, $d = Ob.left + Ob.right, sd = S + this.padding.right, uc = Tb.width, Ag = Eo(za, !1); if (isNaN(za.Ca.width) && Ag === Fe || Ag === qo) uc = Math.max(e.width - $d - sd, 0); var Ff = uc + $d + sd, Ua = za.alignment; Ua.Wc() && (Ua = this.Nl); Ua.Xc() || (Ua = Hb); Ra && (gb -= Tb.height + Ob.bottom + Ob.top); za.jc(Ja + Ua.offsetX + Ob.left + (e.width * Ua.x - Ff * Ua.x), gb + Ua.offsetY + Ob.top, uc, Tb.height); Ra || (gb += Tb.height + Ob.bottom + Ob.top) } } break; case "Horizontal": for (var nb = f.length, na = this.padding.top, ma = this.uF, hb = ma ? e.width : this.padding.left, ib = 0; ib < nb; ib++) { var fb = na, qe = f[ib]; if (qe.visible) { var Hd = qe.za, ub = qe.margin, Ie = ub.top + ub.bottom, hd = na + this.padding.bottom, cg = Hd.height, Gf = Eo(qe, !1); if (isNaN(qe.Ca.height) && Gf === Fe || Gf === po) cg = Math.max(e.height - Ie - hd, 0); var Bg = cg + Ie + hd, jb = qe.alignment; jb.Wc() && (jb = this.Nl); jb.Xc() || (jb = Hb); ma && (hb -= Hd.width + ub.left + ub.right); qe.jc(hb + jb.offsetX + ub.left, fb + jb.offsetY + ub.top + (e.height * jb.y - Bg * jb.y), Hd.width, cg); ma || (hb += Hd.width + ub.left + ub.right) } } break; case "Spot": var zc = f.length, td = this.Kd(), dg = td.za, Eb = dg.width, Pb = dg.height, re = this.padding, Cg = re.left, Id = re.top; h.x = Cg - e.x; h.y = Id - e.y; td.jc(h.x, h.y, Eb, Pb); for (var ob = 0; ob < zc; ob++) { var Nc = f[ob]; if (Nc !== td) { var Hf = Nc.za, Je = Hf.width, ai = Hf.height, Sa = Nc.alignment; Sa.Wc() && (Sa = this.Nl); Sa.Xc() || (Sa = Hb); var ab = Nc.qh; ab.Wc() && (ab = Hb); var Ac = null; Nc instanceof C && "" !== Nc.Hj && (Ac = Nc.xd(Nc.Hj), Ac === Nc && (Ac = null)); if (null !== Ac) { for (var vc = Ac.Ja, Yc = w.xb(ab.x * vc.width + ab.offsetX, ab.y * vc.height + ab.offsetY); Ac !== Nc;)Ac.transform.nb(Yc), Ac = Ac.O; h.x = Sa.x * Eb + Sa.offsetX - Yc.x; h.y = Sa.y * Pb + Sa.offsetY - Yc.y; w.v(Yc) } else h.x = Sa.x * Eb + Sa.offsetX - (ab.x * Je - ab.offsetX), h.y = Sa.y * Pb + Sa.offsetY - (ab.y * ai - ab.offsetY); h.x -= e.x; h.y -= e.y; Nc.visible && Nc.jc(Cg + h.x, Id + h.y, Je, ai) } } break; case "Auto": var ph = f.length, Wa = this.Kd(), zb = Wa.za, vb = w.If(); vb.m(0, 0, 1, 1); var Bc = Wa.margin, Ab = Bc.left, pb = Bc.top, Ib = this.padding, ae = Ib.left, Fb = Ib.top; h.x = Ab; h.y = pb; h.width = zb.width; h.height = zb.height; Wa.jc(ae + h.x, Fb + h.y, h.width, h.height); var Ub = Mp(Wa), id = Np(Wa), bi = 0 + Ub.y * zb.height + Ub.offsetY, Qb = 0 + id.x * zb.width + id.offsetX, Rb = 0 + id.y * zb.height + id.offsetY; vb.x = 0 + Ub.x * zb.width + Ub.offsetX; vb.y = bi; $a(vb, Qb, Rb, 0, 0); vb.x += Ab + ae; vb.y += pb + Fb; for (var Cc = 0; Cc < ph; Cc++) { var Zc = f[Cc]; if (Zc !== Wa) { var ud = Zc.za, Bc = Zc.margin, Dg = Math.max(ud.width + Bc.right + Bc.left, 0), ci = Math.max(ud.height + Bc.top + Bc.bottom, 0), qb = Zc.alignment; qb.Wc() && (qb = this.Nl); qb.Xc() || (qb = Hb); h.x = vb.width * qb.x + qb.offsetX - Dg * qb.x + Bc.left + vb.x; h.y = vb.height * qb.y + qb.offsetY - ci * qb.y + Bc.top + vb.y; h.width = vb.width; h.height = vb.height; Zc.visible && (cb(vb.x, vb.y, vb.width, vb.height, h.x, h.y, ud.width, ud.height) ? Zc.jc(h.x, h.y, ud.width, ud.height) : Zc.jc(h.x, h.y, ud.width, ud.height, new B(vb.x, vb.y, vb.width, vb.height))) } } w.Db(vb); break; case "Table": for (var $c = f.length, di = this.padding, Ke = di.left, jc = di.top, se = this.Qs, bc = 0, Dc = 0, vd = se.length, kc = 0, Ta = 0; Ta < vd; Ta++)se[Ta] && (kc = Math.max(kc, se[Ta].length)); for (var lc = Math.min(this.fj, vd - 1); lc !== vd && (void 0 === this.ae[lc] || 0 === this.ae[lc].Ra);)lc++; for (var lc = Math.min(lc, vd - 1), ei = -this.ae[lc].jb, Ze = Math.min(this.Pi, kc - 1); Ze !== kc && (void 0 === this.Wd[Ze] || 0 === this.Wd[Ze].Ra);)Ze++; for (var Ze = Math.min(Ze, kc - 1), Jd = -this.Wd[Ze].jb, Le = w.jm(), Ta = 0; Ta < vd; Ta++)if (se[Ta]) { var kc = se[Ta].length, qh = this.Md(Ta), Dc = qh.jb + ei + jc; 0 !== qh.Ra && (Dc += qh.wE()); for (var Kd = 0; Kd < kc; Kd++)if (se[Ta][Kd]) { var rh = this.Ld(Kd), bc = rh.jb + Jd + Ke; 0 !== rh.Ra && (bc += rh.wE()); for (var pj = se[Ta][Kd], sh = pj.length, Ek = 0; Ek < sh; Ek++) { var rb = pj[Ek], be = rb.za, jd = rb instanceof C ? rb : null; if (null === jd || jd.type !== Jo && jd.type !== Ko) { Le.m(0, 0); for (var Me = 1; Me < rb.rowSpan && !(Ta + Me >= this.pq); Me++) { var fi = this.Md(Ta + Me); Le.height += fi.total } for (Me = 1; Me < rb.wH && !(Kd + Me >= this.Ip); Me++) { var gi = this.Ld(Kd + Me); Le.width += gi.total } var qj = rh.Ra + Le.width, rj = qh.Ra + Le.height; h.x = bc; h.y = Dc; h.width = qj; h.height = rj; var Bb = bc, th = Dc, uh = qj, ga = rj; bc + qj > e.width && (uh = Math.max(e.width - bc, 0)); Dc + rj > e.height && (ga = Math.max(e.height - Dc, 0)); var ba = rb.alignment, ce = 0, eg = 0, hi = 0, Cb = 0; if (ba.Wc()) { ba = this.Nl; ba.Xc() || (ba = Hb); var ce = ba.x, eg = ba.y, hi = ba.offsetX, Cb = ba.offsetY, ii = rh.alignment, Sb = qh.alignment; ii.Xc() && (ce = ii.x, hi = ii.offsetX); Sb.Xc() && (eg = Sb.y, Cb = Sb.offsetY) } else ce = ba.x, eg = ba.y, hi = ba.offsetX, Cb = ba.offsetY; if (isNaN(ce) || isNaN(eg)) eg = ce = .5, Cb = hi = 0; var $e = be.width, Ne = be.height, af = rb.margin, te = af.left + af.right, ue = af.top + af.bottom, ad = To(rb, qh, rh, !1); !isNaN(rb.Ca.width) || ad !== Fe && ad !== qo || ($e = Math.max(qj - te, 0)); !isNaN(rb.Ca.height) || ad !== Fe && ad !== po || (Ne = Math.max(rj - ue, 0)); var Ld = rb.Ff, vh = rb.Bh, $e = Math.min(Ld.width, $e), Ne = Math.min(Ld.height, Ne), $e = Math.max(vh.width, $e), Ne = Math.max(vh.height, Ne), Z = Ne + ue; h.x += h.width * ce - ($e + te) * ce + hi + af.left; h.y += h.height * eg - Z * eg + Cb + af.top; rb.visible && (cb(Bb, th, uh, ga, h.x, h.y, be.width, be.height) ? rb.jc(h.x, h.y, $e, Ne) : rb.jc(h.x, h.y, $e, Ne, new B(Bb, th, uh, ga))) } else { rb.Li(); rb.oc.Qa(); var kd = rb.oc, fg = w.jg(kd.x, kd.y, kd.width, kd.height); kd.x = jd.type === Jo ? Ke : bc; kd.y = jd.type === Ko ? jc : Dc; kd.width = be.width; kd.height = be.height; rb.oc.freeze(); Fo(rb, !1); if (!Qa(fg, kd)) { var ji = rb.U; null !== ji && (ji.Fk(), rb.us(ji)) } w.Db(fg) } } } } w.Bk(Le); for (Ta = 0; Ta < $c; Ta++)rb = f[Ta], jd = rb instanceof C ? rb : null, null === jd || jd.type !== Jo && jd.type !== Ko || (kd = rb.oc, rb.Uc.Qa(), rb.Uc.m(0, 0, kd.width, kd.height), rb.Uc.freeze()); break; case "Viewbox": var wh = f[0], mc = wh.za, xh = wh.margin, kb = xh.top + xh.bottom, lb = Math.max(mc.width + (xh.right + xh.left), 0), dm = Math.max(mc.height + kb, 0), bf = wh.alignment; bf.Wc() && (bf = this.Nl); bf.Xc() || (bf = Hb); h.x = e.width * bf.x - lb * bf.x + bf.offsetX; h.y = e.height * bf.y - dm * bf.y + bf.offsetY; h.width = mc.width; h.height = mc.height; wh.jc(h.x, h.y, h.width, h.height); break; case "Link": var Fk = f.length; if (this instanceof jh || this instanceof W) { var ki = null; this instanceof W && (ki = this); this instanceof jh && (ki = this.uf); var wc = ki, If = this instanceof jh ? null : wc.path; if (null !== this.bh) { var gg = this.bh.n, Jb = 0; if (null !== If && Jb < this.bh.count) { var cf = gg[Jb]; Jb++; If.jc(cf.x - this.gj.x, cf.y - this.gj.y, cf.width, cf.height) } for (var Gk = 0; Gk < Fk; Gk++) { var em = f[Gk]; em !== If && Jb < this.bh.count && (cf = gg[Jb], Jb++ , em.jc(cf.x - this.gj.x, cf.y - this.gj.y, cf.width, cf.height)) } } var Jf = wc.points, df = Jf.count; if (2 <= df && this instanceof W) for (var ef = this.Df; ef.next();) { var nc = ef.value, hg = df, Ec = Jf, wb = nc.Ne, li = nc.eB, Eg = nc.qh, sj = nc.qq, lp = nc.fB, Fg = 0, Kf = 0, Gg = 0; if (wb < -hg || wb >= hg) { var Hg = this.EF, mb = this.DF; sj !== kj && (Gg = this.computeAngle(nc, sj, mb), nc.angle = Gg); Fg = Hg.x; Kf = Hg.y } else { var Vb = void 0, Fc = void 0; if (0 <= wb) Vb = Ec.n[wb], Fc = wb < hg - 1 ? Ec.n[wb + 1] : Vb; else var ff = hg + wb, Vb = Ec.n[ff], Fc = 0 < ff ? Ec.n[ff - 1] : Vb; if (Vb.Kc(Fc)) { var Md = void 0, wd = void 0; 0 <= wb ? (Md = 0 < wb ? Ec.n[wb - 1] : Vb, wd = wb < hg - 2 ? Ec.n[wb + 2] : Fc) : (Md = ff < hg - 1 ? Ec.n[ff + 1] : Vb, wd = 1 < ff ? Ec.n[ff - 2] : Fc); var gf = Md.wf(Vb), bb = Fc.wf(wd), mb = gf > bb + 10 ? 0 <= wb ? Md.Ob(Vb) : Vb.Ob(Md) : bb > gf + 10 ? 0 <= wb ? Fc.Ob(wd) : wd.Ob(Fc) : 0 <= wb ? Md.Ob(wd) : wd.Ob(Md) } else mb = 0 <= wb ? Vb.Ob(Fc) : Fc.Ob(Vb); sj !== kj && (Gg = this.computeAngle(nc, sj, mb), nc.angle = Gg); Fg = Vb.x + (Fc.x - Vb.x) * li; Kf = Vb.y + (Fc.y - Vb.y) * li } if (Eg.L(tb)) nc.location = new z(Fg, Kf); else { Eg.Rd() && (Eg = Hb); var hf = w.Jf(); hf.reset(); hf.scale(nc.scale, nc.scale); hf.rotate(nc.angle, 0, 0); var ld = nc.Ja, Ig = w.jg(0, 0, ld.width, ld.height), jf = w.K(); jf.Xn(Ig, Eg); hf.nb(jf); var Gc = -jf.x, mi = -jf.y, Oe = lp.copy(); isNaN(Oe.x) && (Oe.x = 0 <= wb ? jf.x + 3 : -(jf.x + 3)); isNaN(Oe.y) && (Oe.y = -(jf.y + 3)); Oe.rotate(mb); Fg += Oe.x; Kf += Oe.y; hf.zG(Ig); var Gc = Gc + Ig.x, mi = mi + Ig.y, Jg = w.xb(Fg + Gc, Kf + mi); nc.move(Jg); w.v(Jg); w.v(jf); w.Db(Ig); w.we(hf) } } this.pu(!1) } break; case "Grid": break; case "Graduated": if (null !== this.ym) { var Kg = this.Kd(), tj = this.Am, Hk = this.ym, ve = 0, bd = Hk[ve]; ve++; Kg.jc(bd.x - e.x, bd.y - e.y, bd.width, bd.height); for (var Ik = f.length, yh = 0; yh < Ik; yh++) { var md = f[yh], uj = tj[yh]; md.visible && md !== Kg && 0 !== uj.length && (bd = Hk[ve], ve++ , md.jc(bd.x - e.x, bd.y - e.y, bd.width, bd.height)) } this.ym = null } break; case "TableRow": case "TableColumn": w.k(this.toString() + " is not an element of a Table Panel.TableRow and TableColumn panels can only be elements of a Table Panel."); break; default: w.k("Unknown panel type: " + u) }w.Db(h) } }; C.prototype.vk = function (a) { var b = this.Ja, c = Lp(this); if (cb(0, 0, b.width, b.height, a.x, a.y)) { for (var b = this.xa.n, d = b.length, e = w.xb(0, 0); d--;) { var f = b[d]; if (f.visible || f === c) if (La(e.set(a), f.transform), f.Ia(e)) return w.v(e), !0 } w.v(e); return null === this.Eb && null === this.bc ? !1 : !0 } return !1 }; C.prototype.mx = function (a) { if (this.oo === a) return this; for (var b = this.xa.n, c = b.length, d = 0; d < c; d++) { var e = b[d].mx(a); if (null !== e) return e } return null }; function $o(a, b, c) { c(a, b); if (b instanceof C) { b = b.xa.n; for (var d = b.length, e = 0; e < d; e++)$o(a, b[e], c) } } function Mm(a, b) { Xp(a, a, b) } function Xp(a, b, c) { c(b); b = b.xa.n; for (var d = b.length, e = 0; e < d; e++) { var f = b[e]; f instanceof C && Xp(a, f, c) } } C.prototype.walkVisualTree = C.prototype.ZJ = function (a) { Yp(this, this, a) }; function Yp(a, b, c) { c(b); if (b instanceof C) { b = b.xa.n; for (var d = b.length, e = 0; e < d; e++)Yp(a, b[e], c) } } C.prototype.findInVisualTree = C.prototype.Lt = function (a) { return Zp(this, this, a) }; function Zp(a, b, c) { if (c(b)) return b; if (b instanceof C) { b = b.xa.n; for (var d = b.length, e = 0; e < d; e++) { var f = Zp(a, b[e], c); if (null !== f) return f } } return null } C.prototype.findObject = C.prototype.xd = function (a) { if (this.name === a) return this; for (var b = this.xa.n, c = b.length, d = 0; d < c; d++) { var e = b[d]; if (e.name === a) return e; if (e instanceof C) if (null === e.$j && null === e.xg) { if (e = e.xd(a), null !== e) return e } else if (kn(e) && (e = e.xa.first(), null !== e && (e = e.xd(a), null !== e))) return e } return null }; function $p(a) { a = a.xa.n; for (var b = a.length, c = 0, d = 0; d < b; d++) { var e = a[d]; if (e instanceof C) c = Math.max(c, $p(e)); else if (e instanceof Y) { a: { if (null !== !e.Rf) switch (e.Fo) { case "None": case "Square": case "Ellipse": case "Circle": case "LineH": case "LineV": case "FramedRectangle": case "RoundedRectangle": case "Line1": case "Line2": case "Border": case "Cube1": case "Cube2": case "Junction": case "Cylinder1": case "Cylinder2": case "Cylinder3": case "Cylinder4": case "PlusLine": case "XLine": case "ThinCross": case "ThickCross": e = 0; break a }e = e.ji / 2 * e.dn * e.pj() } c = Math.max(c, e) } } return c } g = C.prototype; g.ah = function () { return !(this.type === Jo || this.type === Ko) }; g.Ke = function (a, b, c) { if (!1 === this.Wg) return null; void 0 === b && (b = null); void 0 === c && (c = null); if (Dm(this)) return null; var d = this.Ja, e = 1 / this.pj(), f = this.ah(), h = f ? a : La(w.xb(a.x, a.y), this.transform), k = this.g, l = 10, m = 5; null !== k && (l = k.Xt("extraTouchArea"), m = l / 2); if (cb(-(m * e), -(m * e), d.width + l * e, d.height + l * e, h.x, h.y)) { if (!this.Gn) { var e = this.xa.n, n = e.length, k = w.K(), m = (l = this.cu) ? this.Kd() : null; if (l && (m.ah() ? La(k.set(a), m.transform) : k.set(a), !m.Ia(k))) return w.v(k), f || w.v(h), null; for (var p = Lp(this); n--;) { var q = e[n]; if (q.visible || q === p) if (q.ah() ? La(k.set(a), q.transform) : k.set(a), !l || q !== m) { var r = null; q instanceof C ? r = q.Ke(k, b, c) : !0 === q.Wg && q.Ia(k) && (r = q); if (null !== r && (null !== b && (r = b(r)), null !== r && (null === c || c(r)))) return w.v(k), f || w.v(h), r } } w.v(k) } if (null === this.background && null === this.kn) return f || w.v(h), null; a = cb(0, 0, d.width, d.height, h.x, h.y) ? this : null; f || w.v(h); return a } f || w.v(h); return null }; g.Nt = function (a, b, c, d) { if (!1 === this.Wg) return !1; void 0 === b && (b = null); void 0 === c && (c = null); d instanceof H || d instanceof I || (d = new H(G)); var e = this.Ja, f = this.ah(), h = f ? a : La(w.xb(a.x, a.y), this.transform); if (cb(0, 0, e.width, e.height, h.x, h.y)) { if (!this.Gn) { for (var e = this.xa.n, k = e.length, l = w.K(), m = Lp(this); k--;) { var n = e[k]; if (n.visible || n === m) { n.ah() ? La(l.set(a), n.transform) : l.set(a); var p = n, n = n instanceof C ? n : null; (null !== n ? n.Nt(l, b, c, d) : p.Ia(l)) && !1 !== p.Wg && (null !== b && (p = b(p)), null === p || null !== c && !c(p) || d.add(p)) } } w.v(l) } f || w.v(h); return null !== this.background || null !== this.kn } f || w.v(h); return !1 }; g.zk = function (a, b, c, d, e, f) { if (!1 === this.Wg) return !1; void 0 === b && (b = null); void 0 === c && (c = null); var h = f; void 0 === f && (h = w.Jf(), h.reset()); h.multiply(this.transform); if (this.rn(a, h)) return aq(this, b, c, e), void 0 === f && w.we(h), !0; if (this.Wf(a, h)) { if (!this.Gn) for (var k = Lp(this), l = this.xa.n, m = l.length; m--;) { var n = l[m]; if (n.visible || n === k) { var p = n.Y, q = this.Ja; if (!(p.x > q.width || p.y > q.height || 0 > p.x + p.width || 0 > p.y + p.height)) { p = n; n = n instanceof C ? n : null; q = w.Jf(); q.set(h); if (null !== n ? n.zk(a, b, c, d, e, q) : Do(p, a, d, q)) null !== b && (p = b(p)), null === p || null !== c && !c(p) || e.add(p); w.we(q) } } } void 0 === f && w.we(h); return d } void 0 === f && w.we(h); return !1 }; function aq(a, b, c, d) { for (var e = a.xa.n, f = e.length; f--;) { var h = e[f]; if (h.visible) { var k = h.Y, l = a.Ja; k.x > l.width || k.y > l.height || 0 > k.x + k.width || 0 > k.y + k.height || (h instanceof C && aq(h, b, c, d), null !== b && (h = b(h)), null === h || null !== c && !c(h) || d.add(h)) } } } g.xn = function (a, b, c, d, e, f) { if (!1 === this.Wg) return !1; void 0 === c && (c = null); void 0 === d && (d = null); var h = this.Ja, k = this.ah(), l = k ? a : La(w.xb(a.x, a.y), this.transform), m = k ? b : La(w.xb(b.x, b.y), this.transform), n = l.wf(m), p = 0 < l.x && l.x < h.width && 0 < l.y && l.y < h.height || Ma(l.x, l.y, 0, 0, 0, h.height) < n || Ma(l.x, l.y, 0, h.height, h.width, h.height) < n || Ma(l.x, l.y, h.width, h.height, h.width, 0) < n || Ma(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 && Ma(l.x, l.y, 0, 0, 0, h.height) < n && Ma(l.x, l.y, 0, h.height, h.width, h.height) < n && Ma(l.x, l.y, h.width, h.height, h.width, 0) < n && Ma(l.x, l.y, h.width, 0, 0, 0) < n; k || (w.v(l), w.v(m)); if (p) { if (!this.Gn) { for (var k = w.K(), l = w.K(), m = Lp(this), n = this.xa.n, q = n.length; q--;) { var r = n[q]; if (r.visible || r === m) { var s = r.Y, u = this.Ja; s.x > u.width || s.y > u.height || 0 > s.x + s.width || 0 > s.y + s.height || (r.ah() ? (s = r.transform, La(k.set(a), s), La(l.set(b), s)) : (k.set(a), l.set(b)), s = r, r = r instanceof C ? r : null, null !== r ? !r.xn(k, l, c, d, e, f) : !s.QE(k, l, e)) || (null !== c && (s = c(s)), null === s || null !== d && !d(s) || f.add(s)) } } w.v(k); w.v(l) } return e ? p : h } return !1 }; function Mp(a) { var b = null; a instanceof Y && (b = a.A, b === rc && (b = null), a = a.jf, null !== a && null === b && (b = a.A)); null === b && (b = xb); return b } function Np(a) { var b = null; a instanceof Y && (b = a.B, b === rc && (b = null), a = a.jf, null !== a && null === b && (b = a.B)); null === b && (b = Nb); return b } C.prototype.add = C.prototype.add = function (a) { w.G(a, G, C, "add:element"); this.Pd(this.xa.count, a) }; C.prototype.elt = C.prototype.ea = function (a) { return this.xa.ea(a) }; C.prototype.insertAt = C.prototype.Pd = function (a, b) { b instanceof T && w.k("Cannot add a Part to a Panel: " + b + "; use a Panel instead"); if (this === b || this.Zl(b)) this === b && w.k("Cannot make a Panel contain itself: " + this.toString()), w.k("Cannot make a Panel indirectly contain itself: " + this.toString() + " already contains " + b.toString()); var c = b.O; null !== c && c !== this && w.k("Cannot add a GraphObject that already belongs to another Panel to this Panel: " + b.toString() + ", already contained by " + c.toString() + ", cannot be shared by this Panel: " + this.toString()); this.ma !== Il || b instanceof Y || w.k("Can only add Shapes to a Grid Panel, not: " + b); this.ma !== ip || b instanceof Y || b instanceof Hh || w.k("Can only add Shapes or TextBlocks to a Graduated Panel, not: " + b); b.em(this); b.Tm = null; if (null !== this.cq) { var d = b.data; null !== d && "object" === typeof d && (null === this.wg && (this.wg = new la(Object, C)), this.wg.add(d, b)) } var e = this.xa, d = -1; if (c === this) { for (var f = -1, h = this.xa.n, k = h.length, l = 0; l < k; l++)if (h[l] === b) { f = l; break } if (-1 !== f) { if (f === a || f + 1 >= e.count && a >= e.count) return; e.$c(f); d = f } else w.k("element " + b.toString() + " has panel " + c.toString() + " but is not contained by it.") } if (0 > a || a > e.count) a = e.count; e.Pd(a, b); this.H(); b.H(); null !== b.Td ? this.Ek = !0 : b instanceof C && !0 === b.Ek && (this.Ek = !0); this.Tj = null; c = this.U; null !== c && (c.Om = null, c.ck = NaN, this.Ek && c instanceof U && (c.Ek = !0), c.Ek && c instanceof U && (c.ne = null), e = this.g, null !== e && e.oa.ab || (-1 !== d && c.Zc(Rf, "elements", this, b, null, d, null), c.Zc(Qf, "elements", this, null, b, null, a), this.eu() || bq(this, b, !1))) }; w.defineProperty(C, { Ek: null }, function () { return 0 !== (this.P & 8388608) }, function (a) { 0 !== (this.P & 8388608) !== a && (this.P ^= 8388608) }); function cq(a, b) { a.P = b ? a.P | 16777216 : a.P & -16777217 } C.prototype.remove = C.prototype.remove = function (a) { w.G(a, G, C, "remove:element"); for (var b = this.xa.n, c = b.length, d = -1, e = 0; e < c; e++)if (b[e] === a) { d = e; break } -1 !== d && this.lf(d) }; C.prototype.removeAt = C.prototype.$c = function (a) { 0 <= a && this.lf(a) }; C.prototype.lf = function (a) { var b = this.xa, c = b.ea(a); c.Tm = null; c.em(null); if (null !== this.wg) { var d = c.data; "object" === typeof d && this.wg.remove(d) } b.$c(a); am(this, !1); this.H(); this.en === c && (this.en = null); this.Tj = null; b = this.U; null !== b && (b.Om = null, b.ck = NaN, b.de(), d = this.g, null !== d && d.oa.ab || b.Zc(Rf, "elements", this, c, null, a, null)) }; w.u(C, { pq: "rowCount" }, function () { return void 0 === this.ae ? 0 : this.ae.length }); C.prototype.getRowDefinition = C.prototype.Md = function (a) { 0 > a && w.Fa(a, ">= 0", C, "getRowDefinition:idx"); a = Math.round(a); var b = this.ae; if (void 0 === b[a]) { var c = new Vg; c.em(this); c.xe = !0; c.index = a; b[a] = c } return b[a] }; C.prototype.removeRowDefinition = C.prototype.VF = function (a) { 0 > a && w.Fa(a, ">= 0", C, "removeRowDefinition:idx"); a = Math.round(a); var b = this.ae; this.Zc(Rf, "coldefs", this, b[a], null, a, null); b[a] && delete b[a]; this.H() }; w.u(C, { Ip: "columnCount" }, function () { return void 0 === this.Wd ? 0 : this.Wd.length }); C.prototype.getColumnDefinition = C.prototype.Ld = function (a) { 0 > a && w.Fa(a, ">= 0", C, "getColumnDefinition:idx"); a = Math.round(a); var b = this.Wd; if (void 0 === b[a]) { var c = new Vg; c.em(this); c.xe = !1; c.index = a; b[a] = c } return b[a] }; C.prototype.removeColumnDefinition = C.prototype.TF = function (a) { 0 > a && w.Fa(a, ">= 0", C, "removeColumnDefinition:idx"); a = Math.round(a); var b = this.Wd; this.Zc(Rf, "coldefs", this, b[a], null, a, null); b[a] && delete b[a]; this.H() }; w.defineProperty(C, { zJ: "rowSizing" }, function () { return void 0 === this.Wm ? hp : this.Wm }, function (a) { if (void 0 !== this.Wm) { var b = this.Wm; b !== a && (a !== hp && a !== Pp && w.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: " + a), this.Wm = a, this.H(), this.h("rowSizing", b, a)) } }); w.defineProperty(C, { vH: "columnSizing" }, function () { return void 0 === this.um ? hp : this.um }, function (a) { if (void 0 !== this.um) { var b = this.um; b !== a && (a !== hp && a !== Pp && w.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: " + a), this.um = a, this.H(), this.h("columnSizing", b, a)) } }); w.defineProperty(C, { WL: "topIndex" }, function () { return void 0 === this.fj ? 0 : this.fj }, function (a) { if (void 0 !== this.fj) { var b = this.fj; b !== a && ((!isFinite(a) || 0 > a) && w.k("Panel.topIndex must be greater than zero and a real number, not: " + a), this.fj = a, this.H(), this.h("topIndex", b, a)) } }); w.defineProperty(C, { iL: "leftIndex" }, function () { return void 0 === this.Pi ? 0 : this.Pi }, function (a) { if (void 0 !== this.Pi) { var b = this.Pi; b !== a && ((!isFinite(a) || 0 > a) && w.k("Panel.leftIndex must be greater than zero and a real number, not: " + a), this.Pi = a, this.H(), this.h("leftIndex", b, a)) } }); C.prototype.findRowForLocalY = function (a) { if (0 > a || this.type !== So) return -1; for (var b = 0, c = this.ae, d = c.length, e = this.fj; e < d; e++) { var f = c[e]; if (void 0 !== f && (b += f.total, a < b)) break } return e }; C.prototype.findColumnForLocalX = function (a) { if (0 > a || this.type !== So) return -1; for (var b = 0, c = this.Wd, d = c.length, e = this.Pi; e < d; e++) { var f = c[e]; if (void 0 !== f && (b += f.total, a < b)) break } return e }; C.prototype.graduatedPointForValue = function (a, b) { void 0 === b && (b = new z(NaN, NaN)); if (this.type !== ip) return b.m(NaN, NaN), b; a = Math.min(Math.max(a, this.Dk), this.sA); var c = (a - this.Dk) / this.Yt, d = this.Kd(); d.jf.cI(c, b); c = w.Jf(); c.set(d.transform); b.transform(c); w.we(c); return b }; C.prototype.graduatedValueForPoint = function (a) { if (this.type !== ip) return NaN; var b = this.Kd(), c = b.jf, d = w.Jf(); d.set(b.transform); d.vx(); a.transform(d); w.we(d); return c.ZH(a) * this.Yt + this.Dk }; w.defineProperty(C, { data: "data" }, function () { return this.Yd }, function (a) { var b = this.Yd; if (b !== a) { var c = this instanceof T && !(this instanceof jh); c && w.j(a, "object", C, "data"); lh(this); this.Yd = a; var d = this.g; null !== d && (c ? this instanceof W ? (null !== b && d.Kj.remove(b), null !== a && d.Kj.add(a, this)) : this instanceof T && (null !== b && d.Di.remove(b), null !== a && d.Di.add(a, this)) : (c = this.O, null !== c && null !== c.wg && (null !== b && c.wg.remove(b), null !== a && c.wg.add(a, this)))); this.h("data", b, a); null !== d && d.oa.ab || null !== a && this.Hb() } }); w.defineProperty(C, { ju: "itemIndex" }, function () { return this.Sr }, function (a) { var b = this.Sr; b !== a && (this.Sr = a, this.h("itemIndex", b, a)) }); function ap(a) { a = a.Zk; return null !== a && a.Q } function lh(a) { var b = a.Zk; if (null === b) null !== a.data && w.k("Template cannot have .data be non-null: " + a), a.Zk = b = new H(ah); else if (b.Q) return; var c = new H(G); cq(a, !1); $o(a, a, function (a, d) { var e = d.vc; if (null !== e) for (Wo(d, !1), e = e.i; e.next();) { var f = e.value; f.mode === ch && Wo(d, !0); var h = f.xq; null !== h && ("/" === h && cq(a, !0), h = dh(f, a, d), null !== h && (c.add(h), null === h.op && (h.op = new H(ah)), h.op.add(f))); b.add(f) } if (d instanceof C && d.type === So) { if (0 < d.ae.length) for (e = d.ae, f = e.length, h = 0; h < f; h++) { var k = e[h]; if (void 0 !== k && null !== k.vc) for (var l = k.vc.i; l.next();) { var t = l.value; t.Gg = k; t.jt = 2; t.wp = k.index; b.add(t) } } if (0 < d.Wd.length) for (e = d.Wd, f = e.length, h = 0; h < f; h++)if (k = e[h], void 0 !== k && null !== k.vc) for (l = k.vc.i; l.next();)t = l.value, t.Gg = k, t.jt = 1, t.wp = k.index, b.add(t) } }); for (var d = c.i; d.next();) { var e = d.value; if (null !== e.op) { Wo(e, !0); for (var f = e.op.i; f.next();) { var h = f.value; null === e.vc && (e.vc = new H(ah)); e.vc.add(h) } } e.op = null } for (d = b.i; d.next();)if (e = d.value, f = e.Gg, null !== f) { e.Gg = null; var k = e.oy, l = k.indexOf("."); 0 < l && f instanceof C && (h = k.substring(0, l), k = k.substr(l + 1), l = f.xd(h), null !== l ? (f = l, e.oy = k) : w.trace('Warning: unable to find GraphObject named "' + h + '" for Binding: ' + e.toString())); f instanceof Vg ? (e.im = w.Nd(f.O), f.O.oo = e.im) : (e.im = w.Nd(f), f.oo = e.im) } b.freeze(); a instanceof T && a.ee() && a.af() } C.prototype.copyTemplate = function () { var a = this.copy(); a.ZJ(function (a) { a instanceof C && (a.Zk = null, a.Yd = null); var c = a.vc; null !== c && (a.vc = null, c.each(function (c) { a.bind(c.copy()) })) }); return a }; C.prototype.updateTargetBindings = C.prototype.Hb = function (a) { var b = this.Zk; if (null !== b) for (void 0 === a && (a = ""), b = b.i; b.next();) { var c = b.value, d = c.nG; if ("" === a || "" === d || d === a) if (d = c.oy, null !== c.AH || "" !== d) { var d = this.data, e = c.xq; if (null !== e) d = "" === e ? this : "/" === e ? this : "." === e ? this : ".." === e ? this : this.xd(e); else { var f = this.g; null !== f && c.Dx && (d = f.ba.Hk) } if (null !== d) { var f = this, h = c.im; if (-1 !== h) { if (f = this.mx(h), null === f) continue } else null !== c.Gg && (f = c.Gg); "/" === e ? d = f.U : "." === e ? d = f : ".." === e && (d = f.O); e = c.jt; if (0 !== e) { if (!(f instanceof C)) continue; h = f; 1 === e ? f = h.Ld(c.wp) : 2 === e && (f = h.Md(c.wp)) } void 0 !== f && c.CG(f, d) } } } }; w.defineProperty(C, { cq: "itemArray" }, function () { return this.$j }, function (a) { var b = this.$j; if (b !== a) { var c = this.g; null !== c && null !== b && Sm(c, this); this.$j = a; null !== c && null !== a && Om(c, this); this.h("itemArray", b, a); null !== c && c.oa.ab || this.ZA() } }); function kn(a) { return a.type === Mj || a.type === Fl || a.type === hj || a.type === So && 0 < a.xa.length && (a = a.xa.ea(0), a.Yf && a instanceof C && (a.type === Jo || a.type === Ko)) ? !0 : !1 } C.prototype.rebuildItemElements = C.prototype.ZA = function () { var a = 0; for (kn(this) && (a = 1); this.xa.length > a;)this.lf(this.xa.length - 1); a = this.cq; if (null !== a) for (var b = w.Za(a), c = 0; c < b; c++)jn(this, w.Ba(a, c), c) }; C.prototype.findItemPanelForData = C.prototype.TH = function (a) { if (void 0 === a || null === a || null === this.wg) return null; w.j(a, "object", C, "findItemPanelForData"); return this.wg.ja(a) }; function jn(a, b, c) { if (!(void 0 === b || null === b || 0 > c)) { var d; d = dq(a, b); var e = a.EI, f = null; null !== e && (f = e.ja(d)); null === f && (eq || (eq = !0, w.trace('No item template Panel found for category "' + d + '" on ' + a), w.trace(" Using default item template."), d = new C, e = new Hh, e.bind(new ah("text", "", Sf)), d.add(e), fq = d), f = fq); d = f; null !== d && (lh(d), d = d.copy(), 0 !== (d.P & 16777216) && (e = a.Rl(), null !== e && cq(e, !0)), "object" === typeof b && (null === a.wg && (a.wg = new la(Object, C)), a.wg.add(b, d)), e = c, kn(a) && e++ , a.Pd(e, d), d.Yd = b, ln(a, e, c), d.Yd = null, d.data = b) } } function ln(a, b, c) { for (a = a.xa; b < a.length;) { var d = a.ea(b); if (d instanceof C) { var e = b, f = c; d.type === Jo ? d.Vb = e : d.type === Ko && (d.column = e); d.ju = f } b++; c++ } } w.defineProperty(C, { gL: "itemTemplate" }, function () { return null === this.xg ? null : this.xg.ja("") }, function (a) { if (null === this.xg) { if (null === a) return; this.xg = new la("string", C) } var b = this.xg.ja(""); b !== a && (w.G(a, C, C, "itemTemplate"), (a instanceof T || a.Yf) && w.k("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: " + a), this.xg.add("", a), this.h("itemTemplate", b, a), a = this.g, null !== a && a.oa.ab || this.ZA()) }); w.defineProperty(C, { EI: "itemTemplateMap" }, function () { return this.xg }, function (a) { var b = this.xg; if (b !== a) { w.G(a, la, C, "itemTemplateMap"); for (var c = a.i; c.next();) { var d = c.value; (d instanceof T || d.Yf) && w.k("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: " + d) } this.xg = a; this.h("itemTemplateMap", b, a); a = this.g; null !== a && a.oa.ab || this.ZA() } }); w.defineProperty(C, { fL: "itemCategoryProperty" }, function () { return this.To }, function (a) { var b = this.To; b !== a && ("string" !== typeof a && "function" !== typeof a && w.Bd(a, "string or function", C, "itemCategoryProperty"), this.To = a, this.h("itemCategoryProperty", b, a)) }); function dq(a, b) { if (null === b) return ""; var c = a.To, d = ""; if ("function" === typeof c) d = c(b); else if ("string" === typeof c && "object" === typeof b) { if ("" === c) return ""; d = w.tb(b, c) } else return ""; if (void 0 === d) return ""; if ("string" === typeof d) return d; w.k("Panel.getCategoryForItemData found a non-string category for " + b + ": " + d); return "" } var eq = !1, fq = null; w.defineProperty(C, { Gn: "isAtomic" }, function () { return 0 !== (this.P & 1048576) }, function (a) { var b = 0 !== (this.P & 1048576); b !== a && (w.j(a, "boolean", C, "isAtomic"), this.P ^= 1048576, this.h("isAtomic", b, a)) }); w.defineProperty(C, { cu: "isClipping" }, function () { return 0 !== (this.P & 2097152) }, function (a) { var b = 0 !== (this.P & 2097152); b !== a && (w.j(a, "boolean", C, "isClipping"), this.P ^= 2097152, this.H(), this.h("isClipping", b, a)) }); w.defineProperty(C, { uF: "isOpposite" }, function () { return 0 !== (this.P & 33554432) }, function (a) { var b = 0 !== (this.P & 33554432); b !== a && (w.j(a, "boolean", C, "isOpposite"), this.P ^= 33554432, this.H(), this.h("isOpposite", b, a)) }); w.defineProperty(C, { isEnabled: "isEnabled" }, function () { return 0 !== (this.P & 4194304) }, function (a) { var b = 0 !== (this.P & 4194304); if (b !== a) { w.j(a, "boolean", C, "isEnabled"); var c = null === this.O || this.O.eu(); this.P ^= 4194304; this.h("isEnabled", b, a); b = this.g; null !== b && b.oa.ab || c && bq(this, this, a) } }); function bq(a, b, c) { var d = b.JE; null !== d && d(b, c); if (b instanceof C) { b = b.xa.n; for (var d = b.length, e = 0; e < d; e++) { var f = b[e]; c && f instanceof C && !f.isEnabled || bq(a, f, c) } } } w.defineProperty(C, { cK: "alignmentFocusName" }, function () { return this.Hj }, function (a) { var b = this.Hj; b !== a && (this.Hj = a, this.H(), this.h("alignmentFocusName", b, a)) }); function Vg() { w.nc(this); this.nh = null; this.Qv = !0; this.wc = 0; this.hf = NaN; this.ek = 0; this.dk = Infinity; this.ie = rc; this.jb = this.Ra = 0; this.vc = null; this.bt = gq; this.Fg = oo; this.Xs = this.ik = null; this.Ys = NaN; this.Eb = this.ai = null; this.br = !1 } w.ga("RowColumnDefinition", Vg); Vg.prototype.copy = function () { var a = new Vg; a.Qv = this.Qv; a.wc = this.wc; a.hf = this.hf; a.ek = this.ek; a.dk = this.dk; a.ie = this.ie; a.Ra = this.Ra; a.jb = this.jb; a.Fg = this.Fg; a.bt = this.bt; a.ik = null === this.ik ? null : this.ik.S(); a.Xs = this.Xs; a.Ys = this.Ys; a.ai = null; null !== this.ai && (a.ai = w.Jl(this.ai)); a.Eb = this.Eb; a.br = this.br; a.vc = this.vc; return a }; Vg.prototype.Jp = function (a) { w.G(a, Vg, Vg, "copyFrom:pd"); a.xe ? this.height = a.height : this.width = a.width; this.Ch = a.Ch; this.he = a.he; this.alignment = a.alignment; this.stretch = a.stretch; this.Lu = a.Lu; this.ik = null === a.ik ? null : a.ik.S(); this.rq = a.rq; this.sq = a.sq; this.ai = null; a.ai && (this.ai = w.Jl(a.ai)); this.background = a.background; this.fA = a.fA; this.vc = a.vc }; Vg.prototype.ic = function (a) { a.Ee === Vg ? this.Lu = a : w.Ej(this, a) }; Vg.prototype.toString = function () { return "RowColumnDefinition " + (this.xe ? "(Row " : "(Column ") + this.index + ") #" + w.Nd(this) }; var gq; Vg.Default = gq = w.p(Vg, "Default", 0); var Pp; Vg.None = Pp = w.p(Vg, "None", 1); var hp; Vg.ProportionalExtra = hp = w.p(Vg, "ProportionalExtra", 2); Vg.prototype.em = function (a) { this.nh = a }; Vg.prototype.computeEffectiveSpacingTop = Vg.prototype.wE = function () { var a = 0; if (0 !== this.index) { var b = this.nh, c = this.rq; null === c && null !== b && (c = this.xe ? b.Ei : b.Oh); null !== c && (a = this.sq, isNaN(a) && (a = null !== b ? this.xe ? b.Qh : b.Ph : 0)) } b = this.hG; if (null === b) if (b = this.nh, null !== b) b = b.Lj; else return a; return a + (this.xe ? b.top : b.left) }; Vg.prototype.computeEffectiveSpacing = Vg.prototype.Ze = function () { var a = 0; if (0 !== this.index) { var b = this.nh, c = this.rq; null === c && null !== b && (c = this.xe ? b.Ei : b.Oh); null !== c && (a = this.sq, isNaN(a) && (a = null !== b ? this.xe ? b.Qh : b.Ph : 0)) } b = this.hG; if (null === b) if (b = this.nh, null !== b) b = b.Lj; else return a; return a + (this.xe ? b.top + b.bottom : b.left + b.right) }; Vg.prototype.ed = function (a, b, c, d, e) { var f = this.nh; if (null !== f && (f.Zc(Of, a, this, b, c, d, e), null !== this.vc && (b = f.g, null !== b && !b.Oe && (f = f.Rl(), null !== f && (b = f.data, null !== b))))) for (c = this.vc.i; c.next();)c.value.py(this, b, a, f) }; w.u(Vg, { O: "panel" }, function () { return this.nh }); w.defineProperty(Vg, { xe: "isRow" }, function () { return this.Qv }, function (a) { this.Qv = a }); w.defineProperty(Vg, { index: "index" }, function () { return this.wc }, function (a) { this.wc = a }); w.defineProperty(Vg, { height: "height" }, function () { return this.hf }, function (a) { var b = this.hf; b !== a && (0 > a && w.Fa(a, ">= 0", Vg, "height"), this.hf = a, this.Ya = this.Ra, null !== this.O && this.O.H(), this.ed("height", b, a)) }); w.defineProperty(Vg, { width: "width" }, function () { return this.hf }, function (a) { var b = this.hf; b !== a && (0 > a && w.Fa(a, ">= 0", Vg, "width"), this.hf = a, this.Ya = this.Ra, null !== this.O && this.O.H(), this.ed("width", b, a)) }); w.defineProperty(Vg, { Ch: "minimum" }, function () { return this.ek }, function (a) { var b = this.ek; b !== a && ((0 > a || !isFinite(a)) && w.Fa(a, ">= 0", Vg, "minimum"), this.ek = a, this.Ya = this.Ra, null !== this.O && this.O.H(), this.ed("minimum", b, a)) }); w.defineProperty(Vg, { he: "maximum" }, function () { return this.dk }, function (a) { var b = this.dk; b !== a && (0 > a && w.Fa(a, ">= 0", Vg, "maximum"), this.dk = a, this.Ya = this.Ra, null !== this.O && this.O.H(), this.ed("maximum", b, a)) }); w.defineProperty(Vg, { alignment: "alignment" }, function () { return this.ie }, function (a) { var b = this.ie; b.L(a) || (this.ie = a.S(), null !== this.O && this.O.H(), this.ed("alignment", b, a)) }); w.defineProperty(Vg, { stretch: "stretch" }, function () { return this.Fg }, function (a) { var b = this.Fg; b !== a && (this.Fg = a, null !== this.O && this.O.H(), this.ed("stretch", b, a)) }); w.defineProperty(Vg, { hG: "separatorPadding" }, function () { return this.ik }, function (a) { "number" === typeof a && (a = new db(a)); var b = this.ik; null !== a && null !== b && b.L(a) || (null !== a && (a = a.S()), this.ik = a, null !== this.O && this.O.H(), this.ed("separatorPadding", b, a)) }); w.defineProperty(Vg, { rq: "separatorStroke" }, function () { return this.Xs }, function (a) { var b = this.Xs; b !== a && (null === a || "string" === typeof a || a instanceof ha) && (a instanceof ha && a.freeze(), this.Xs = a, null !== this.O && this.O.H(), this.ed("separatorStroke", b, a)) }); w.defineProperty(Vg, { sq: "separatorStrokeWidth" }, function () { return this.Ys }, function (a) { var b = this.Ys; b !== a && (this.Ys = a, null !== this.O && this.O.H(), this.ed("separatorStrokeWidth", b, a)) }); w.defineProperty(Vg, { KL: "separatorDashArray" }, function () { return this.ai }, function (a) { var b = this.ai; if (b !== a) { null === a || Array.isArray(a) || w.Bd(a, "Array", Vg, "separatorDashArray:value"); if (null !== a) { for (var c = a.length, d = 0, e = 0; e < c; e++) { var f = a[e]; "number" === typeof f && 0 <= f && isFinite(f) || w.k("separatorDashArray value " + f + " at index " + e + " must be a positive number or zero."); d += f } if (0 === d) { if (null === b) return; a = null } } this.ai = a; null !== this.O && this.O.na(); this.ed("separatorDashArray", b, a) } }); w.defineProperty(Vg, { background: "background" }, function () { return this.Eb }, function (a) { var b = this.Eb; b !== a && (null === a || "string" === typeof a || a instanceof ha) && (a instanceof ha && a.freeze(), this.Eb = a, null !== this.O && this.O.na(), this.ed("background", b, a)) }); w.defineProperty(Vg, { fA: "coversSeparators" }, function () { return this.br }, function (a) { var b = this.br; b !== a && (w.j(a, "boolean", Vg, "coversSeparators"), this.br = a, null !== this.O && this.O.na(), this.ed("coversSeparators", b, a)) }); w.defineProperty(Vg, { Lu: "sizing" }, function () { return this.bt }, function (a) { var b = this.bt; b !== a && (this.bt = a, null !== this.O && this.O.H(), this.ed("sizing", b, a)) }); function Op(a) { if (a.Lu === gq) { var b = a.nh; return a.xe ? b.zJ : b.vH } return a.Lu } w.defineProperty(Vg, { Ya: "actual" }, function () { return this.Ra }, function (a) { this.Ra = isNaN(this.hf) ? Math.max(Math.min(this.dk, a), this.ek) : Math.max(Math.min(this.dk, this.hf), this.ek) }); w.defineProperty(Vg, { total: "total" }, function () { return this.Ra + this.Ze() }, function (a) { this.Ra = isNaN(this.hf) ? Math.max(Math.min(this.dk, a), this.ek) : Math.max(Math.min(this.dk, this.hf), this.ek); this.Ra = Math.max(0, this.Ra - this.Ze()) }); w.defineProperty(Vg, { position: "position" }, function () { return this.jb }, function (a) { this.jb = a }); Vg.prototype.bind = Vg.prototype.bind = function (a) { a.Gg = this; var b = this.O; if (null !== b) { var c = b.Rl(); null !== c && ap(c) && w.k("Cannot add a Binding to a RowColumnDefinition that is already frozen: " + a + " on " + b) } null === this.vc && (this.vc = new H(ah)); this.vc.add(a) }; function Y() { G.call(this); this.Rf = this.Ua = null; this.Fo = "None"; this.zr = oo; this.rc = this.Cd = "black"; this.ji = 1; this.rp = "butt"; this.tp = "miter"; this.dn = 10; this.sp = null; this.tf = 0; this.ii = this.hi = rc; this.zs = this.ys = NaN; this.Jr = !1; this.Bs = null; this.Ho = this.yp = "None"; this.ug = 1; this.tg = 0; this.sg = 1 } w.Ka(Y, G); w.ga("Shape", Y); Y.prototype.cloneProtected = function (a) { G.prototype.cloneProtected.call(this, a); a.Ua = this.Ua; a.Fo = this.Fo; a.zr = this.zr; a.Rf = this.Rf; a.Cd = this.Cd; a.rc = this.rc; a.ji = this.ji; a.rp = this.rp; a.tp = this.tp; a.dn = this.dn; null !== this.sp && (a.sp = w.Jl(this.sp)); a.tf = this.tf; a.hi = this.hi.S(); a.ii = this.ii.S(); a.ys = this.ys; a.zs = this.zs; a.Jr = this.Jr; a.Bs = this.Bs; a.yp = this.yp; a.Ho = this.Ho; a.ug = this.ug; a.tg = this.tg; a.sg = this.sg }; Y.prototype.ic = function (a) { a === Oj || a === Qj || a === Rj || a === oo ? this.pA = a : G.prototype.ic.call(this, a) }; Y.prototype.toString = function () { return "Shape(" + ("None" !== this.Cb ? this.Cb : "None" !== this.yq ? this.yq : this.nA) + ")#" + w.Nd(this) }; function hq(a, b, c, d) { var e = c.length; if (!(4 > e)) { for (var f = d.za, h = Math.max(1, f.width), f = f.height, k = c[0], l = c[1], m = 0, n = 0, p = 0, q = 0, r = 0, s = 0, u = q = 0, t = w.cb(), x = 2; x < e; x += 2)m = c[x], n = c[x + 1], p = m - k, q = n - l, 0 === p && (p = .001), r = q / p, s = Math.atan2(q, p), q = Math.sqrt(p * p + q * q), t.push([p, s, r, q]), u += q, k = m, l = n; k = c[0]; l = c[1]; p = d.za.width; d instanceof Y && (p -= d.lb); 1 > p && (p = 1); for (var e = c = p, m = h / 2, n = 0 === m ? !1 : !0, x = 0, q = t[x], p = q[0], s = q[1], r = q[2], q = q[3], v = 0; .1 <= u;) { 0 === v && (n ? (e = c, e -= m, u -= m, n = !1) : e = c, 0 === e && (e = 1)); if (e > u) { w.ua(t); return } e > q ? (v = e - q, e = q) : v = 0; var A = Math.sqrt(e * e / (1 + r * r)); 0 > p && (A = -A); k += A; l += r * A; a.translate(k, l); a.rotate(s); a.translate(-(h / 2), -(f / 2)); 0 === v && d.yk(a, b); a.translate(h / 2, f / 2); a.rotate(-s); a.translate(-k, -l); u -= e; q -= e; if (0 !== v) { x++; if (x === t.length) { w.ua(t); return } q = t[x]; p = q[0]; s = q[1]; r = q[2]; q = q[3]; e = v } } w.ua(t) } } Y.prototype.yk = function (a, b) { if (null !== this.rc || null !== this.Cd) { null !== this.Cd && No(this, a, this.Cd, !0, !1); null !== this.rc && No(this, a, this.rc, !1, !1); var c = this.ji; if (0 === c) { var d = this.U; d instanceof jh && d.type === hj && "Selection" === d.ud && d.rb instanceof Y && d.uf.Kd() === d.rb && (c = d.rb.lb) } a.lineWidth = c; a.lineJoin = this.tp; a.lineCap = this.rp; a.miterLimit = this.dn; var e = !1; this.U && b.qj("drawShadows") && (e = this.U.am); var f = !0; null !== this.rc && null === this.Cd && (f = !1); var d = !1, h = !0, k = this.qG; null !== k && (d = !0, h = a.kA(k, this.tf)); var l = this.Ua; if (null !== l) { if (l.ma === Ge) a.beginPath(), d && !h ? yo(a, l.zc, l.Ic, l.yb, l.Gb, k, this.tf) : (a.moveTo(l.zc, l.Ic), a.lineTo(l.yb, l.Gb)), null !== this.Cd && a.Mg(this.Cd), 0 !== c && null !== this.rc && a.Dj(); else if (l.ma === He) { var m = l.zc, n = l.Ic, p = l.yb, q = l.Gb, l = Math.min(m, p), r = Math.min(n, q), m = Math.abs(p - m), n = Math.abs(q - n); null !== this.Cd && (a.beginPath(), a.rect(l, r, m, n), a.Mg(this.Cd)); if (null !== this.rc) { var s = p = 0, u = 0; f && e && (p = a.shadowOffsetX, s = a.shadowOffsetY, u = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0); d && !h ? (h = w.cb(), h.push(l), h.push(r), h.push(l + m), h.push(r), h.push(l + m), h.push(r + n), h.push(l), h.push(r + n), h.push(l), h.push(r), a.beginPath(), iq(a, h, k, this.tf), a.Dj(), w.ua(h)) : 0 !== c && (a.beginPath(), a.rect(l, r, m, n), a.Dj()); f && e && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = u) } } else if (l.ma === Pe) m = l.zc, n = l.Ic, p = l.yb, q = l.Gb, l = Math.abs(p - m) / 2, r = Math.abs(q - n) / 2, m = Math.min(m, p) + l, n = Math.min(n, q) + r, a.beginPath(), a.moveTo(m, n - r), a.bezierCurveTo(m + dd * l, n - r, m + l, n - dd * r, m + l, n), a.bezierCurveTo(m + l, n + dd * r, m + dd * l, n + r, m, n + r), a.bezierCurveTo(m - dd * l, n + r, m - l, n + dd * r, m - l, n), a.bezierCurveTo(m - l, n - dd * r, m - dd * l, n - r, m, n - r), a.closePath(), null !== this.Cd && a.Mg(this.Cd), d && !h && (h = w.cb(), Zd(m, n - r, m + dd * l, n - r, m + l, n - dd * r, m + l, n, .5, h), Zd(m + l, n, m + l, n + dd * r, m + dd * l, n + r, m, n + r, .5, h), Zd(m, n + r, m - dd * l, n + r, m - l, n + dd * r, m - l, n, .5, h), Zd(m - l, n, m - l, n - dd * r, m - dd * l, n - r, m, n - r, .5, h), a.beginPath(), iq(a, h, k, this.tf), w.ua(h)), 0 !== c && null !== this.rc && (f && e ? (p = a.shadowOffsetX, s = a.shadowOffsetY, u = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0, a.Dj(), a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = u) : a.Dj()); else if (l.ma === De) { r = l.Nj; n = r.length; for (q = 0; q < n; q++) { m = r.n[q]; a.beginPath(); a.moveTo(m.ha, m.fa); for (var p = m.vb.n, s = p.length, t = null, u = 0; u < s; u++) { var x = p[u]; switch (x.ma) { case pf: a.moveTo(x.C, x.D); break; case Re: a.lineTo(x.C, x.D); break; case qf: a.bezierCurveTo(x.Ed, x.Xe, x.oh, x.Dg, x.yb, x.Gb); break; case rf: a.quadraticCurveTo(x.Ed, x.Xe, x.yb, x.Gb); break; case sf: if (x.radiusX === x.radiusY) t = Math.PI / 180, a.arc(x.Ed, x.Xe, x.radiusX, x.ze * t, (x.ze + x.of) * t, 0 > x.of); else { var t = uf(x, m), v = t.length; if (0 === v) { a.lineTo(x.ka, x.ra); break } for (var A = 0; A < v; A++) { var y = t[A]; 0 === A && a.lineTo(y[0], y[1]); a.bezierCurveTo(y[2], y[3], y[4], y[5], y[6], y[7]) } } break; case tf: A = v = 0; if (null !== t && t.type === sf) { t = uf(t, m); y = t.length; if (0 === y) { a.lineTo(x.ka, x.ra); break } t = t[y - 1] || null; null !== t && (v = t[6], A = t[7]) } else v = null !== t ? t.C : m.ha, A = null !== t ? t.D : m.fa; t = vf(x, m, v, A); v = t.length; if (0 === v) { a.lineTo(x.ka, x.ra); break } for (A = 0; A < v; A++)y = t[A], a.bezierCurveTo(y[2], y[3], y[4], y[5], y[6], y[7]); break; default: w.k("Segment not of valid type: " + x.ma) }x.Th && a.closePath(); t = x } e ? (u = s = p = 0, m.Qo ? (!0 === m.Cm && null !== this.Cd ? (a.Mg(this.Cd), f = !0) : f = !1, 0 !== c && null !== this.rc && (f && (p = a.shadowOffsetX, s = a.shadowOffsetY, u = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), d && !h || a.Dj(), f && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = u))) : (f && (p = a.shadowOffsetX, s = a.shadowOffsetY, u = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), !0 === m.Cm && null !== this.Cd && a.Mg(this.Cd), 0 !== c && null !== this.rc && (d && !h || a.Dj()), f && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = u))) : (!0 === m.Cm && null !== this.Cd && a.Mg(this.Cd), 0 === c || null === this.rc || d && !h || a.Dj()) } if (d && !h) for (c = f, f = l.Nj, h = f.length, l = 0; l < h; l++) { r = f.n[l]; a.beginPath(); n = w.cb(); n.push(r.ha); n.push(r.fa); q = r.ha; m = r.fa; p = q; s = m; u = r.vb.n; x = u.length; for (t = 0; t < x; t++) { v = u[t]; switch (v.ma) { case pf: iq(a, n, k, this.tf); n.length = 0; n.push(v.C); n.push(v.D); q = v.C; m = v.D; p = q; s = m; break; case Re: n.push(v.C); n.push(v.D); q = v.C; m = v.D; break; case qf: Zd(q, m, v.Ed, v.Xe, v.oh, v.Dg, v.yb, v.Gb, .5, n); q = v.C; m = v.D; break; case rf: ie(q, m, v.Ed, v.Xe, v.yb, v.Gb, .5, n); q = v.C; m = v.D; break; case sf: A = uf(v, r); y = A.length; if (0 === y) { n.push(v.ka); n.push(v.ra); q = v.ka; m = v.ra; break } for (var K = 0; K < y; K++) { var E = A[K]; Zd(q, m, E[2], E[3], E[4], E[5], E[6], E[7], .5, n); q = E[6]; m = E[7] } break; case tf: A = vf(v, r, q, m); y = A.length; if (0 === y) { n.push(v.ka); n.push(v.ra); q = v.ka; m = v.ra; break } for (K = 0; K < y; K++)E = A[K], Zd(q, m, E[2], E[3], E[4], E[5], E[6], E[7], .5, n), q = E[6], m = E[7]; break; default: w.k("Segment not of valid type: " + v.ma) }v.Th && (n.push(p), n.push(s), iq(a, n, k, this.tf)) } iq(a, n, k, this.tf); w.ua(n); null !== this.rc && (q = n = r = 0, c && e && (r = a.shadowOffsetX, n = a.shadowOffsetY, q = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), a.Dj(), c && e && (a.shadowOffsetX = r, a.shadowOffsetY = n, a.shadowBlur = q)) } } d && a.hA(); if (null !== this.Rx) { d = this.Rx; xk(d, Infinity, Infinity); k = d.za; d.jc(0, 0, k.width, k.height); c = this.jf; a.save(); a.beginPath(); k = w.cb(); if (c.type === Ge) k.push(c.ha), k.push(c.fa), k.push(c.C), k.push(c.D), hq(a, b, k, d); else if (c.type === De) for (h = c.fc.i; h.next();) { l = h.value; k.length = 0; k.push(l.ha); k.push(l.fa); f = l.ha; r = l.fa; n = f; q = r; m = l.vb.n; p = m.length; for (s = 0; s < p; s++) { u = m[s]; switch (u.ma) { case pf: hq(a, b, k, d); k.length = 0; k.push(u.C); k.push(u.D); f = u.C; r = u.D; n = f; q = r; break; case Re: k.push(u.C); k.push(u.D); f = u.C; r = u.D; break; case qf: Zd(f, r, u.Ed, u.Xe, u.oh, u.Dg, u.yb, u.Gb, .5, k); f = u.C; r = u.D; break; case rf: ie(f, r, u.Ed, u.Xe, u.yb, u.Gb, .5, k); f = u.C; r = u.D; break; case sf: c = uf(u, l); e = c.length; if (0 === e) { k.push(u.ka); k.push(u.ra); f = u.ka; r = u.ra; break } for (x = 0; x < e; x++)t = c[x], Zd(f, r, t[2], t[3], t[4], t[5], t[6], t[7], .5, k), f = t[6], r = t[7]; break; case tf: c = vf(u, l, f, r); e = c.length; if (0 === e) { k.push(u.ka); k.push(u.ra); f = u.ka; r = u.ra; break } for (x = 0; x < e; x++)t = c[x], Zd(f, r, t[2], t[3], t[4], t[5], t[6], t[7], .5, k), f = t[6], r = t[7]; break; default: w.k("Segment not of valid type: " + u.ma) }u.Th && (k.push(n), k.push(q), hq(a, b, k, d)) } hq(a, b, k, d) } else if (c.type === He) k.push(c.ha), k.push(c.fa), k.push(c.C), k.push(c.fa), k.push(c.C), k.push(c.D), k.push(c.ha), k.push(c.D), k.push(c.ha), k.push(c.fa), hq(a, b, k, d); else if (c.type === Pe) { h = new Ee; h.ha = c.C; h.fa = (c.fa + c.D) / 2; f = new zf(sf); f.ze = 0; f.of = 360; f.ka = (c.ha + c.C) / 2; f.ra = (c.fa + c.D) / 2; f.radiusX = Math.abs(c.ha - c.C) / 2; f.radiusY = Math.abs(c.fa - c.D) / 2; h.add(f); c = uf(f, h); e = c.length; if (0 === e) k.push(f.ka), k.push(f.ra); else for (f = h.ha, r = h.fa, x = 0; x < e; x++)t = c[x], Zd(f, r, t[2], t[3], t[4], t[5], t[6], t[7], .5, k), f = t[6], r = t[7]; hq(a, b, k, d) } w.ua(k); a.restore(); a.Fe(!1) } } } }; function iq(a, b, c, d) { var e = b.length; if (!(4 > e)) { var f = .001, h = c.length, k = b[0], l = b[1]; if (4 === e) yo(a, k, l, b[2], b[3], c, d); else { a.moveTo(k, l); for (var m = f = 0, n = 0, p = 0, q = 0, r = p = 0, s = w.cb(), u = 2; u < e; u += 2)f = b[u], m = b[u + 1], n = f - k, p = m - l, 0 === n && (n = .001), q = p / n, p = Math.sqrt(n * n + p * p), s.push([n, q, p]), r += p, k = f, l = m; k = b[0]; l = b[1]; b = 0; for (var e = !0, f = c[b % h], m = 0 !== d, u = 0, p = s[u], n = p[0], q = p[1], p = p[2], t = 0; .1 <= r;) { 0 === t && (f = c[b % h], b++ , m && (d %= f, f -= d, m = !1)); f > r && (f = r); f > p ? (t = f - p, f = p) : t = 0; var x = Math.sqrt(f * f / (1 + q * q)); 0 > n && (x = -x); k += x; l += q * x; e ? a.lineTo(k, l) : a.moveTo(k, l); r -= f; p -= f; if (0 !== t) { u++; if (u === s.length) { w.ua(s); return } p = s[u]; n = p[0]; q = p[1]; p = p[2]; f = t } else e = !e } w.ua(s) } } } Y.prototype.getDocumentPoint = Y.prototype.Wa = function (a, b) { void 0 === b && (b = new z); if (a instanceof L) { a.Rd() && w.k("getDocumentPoint Spot must be a real, specific Spot, not: " + a.toString()); var c = this.Ja, d = this.lb; b.m(a.x * (c.width + d) - d / 2 + c.x + a.offsetX, a.y * (c.height + d) - d / 2 + c.y + a.offsetY) } else b.set(a); this.rh.nb(b); return b }; Y.prototype.vk = function (a, b) { var c = this.jf; if (null === c || null === this.fill && null === this.stroke) return !1; var d = c.gb, e = this.lb / 2; c.type !== Ge || b || (e += 2); var f = w.If(); f.assign(d); f.zf(e + 2, e + 2); if (!f.Ia(a)) return w.Db(f), !1; d = e + 1E-4; if (c.type === Ge) { if (null === this.stroke) return !1; d = (c.C - c.ha) * (a.x - c.ha) + (c.D - c.fa) * (a.y - c.fa); if (0 > (c.ha - c.C) * (a.x - c.C) + (c.fa - c.D) * (a.y - c.D) || 0 > d) return !1; w.Db(f); return Wd(c.ha, c.fa, c.C, c.D, e, a.x, a.y) } if (c.type === He) { var h = c.ha, k = c.fa, l = c.C, m = c.D; f.x = Math.min(h, l); f.y = Math.min(k, m); f.width = Math.abs(l - h); f.height = Math.abs(m - k); if (null === this.fill) { f.zf(-d, -d); if (f.Ia(a)) return w.Db(f), !1; f.zf(d, d) } null !== this.stroke && f.zf(e, e); e = f.Ia(a); w.Db(f); return e } if (c.type === Pe) { var h = c.ha, k = c.fa, l = c.C, m = c.D, c = Math.min(h, l), n = Math.min(k, m), h = Math.abs(l - h) / 2, k = Math.abs(m - k) / 2, c = a.x - (c + h), n = a.y - (n + k); if (null === this.fill) { h -= d; k -= d; if (0 >= h || 0 >= k || 1 >= c * c / (h * h) + n * n / (k * k)) return w.Db(f), !1; h += d; k += d } null !== this.stroke && (h += e, k += e); w.Db(f); return 0 >= h || 0 >= k ? !1 : 1 >= c * c / (h * h) + n * n / (k * k) } if (c.type === De) return w.Db(f), null === this.fill ? xf(c, a.x, a.y, e) : c.Ia(a, e, 1 < this.lb, b); w.k("Unknown Geometry type: " + c.type); return !1 }; Y.prototype.Nn = function (a, b, c, d) { var e = this.Ca, f = this.ji; a = Math.max(a, 0); b = Math.max(b, 0); var h; if (null !== this.Rf) h = this.jf.gb; else { var k = this.Cb, l = Sd[k]; if (void 0 === l) { var m = jq[k]; "string" === typeof m && (m = jq[m]); "function" === typeof m ? (l = m(null, 100, 100), Sd[k] = l) : w.k("Unsupported Figure: " + k) } h = l.gb } var k = h.width, l = h.height, m = h.width, n = h.height; switch (Eo(this, !0)) { case Oj: d = c = 0; break; case Fe: m = Math.max(a - f, 0); n = Math.max(b - f, 0); break; case qo: m = Math.max(a - f, 0); d = 0; break; case po: c = 0, n = Math.max(b - f, 0) }isFinite(e.width) && (m = e.width); isFinite(e.height) && (n = e.height); e = this.Ff; h = this.Bh; c = Math.max(c, h.width) - f; d = Math.max(d, h.height) - f; m = Math.min(e.width, m); n = Math.min(e.height, n); m = isFinite(m) ? Math.max(c, m) : Math.max(k, c); n = isFinite(n) ? Math.max(d, n) : Math.max(l, d); c = Pj(this); switch (c) { case Oj: break; case Fe: k = m; l = n; break; case Qj: c = Math.min(m / k, n / l); isFinite(c) || (c = 1); k *= c; l *= c; break; default: w.k(c + " is not a valid geometryStretch.") }null !== this.Rf ? (k = Math.max(k, .01), l = Math.max(l, .01), h = null !== this.Rf ? this.Rf : this.Ua, e = k, d = l, c = h.copy(), h = h.gb, e /= h.width, d /= h.height, isFinite(e) || (e = 1), isFinite(d) || (d = 1), 1 === e && 1 === d || c.scale(e, d), this.Ua = c) : null !== this.Ua && Va(this.Ua.Po, a - f) && Va(this.Ua.No, b - f) || (this.Ua = Y.makeGeometry(this, k, l)); h = this.Ua.gb; Infinity === a || Infinity === b ? Bo(this, h.x - f / 2, h.y - f / 2, 0 === a && 0 === k ? 0 : h.width + f, 0 === b && 0 === l ? 0 : h.height + f) : Bo(this, -(f / 2), -(f / 2), m + f, n + f) }; function Qp(a, b, c, d) { if (!1 !== Cm(a)) { a.rd.Qa(); var e = a.ji; 0 === e && d instanceof jh && d.type === hj && d.rb instanceof Y && (e = d.rb.lb); e *= a.ub; d instanceof W && null !== d.Ua ? (b = d.Ua.gb, Bo(a, b.x - e / 2, b.y - e / 2, b.width + e, b.height + e)) : Bo(a, -(e / 2), -(e / 2), b + e, c + e); a.rd.freeze(); a.rd.I() || w.k("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.rd.toString()); am(a, !1) } } function Pj(a) { var b = a.pA; return null !== a.Rf ? b === oo ? Fe : b : b === oo ? Sd[a.Cb].be : b } Y.prototype.jj = function (a, b, c, d) { Go(this, a, b, c, d) }; Y.prototype.getNearestIntersectionPoint = Y.prototype.XE = function (a, b, c) { return this.Bn(a.x, a.y, b.x, b.y, c) }; Y.prototype.Bn = function (a, b, c, d, e) { var f = this.transform, h = 1 / (f.m11 * f.m22 - f.m12 * f.m21), k = f.m22 * h, l = -f.m12 * h, m = -f.m21 * h, n = f.m11 * h, p = h * (f.m21 * f.dy - f.m22 * f.dx), q = h * (f.m12 * f.dx - f.m11 * f.dy), f = a * k + b * m + p, h = a * l + b * n + q, k = c * k + d * m + p, l = c * l + d * n + q, m = this.lb / 2, p = this.Ua; null === p && (xk(this, Infinity, Infinity), p = this.Ua); q = p.gb; n = !1; if (p.type === Ge) if (1.5 >= this.lb) n = le(p.zc, p.Ic, p.yb, p.Gb, f, h, k, l, e); else { var r = 0, s = 0; p.zc === p.yb ? (r = m, s = 0) : (b = (p.Gb - p.Ic) / (p.yb - p.zc), s = m / Math.sqrt(1 + b * b), r = s * b); d = w.cb(); b = new z; le(p.zc + r, p.Ic + s, p.yb + r, p.Gb + s, f, h, k, l, b) && d.push(b); b = new z; le(p.zc - r, p.Ic - s, p.yb - r, p.Gb - s, f, h, k, l, b) && d.push(b); b = new z; le(p.zc + r, p.Ic + s, p.zc - r, p.Ic - s, f, h, k, l, b) && d.push(b); b = new z; le(p.yb + r, p.Gb + s, p.yb - r, p.Gb - s, f, h, k, l, b) && d.push(b); b = d.length; if (0 === b) return w.ua(d), !1; n = !0; s = Infinity; for (r = 0; r < b; r++) { var k = d[r], u = (k.x - f) * (k.x - f) + (k.y - h) * (k.y - h); u < s && (s = u, e.x = k.x, e.y = k.y) } w.ua(d) } else if (p.type === He) b = q.x - m, n = me(b, q.y - m, q.x + q.width + m, q.y + q.height + m, f, h, k, l, e); else if (p.type === Pe) a: if (b = q.copy().zf(m, m), 0 === b.width) n = le(b.x, b.y, b.x, b.y + b.height, f, h, k, l, e); else if (0 === b.height) n = le(b.x, b.y, b.x + b.width, b.y, f, h, k, l, e); else { a = b.width / 2; var t = b.height / 2; d = b.x + a; b = b.y + t; c = 9999; f !== k && (c = (h - l) / (f - k)); if (9999 > Math.abs(c)) { n = h - b - c * (f - d); if (0 > a * a * c * c + t * t - n * n) { e.x = NaN; e.y = NaN; n = !1; break a } m = Math.sqrt(a * a * c * c + t * t - n * n); k = (-(a * a * c * n) + a * t * m) / (t * t + a * a * c * c) + d; a = (-(a * a * c * n) - a * t * m) / (t * t + a * a * c * c) + d; l = c * (k - d) + n + b; b = c * (a - d) + n + b; d = Math.abs((f - k) * (f - k)) + Math.abs((h - l) * (h - l)); h = Math.abs((f - a) * (f - a)) + Math.abs((h - b) * (h - b)); d < h ? (e.x = k, e.y = l) : (e.x = a, e.y = b) } else { k = t * t; l = f - d; k -= k / (a * a) * l * l; if (0 > k) { e.x = NaN; e.y = NaN; n = !1; break a } m = Math.sqrt(k); l = b + m; b -= m; d = Math.abs(l - h); h = Math.abs(b - h); d < h ? (e.x = f, e.y = l) : (e.x = f, e.y = b) } n = !0 } else if (p.type === De) { var x = 0, v = 0, A = u = 0, q = w.K(), r = k - f, s = l - h, s = r * r + s * s; e.x = k; e.y = l; for (r = 0; r < p.fc.count; r++)for (var y = p.fc.n[r], K = y.vb, x = y.ha, v = y.fa, E = x, Q = v, X = 0; X < K.count; X++) { var O = K.n[X], aa = O.type, u = O.C, A = O.D, da = !1; switch (aa) { case pf: E = u; Q = A; break; case Re: da = kq(x, v, u, A, f, h, k, l, q); break; case qf: var da = O.uc, aa = O.Qc, S = O.Dh, Ra = O.Eh, da = je(x, v, da, aa, S, Ra, u, A, f, h, k, l, .5, q); break; case rf: da = (x + 2 * O.uc) / 3; aa = (v + 2 * O.Qc) / 3; S = (2 * O.uc + u) / 3; Ra = (2 * O.uc + u) / 3; da = je(x, v, da, aa, S, Ra, u, A, f, h, k, l, .5, q); break; case sf: case tf: aa = O.type === sf ? uf(O, y) : vf(O, y, x, v); S = aa.length; if (0 === S) { da = kq(x, v, O.ka, O.ra, f, h, k, l, q); break } for (A = 0; A < S; A++)t = aa[A], 0 === A && kq(x, v, t[0], t[1], f, h, k, l, q) && (u = lq(f, h, q, s, e), u < s && (s = u, n = !0)), je(t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], f, h, k, l, .5, q) && (u = lq(f, h, q, s, e), u < s && (s = u, n = !0)); u = t[6]; A = t[7]; break; default: w.k("Unknown Segment type: " + aa) }x = u; v = A; da && (u = lq(f, h, q, s, e), u < s && (s = u, n = !0)); O.xx && (u = E, A = Q, kq(x, v, u, A, f, h, k, l, q) && (u = lq(f, h, q, s, e), u < s && (s = u, n = !0))) } f = c - a; h = d - b; b = Math.sqrt(f * f + h * h); 0 !== b && (f /= b, h /= b); e.x -= f * m; e.y -= h * m; w.v(q) } else w.k("Unknown Geometry type: " + p.type); if (!n) return !1; this.transform.nb(e); return !0 }; function lq(a, b, c, d, e) { a = c.x - a; b = c.y - b; b = a * a + b * b; return b < d ? (e.x = c.x, e.y = c.y, b) : d } function kq(a, b, c, d, e, f, h, k, l) { var m = !1, n = (e - h) * (b - d) - (f - k) * (a - c); if (0 === n) return !1; l.x = ((e * k - f * h) * (a - c) - (e - h) * (a * d - b * c)) / n; l.y = ((e * k - f * h) * (b - d) - (f - k) * (a * d - b * c)) / n; (a > c ? a - c : c - a) < (b > d ? b - d : d - b) ? (e = b < d ? b : d, a = b < d ? d : b, (l.y > e || Va(l.y, e)) && (l.y < a || Va(l.y, a)) && (m = !0)) : (e = a < c ? a : c, a = a < c ? c : a, (l.x > e || Va(l.x, e)) && (l.x < a || Va(l.x, a)) && (m = !0)); return m } Y.prototype.containedInRect = Y.prototype.rn = function (a, b) { if (void 0 === b) return a.wk(this.Y); var c = this.Ua; null === c && (xk(this, Infinity, Infinity), c = this.Ua); var c = c.gb, d = this.lb / 2, e = !1, f = w.K(); f.m(c.x - d, c.y - d); a.Ia(b.nb(f)) && (f.m(c.x - d, c.bottom + d), a.Ia(b.nb(f)) && (f.m(c.right + d, c.bottom + d), a.Ia(b.nb(f)) && (f.m(c.right + d, c.y - d), a.Ia(b.nb(f)) && (e = !0)))); w.v(f); return e }; Y.prototype.intersectsRect = Y.prototype.Wf = function (a, b) { if (this.rn(a, b) || void 0 === b && (b = this.transform, a.wk(this.Y))) return !0; var c = w.Jf(); c.set(b); c.vx(); var d = a.left, e = a.right, f = a.top, h = a.bottom, k = w.K(); k.m(d, f); c.nb(k); if (this.vk(k, !0)) return w.v(k), !0; k.m(e, f); c.nb(k); if (this.vk(k, !0)) return w.v(k), !0; k.m(d, h); c.nb(k); if (this.vk(k, !0)) return w.v(k), !0; k.m(e, h); c.nb(k); if (this.vk(k, !0)) return w.v(k), !0; var l = w.K(), m = w.K(); c.set(b); c.GF(this.transform); c.vx(); l.x = e; l.y = f; l.transform(c); k.x = d; k.y = f; k.transform(c); var n = !1; mq(this, k, l, m) ? n = !0 : (k.x = e, k.y = h, k.transform(c), mq(this, k, l, m) ? n = !0 : (l.x = d, l.y = h, l.transform(c), mq(this, k, l, m) ? n = !0 : (k.x = d, k.y = f, k.transform(c), mq(this, k, l, m) && (n = !0)))); w.v(k); w.we(c); w.v(l); w.v(m); return n }; function mq(a, b, c, d) { if (!a.XE(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 } Y.prototype.QE = function (a, b, c) { function d(a, b) { for (var c = a.length, d = 0; d < c; d += 2)if (b.Pp(a[d], a[d + 1]) > e) return !0; return !1 } if (c && null !== this.fill && this.vk(a, !0)) return !0; var e = a.wf(b); b = e; 1.5 < this.lb && (e = this.lb / 2 + Math.sqrt(e), e *= e); var f = this.Ua; if (null === f && (xk(this, Infinity, Infinity), f = this.Ua, null === f)) return !1; if (!c) { var h = f.gb, k = h.x, l = h.y, m = h.x + h.width, h = h.y + h.height; if (Na(a.x, a.y, k, l) <= e && Na(a.x, a.y, m, l) <= e && Na(a.x, a.y, k, h) <= e && Na(a.x, a.y, m, h) <= e) return !0 } k = f.zc; l = f.Ic; m = f.yb; h = f.Gb; if (f.type === Ge) { if (c = Ma(a.x, a.y, k, l, m, h), f = (k - m) * (a.x - m) + (l - h) * (a.y - h), c <= (0 <= (m - k) * (a.x - k) + (h - l) * (a.y - l) && 0 <= f ? e : b)) return !0 } else { if (f.type === He) return b = !1, c && (b = Ma(a.x, a.y, k, l, k, h) <= e || Ma(a.x, a.y, k, l, m, l) <= e || Ma(a.x, a.y, m, l, m, h) <= e || Ma(a.x, a.y, k, h, m, h) <= e), b; if (f.type === Pe) { 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 = Ma(a.x, a.y, k, l, m, h), c <= e ? !0 : !1; if (c) { if (a = Be(n, p, b, f), a * a <= e) return !0 } else return Na(b, f, -n, 0) >= e || Na(b, f, 0, -p) >= e || Na(b, f, 0, p) >= e || Na(b, f, n, 0) >= e ? !1 : !0 } else if (f.type === De) { h = f.gb; k = h.x; l = h.y; m = h.x + h.width; h = h.y + h.height; if (a.x > m && a.x < k && a.y > h && a.y < l && Ma(a.x, a.y, k, l, k, h) > e && Ma(a.x, a.y, k, l, m, l) > e && Ma(a.x, a.y, m, h, k, h) > e && Ma(a.x, a.y, m, h, m, l) > e) return !1; b = Math.sqrt(e); if (c) { if (null === this.fill ? xf(f, a.x, a.y, b) : f.Ia(a, b, !0)) return !0 } else { c = f.fc; for (b = 0; b < c.count; b++) { k = c.n[b]; n = k.ha; p = k.fa; if (a.Pp(n, p) > e) return !1; l = k.vb.n; m = l.length; for (h = 0; h < m; h++) { var q = l[h]; switch (q.type) { case pf: case Re: n = q.C; p = q.D; if (a.Pp(n, p) > e) return !1; break; case qf: f = w.cb(); Zd(n, p, q.uc, q.Qc, q.Dh, q.Eh, q.C, q.D, .8, f); n = d(f, a); w.ua(f); if (n) return !1; n = q.C; p = q.D; if (a.Pp(n, p) > e) return !1; break; case rf: f = w.cb(); ie(n, p, q.uc, q.Qc, q.C, q.D, .8, f); n = d(f, a); w.ua(f); if (n) return !1; n = q.C; p = q.D; if (a.Pp(n, p) > e) return !1; break; case sf: case tf: var r = q.type === sf ? uf(q, k) : vf(q, k, n, p), s = r.length; if (0 === s) { n = q.ka; p = q.ra; if (a.Pp(n, p) > e) return !1; break } q = null; f = w.cb(); for (b = 0; b < s; b++)if (q = r[b], f.length = 0, Zd(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7], .8, f), d(f, a)) return w.ua(f), !1; w.ua(f); null !== q && (n = q[6], p = q[7]); break; default: w.k("Unknown Segment type: " + q.type) } } } return !0 } } } return !1 }; w.defineProperty(Y, { jf: "geometry" }, function () { return null !== this.Ua ? this.Ua : this.Rf }, function (a) { var b = this.Ua; if (b !== a) { this.Rf = null !== a ? this.Ua = a.freeze() : this.Ua = null; var c = this.U; null !== c && (c.ck = NaN); this.H(); this.h("geometry", b, a); zo(this) && (a = this.U, null !== a && Ao(this, a, "geometryString")) } }); w.defineProperty(Y, { YH: "geometryString" }, function () { return null === this.jf ? "" : this.jf.toString() }, function (a) { a = Te(a); var b = a.normalize(); this.jf = a; this.position = a = w.xb(-b.x, -b.y); w.v(a) }); w.defineProperty(Y, { nF: "isGeometryPositioned" }, function () { return this.Jr }, function (a) { var b = this.Jr; b !== a && (this.Jr = a, this.H(), this.h("isGeometryPositioned", b, a)) }); Y.prototype.Le = function () { this.Ua = null }; w.defineProperty(Y, { fill: "fill" }, function () { return this.Cd }, function (a) { var b = this.Cd; b !== a && (a instanceof ha && a.freeze(), this.Cd = a, this.na(), this.h("fill", b, a)) }); w.defineProperty(Y, { stroke: "stroke" }, function () { return this.rc }, function (a) { var b = this.rc; b !== a && (a instanceof ha && a.freeze(), this.rc = a, this.na(), this.h("stroke", b, a)) }); w.defineProperty(Y, { lb: "strokeWidth" }, function () { return this.ji }, function (a) { var b = this.ji; if (b !== a) if (0 <= a) { this.ji = a; this.H(); var c = this.U; null !== c && (c.ck = NaN); this.h("strokeWidth", b, a) } else w.Fa(a, "value >= 0", Y, "strokeWidth:value") }); w.defineProperty(Y, { PL: "strokeCap" }, function () { return this.rp }, function (a) { var b = this.rp; b !== a && ("string" !== typeof a || "butt" !== a && "round" !== a && "square" !== a ? w.Fa(a, '"butt", "round", or "square"', Y, "strokeCap") : (this.rp = a, this.na(), this.h("strokeCap", b, a))) }); w.defineProperty(Y, { RL: "strokeJoin" }, function () { return this.tp }, function (a) { var b = this.tp; b !== a && ("string" !== typeof a || "miter" !== a && "bevel" !== a && "round" !== a ? w.Fa(a, '"miter", "bevel", or "round"', Y, "strokeJoin") : (this.tp = a, this.na(), this.h("strokeJoin", b, a))) }); w.defineProperty(Y, { SL: "strokeMiterLimit" }, function () { return this.dn }, function (a) { var b = this.dn; if (b !== a) if (1 <= a) { this.dn = a; this.na(); var c = this.U; null !== c && (c.ck = NaN); this.h("strokeMiterLimit", b, a) } else w.Fa(a, "value >= 1", Y, "strokeWidth:value") }); w.defineProperty(Y, { qG: "strokeDashArray" }, function () { return this.sp }, function (a) { var b = this.sp; if (b !== a) { null === a || Array.isArray(a) || w.Bd(a, "Array", Y, "strokeDashArray:value"); if (null !== a) { for (var c = a.length, d = 0, e = 0; e < c; e++) { var f = a[e]; "number" === typeof f && 0 <= f && isFinite(f) || w.k("strokeDashArray:value " + f + " at index " + e + " must be a positive number or zero."); d += f } if (0 === d) { if (null === b) return; a = null } } this.sp = a; this.na(); this.h("strokeDashArray", b, a) } }); w.defineProperty(Y, { QL: "strokeDashOffset" }, function () { return this.tf }, function (a) { var b = this.tf; b !== a && 0 <= a && (this.tf = a, this.na(), this.h("strokeDashOffset", b, a)) }); w.defineProperty(Y, { Cb: "figure" }, function () { return this.Fo }, function (a) { var b = this.Fo; if (b !== a) { var c = jq[a]; "function" === typeof c ? c = a : (c = jq[a.toLowerCase()]) || w.k("Unknown Shape.figure: " + a); b !== c && (a = this.U, null !== a && (a.ck = NaN), this.Fo = c, this.Rf = null, this.Le(), this.H(), this.h("figure", b, c)) } }); w.defineProperty(Y, { yq: "toArrow" }, function () { return this.yp }, function (a) { var b = this.yp; !0 === a ? a = "Standard" : !1 === a && (a = ""); if (b !== a) { var c = nq(a); null === c ? w.k("Unknown Shape.toArrow: " + a) : b !== c && (this.yp = c, this.Rf = null, this.Le(), this.H(), oq(this), this.h("toArrow", b, c)) } }); w.defineProperty(Y, { nA: "fromArrow" }, function () { return this.Ho }, function (a) { var b = this.Ho; !0 === a ? a = "Standard" : !1 === a && (a = ""); if (b !== a) { var c = nq(a); null === c ? w.k("Unknown Shape.fromArrow: " + a) : b !== c && (this.Ho = c, this.Rf = null, this.Le(), this.H(), oq(this), this.h("fromArrow", b, c)) } }); function oq(a) { var b = a.g; null !== b && b.oa.ab || (a.qq = pq, "None" !== a.yp ? (a.Ne = -1, a.qh = Jc) : "None" !== a.Ho && (a.Ne = 0, a.qh = new L(1 - Jc.x, Jc.y))) } w.defineProperty(Y, { A: "spot1" }, function () { return this.hi }, function (a) { w.G(a, L, Y, "spot1"); var b = this.hi; b.L(a) || (this.hi = a = a.S(), this.H(), this.h("spot1", b, a)) }); w.defineProperty(Y, { B: "spot2" }, function () { return this.ii }, function (a) { w.G(a, L, Y, "spot2"); var b = this.ii; b.L(a) || (this.ii = a = a.S(), this.H(), this.h("spot2", b, a)) }); w.defineProperty(Y, { Ec: "parameter1" }, function () { return this.ys }, function (a) { var b = this.ys; b !== a && (this.ys = a, this.Le(), this.H(), this.h("parameter1", b, a)) }); w.defineProperty(Y, { yu: "parameter2" }, function () { return this.zs }, function (a) { var b = this.zs; b !== a && (this.zs = a, this.Le(), this.H(), this.h("parameter2", b, a)) }); w.u(Y, { Ja: "naturalBounds" }, function () { if (null !== this.Ua) return this.Uc.assign(this.Ua.gb), this.Uc; var a = this.Ca; return new B(0, 0, a.width, a.height) }); w.defineProperty(Y, { Rx: "pathPattern" }, function () { return this.Bs }, function (a) { var b = this.Bs; b !== a && (this.Bs = a, this.na(), this.h("pathPattern", b, a)) }); w.defineProperty(Y, { FL: "pathObject" }, function () { return this.Rx }, function (a) { this.Rx = a }); w.defineProperty(Y, { pA: "geometryStretch" }, function () { return this.zr }, function (a) { var b = this.zr; b !== a && (w.mb(a, G, Y, "geometryStretch"), this.zr = a, this.h("geometryStretch", b, a)) }); w.defineProperty(Y, { interval: "interval" }, function () { return this.ug }, function (a) { var b = this.ug; a = Math.floor(a); if (b !== a && 0 <= a) { this.ug = a; var c = this.g; null !== c && this.O === c.Dn && bm(c); this.H(); c = this.O; null !== c && c.type === ip && (c.Tj = null); this.h("interval", b, a) } }); w.defineProperty(Y, { aF: "graduatedStart" }, function () { return this.tg }, function (a) { var b = this.tg; b !== a && (0 > a ? a = 0 : 1 < a && (a = 1), this.tg = a, this.H(), this.h("graduatedStart", b, a)) }); w.defineProperty(Y, { ZE: "graduatedEnd" }, function () { return this.sg }, function (a) { var b = this.sg; b !== a && (0 > a ? a = 0 : 1 < a && (a = 1), this.sg = a, this.H(), this.h("graduatedEnd", b, a)) }); Y.makeGeometry = function (a, b, c) { var d = null; if ("None" !== a.yq) d = Td[a.yq]; else if ("None" !== a.nA) d = Td[a.nA]; else { var e = jq[a.Cb]; "string" === typeof e && (e = jq[e]); void 0 === e && w.k("Unknown Shape.figure: " + a.Cb); d = e(a, b, c); d.Po = b; d.No = c } null === d && (e = jq.Rectangle, "function" === typeof e && (d = e(a, b, c))); return d }; Y.getFigureGenerators = function () { var a = new la("string", "function"), b; for (b in jq) if (b !== b.toLowerCase()) { var c = jq[b]; "function" === typeof c && a.add(b, c) } a.freeze(); return a }; Y.defineFigureGenerator = function (a, b) { w.j(a, "string", Y, "defineFigureGenerator:name"); "string" === typeof b ? "" !== b && jq[b] || w.k("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: " + b) : w.j(b, "function", Y, "defineFigureGenerator:func"); var c = a.toLowerCase(); "" !== a && "none" !== c && a !== c || w.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: " + a); jq[a] = b; jq[c] = a }; Y.getArrowheadGeometries = function () { var a = new la("string", Ce), b; for (b in qq) if (void 0 === Td[b]) { var c = Te(qq[b], !1); Td[b] = c; c = b.toLowerCase(); c !== b && (Td[c] = b) } for (b in Td) b !== b.toLowerCase() && (c = Td[b], c instanceof Ce && a.add(b, c)); a.freeze(); return a }; Y.defineArrowheadGeometry = function (a, b) { w.j(a, "string", Y, "defineArrowheadGeometry:name"); var c = null; "string" === typeof b ? (w.j(b, "string", Y, "defineArrowheadGeometry:pathstr"), c = Te(b, !1)) : (w.G(b, Ce, Y, "defineArrowheadGeometry:pathstr"), c = b); var d = a.toLowerCase(); "" !== a && "none" !== d && a !== d || w.k("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: " + a); Td[a] = c; Td[d] = a }; function Hh() { G.call(this); this.Hd = ""; this.rc = "black"; this.qg = "13px sans-serif"; this.xl = "start"; this.pg = Oj; this.Bl = xc; this.Em = !0; this.Yj = this.Zj = !1; this.Yi = rq; this.rk = sq; this.Zv = this.le = 0; this.qz = this.rz = null; this.sf = new Wp; this.sr = !1; this.Ue = this.Sq = this.kt = this.yl = this.lt = null; this.gi = this.fi = 0; this.hh = Infinity; this.Wo = 0; this.ug = 1; this.tg = 0; this.sg = 1; this.zm = null } w.Ka(Hh, G); w.ga("TextBlock", Hh); var tq = /[ \u200b\u00ad]/; Hh.prototype.cloneProtected = function (a) { G.prototype.cloneProtected.call(this, a); a.Hd = this.Hd; a.rc = this.rc; a.qg = this.qg; a.xl = this.xl; a.pg = this.pg; a.Bl = this.Bl; a.Em = this.Em; a.Zj = this.Zj; a.Yj = this.Yj; a.Yi = this.Yi; a.rk = this.rk; a.le = this.le; a.Zv = this.Zv; a.rz = this.rz; a.qz = this.qz; a.sf.Jp(this.sf); a.sr = this.sr; a.lt = this.lt; a.yl = this.yl; a.kt = this.kt; a.Sq = this.Sq; a.Ue = this.Ue; a.fi = this.fi; a.gi = this.gi; a.hh = this.hh; a.Wo = this.Wo; a.ug = this.ug; a.tg = this.tg; a.sg = this.sg; a.zm = this.zm }; Hh.prototype.ic = function (a) { a.Ee === Hh ? this.EG = a : G.prototype.ic.call(this, a) }; Hh.prototype.toString = function () { return 22 < this.Hd.length ? 'TextBlock("' + this.Hd.substring(0, 20) + '"...)' : 'TextBlock("' + this.Hd + '")' }; var uq = new sa, vq = 0, wq = new sa, xq = 0, yq = "...", zq = "", Aq = (new Wc(null)).xk; Hh.getEllipsis = function () { return yq }; Hh.setEllipsis = function (a) { yq = a; wq = new sa; xq = 0 }; var Bq; Hh.None = Bq = w.p(Hh, "None", 0); var Cq; Hh.WrapFit = Cq = w.p(Hh, "WrapFit", 1); var sq; Hh.WrapDesiredSize = sq = w.p(Hh, "WrapDesiredSize", 2); var rq; Hh.OverflowClip = rq = w.p(Hh, "OverflowClip", 0); var Dq; Hh.OverflowEllipsis = Dq = w.p(Hh, "OverflowEllipsis", 1); Hh.prototype.H = function () { G.prototype.H.call(this); this.qz = this.rz = null }; w.defineProperty(Hh, { font: "font" }, function () { return this.qg }, function (a) { var b = this.qg; b !== a && (this.qg = a, this.sf.Oj = null, this.H(), this.h("font", b, a)) }); Hh.isValidFont = function (a) { var b = Aq.font; if (a === b || "10px sans-serif" === a) return !0; Aq.font = "10px sans-serif"; var c; Aq.font = a; var d = Aq.font; if ("10px sans-serif" !== d) return Aq.font = b, !0; Aq.font = "19px serif"; c = Aq.font; Aq.font = a; d = Aq.font; Aq.font = b; return d !== c }; w.defineProperty(Hh, { text: "text" }, function () { return this.Hd }, function (a) { var b = this.Hd; a = null !== a && void 0 !== a ? a.toString() : ""; b !== a && (this.Hd = a, this.H(), this.h("text", b, a)) }); w.defineProperty(Hh, { textAlign: "textAlign" }, function () { return this.xl }, function (a) { var b = this.xl; b !== a && ("start" === a || "end" === a || "left" === a || "right" === a || "center" === a ? (this.xl = a, this.na(), this.h("textAlign", b, a)) : w.Fa(a, '"start", "end", "left", "right", or "center"', Hh, "textAlign")) }); w.defineProperty(Hh, { St: "flip" }, function () { return this.pg }, function (a) { var b = this.pg; b !== a && (w.mb(a, G, Hh, "flip"), this.pg = a, this.na(), this.h("flip", b, a)) }); w.defineProperty(Hh, { YL: "verticalAlignment" }, function () { return this.Bl }, function (a) { var b = this.Bl; b.L(a) || (a.Rd() && w.k("TextBlock.verticalAlignment for " + this + " must be a real Spot, not:" + a), this.Bl = a = a.S(), Ro(this), this.h("verticalAlignment", b, a)) }); w.u(Hh, { Ja: "naturalBounds" }, function () { if (!this.Uc.I()) { var a = Eq(this, this.Hd, this.sf, 999999).width, b = Fq(this, a, this.sf), c = this.Ca; isNaN(c.width) || (a = c.width); isNaN(c.height) || (b = c.height); Pa(this.Uc, a, b) } return this.Uc }); w.defineProperty(Hh, { Cx: "isMultiline" }, function () { return this.Em }, function (a) { var b = this.Em; b !== a && (this.Em = a, this.H(), this.h("isMultiline", b, a)) }); w.defineProperty(Hh, { eL: "isUnderline" }, function () { return this.Zj }, function (a) { var b = this.Zj; b !== a && (this.Zj = a, this.na(), this.h("isUnderline", b, a)) }); w.defineProperty(Hh, { dL: "isStrikethrough" }, function () { return this.Yj }, function (a) { var b = this.Yj; b !== a && (this.Yj = a, this.na(), this.h("isStrikethrough", b, a)) }); w.defineProperty(Hh, { EG: "wrap" }, function () { return this.rk }, function (a) { var b = this.rk; b !== a && (this.rk = a, this.H(), this.h("wrap", b, a)) }); w.defineProperty(Hh, { overflow: "overflow" }, function () { return this.Yi }, function (a) { var b = this.Yi; b !== a && (this.Yi = a, this.H(), this.h("overflow", b, a)) }); w.defineProperty(Hh, { stroke: "stroke" }, function () { return this.rc }, function (a) { var b = this.rc; b !== a && (a instanceof ha && a.freeze(), this.rc = a, this.na(), this.h("stroke", b, a)) }); w.u(Hh, { JI: "lineCount" }, function () { return this.le }); w.defineProperty(Hh, { jA: "editable" }, function () { return this.sr }, function (a) { var b = this.sr; b !== a && (this.sr = a, this.h("editable", b, a)) }); w.defineProperty(Hh, { sG: "textEditor" }, function () { return this.lt }, function (a) { var b = this.lt; b !== a && (this.lt = a, this.h("textEditor", b, a)) }); w.defineProperty(Hh, { lA: "errorFunction" }, function () { return this.Ue }, function (a) { var b = this.Ue; b !== a && (null !== a && w.j(a, "function", Hh, "errorFunction"), this.Ue = a, this.h("errorFunction", b, a)) }); w.defineProperty(Hh, { interval: "interval" }, function () { return this.ug }, function (a) { var b = this.ug; a = Math.floor(a); if (b !== a && 0 <= a) { this.ug = a; this.H(); var c = this.O; null !== c && c.type === ip && (c.Tj = null); this.h("interval", b, a) } }); w.defineProperty(Hh, { aF: "graduatedStart" }, function () { return this.tg }, function (a) { var b = this.tg; b !== a && (0 > a ? a = 0 : 1 < a && (a = 1), this.tg = a, this.H(), this.h("graduatedStart", b, a)) }); w.defineProperty(Hh, { ZE: "graduatedEnd" }, function () { return this.sg }, function (a) { var b = this.sg; b !== a && (0 > a ? a = 0 : 1 < a && (a = 1), this.sg = a, this.H(), this.h("graduatedEnd", b, a)) }); w.defineProperty(Hh, { $E: "graduatedFunction" }, function () { return this.zm }, function (a) { var b = this.zm; b !== a && (null !== a && w.j(a, "function", Hh, "graduatedFunction"), this.zm = a, this.H(), this.h("graduatedFunction", b, a)) }); Hh.prototype.yk = function (a, b) { if (null !== this.rc && 0 !== this.Hd.length && null !== this.qg) { var c = this.Ja.width, d = this.Ja.height, e = Gq(this), f = a.textAlign = this.xl, h = b.Mr; "start" === f && (f = h ? "right" : "left"); "end" === f && (f = h ? "left" : "right"); No(this, a, this.rc, !0, !1); (this.Zj || this.Yj) && No(this, a, this.rc, !1, !1); var k = 0, h = !1, l = w.xb(0, 0); this.rh.nb(l); var m = w.xb(0, e); this.rh.nb(m); var n = l.wf(m); w.v(l); w.v(m); l = b.scale; 8 > n * l * l && (h = !0); b.qf !== a && (h = !1); !1 === b.qj("textGreeking") && (h = !1); n = this.fi; l = this.gi; switch (this.St) { case so: a.translate(c, 0); a.scale(-1, 1); break; case ro: a.translate(0, d); a.scale(1, -1); break; case to: a.translate(c, d), a.scale(-1, -1) }var m = this.le, p = (n + e + l) * m; d > p && (k = this.Bl, k = k.y * d - k.y * p + k.offsetY); for (var p = this.sf, q = 0; q < m; q++) { var r = p.pf[q], s = p.Re[q]; r > c && (r = c); var k = k + n, u = s, s = a, t = k, x = c, v = e, A = f, y = 0; h ? ("left" === A ? y = 0 : "right" === A ? y = x - r : "center" === A && (y = (x - r) / 2), s.fillRect(0 + y, t + .25 * v, r, 1)) : ("left" === A ? y = 0 : "right" === A ? y = x : "center" === A && (y = x / 2), s.fillText(u, 0 + y, t + v - .25 * v), u = v / 20 | 0, 0 === u && (u = 1), "right" === A ? y -= r : "center" === A && (y -= r / 2), this.Zj && (s.beginPath(), s.lineWidth = u, s.moveTo(0 + y, t + v - .2 * v), s.lineTo(0 + y + r, t + v - .2 * v), s.stroke()), this.Yj && (s.beginPath(), s.lineWidth = u, t = t + v - v / 2.2 | 0, 0 !== u % 2 && (t += .5), s.moveTo(0 + y, t), s.lineTo(0 + y + r, t), s.stroke())); k += e + l } switch (this.St) { case so: a.scale(-1, 1); a.translate(-c, 0); break; case ro: a.scale(1, -1); a.translate(0, -d); break; case to: a.scale(-1, -1), a.translate(-c, -d) } } }; Hh.prototype.Nn = function (a, b, c, d) { this.Wo = a; var e = this.sf; e.reset(); var f = 0, h = 0; if (isNaN(this.Ca.width)) { f = this.Hd.replace(/\r\n/g, "\n").replace(/\r/g, "\n"); if (0 === f.length) f = 0; else if (this.Cx) { for (var k = h = 0, l = !1; !l;) { var m = f.indexOf("\n", k); -1 === m && (m = f.length, l = !0); k = Hq(f.substr(k, m - k).replace(/^\s+|\s+$/g, ""), this.qg); k > h && (h = k); k = m + 1 } f = h } else h = f.indexOf("\n", 0), 0 <= h && (f = f.substr(0, h)), f = k = Hq(f, this.qg); f = Math.min(f, a / this.scale); f = Math.max(8, f) } else f = this.Ca.width; null !== this.O && (f = Math.min(f, this.O.Ff.width), f = Math.max(f, this.O.Bh.width)); h = Fq(this, f, e); m = h = isNaN(this.Ca.height) ? Math.min(h, b / this.scale) : this.Ca.height; if (0 !== e.Ve && 1 !== e.Re.length && this.Yi === Dq && (b = this.qg, l = this.Yi === Dq ? Iq(b) : 0, k = this.fi + this.gi, k = Math.max(0, Gq(this) + k), m = Math.min(this.SI - 1, Math.max(Math.floor(m / k + .01) - 1, 0)), !(m + 1 >= e.Re.length))) { k = e.Re[m]; for (a = Math.max(1, a - l); Hq(k, b) > a && 1 < k.length;)k = k.substr(0, k.length - 1); k += yq; a = Hq(k, b); e.Re[m] = k; e.Re = e.Re.slice(0, m + 1); e.pf[m] = a; e.pf = e.pf.slice(0, m + 1); e.hj = e.Re.length; e.Ve = Math.max(e.Ve, a); this.le = e.hj } if (this.EG === Cq || isNaN(this.Ca.width)) f = e.Ve, isNaN(this.Ca.width) && (f = Math.max(8, f)); f = Math.max(c, f); h = Math.max(d, h); Pa(this.Uc, f, h); Bo(this, 0, 0, f, h) }; Hh.prototype.jj = function (a, b, c, d) { Go(this, a, b, c, d) }; function Eq(a, b, c, d) { b = b.replace(/^\s+|\s+$/g, ""); var e = 0, f = 0, h = 0, k = a.qg, f = a.fi + a.gi, l = Math.max(0, Gq(a) + f), h = a.Yi === Dq ? Iq(k) : 0; if (a.le >= a.hh) return new ia(0, l); if (a.rk === Bq) { c.hj = 1; f = Hq(b, k); if (0 === h || f <= d) return c.Ve = Math.max(c.Ve, f), c.pf.push(c.Ve), c.Re.push(b), new ia(f, l); var m = Jq(b); b = b.substr(m.length); for (var n = Jq(b), f = Hq(m + n, k); 0 < n.length && f <= d;)m += n, b = b.substr(n.length), n = Jq(b), f = Hq((m + n).replace(/^\s+|\s+$/g, ""), k); m += n.replace(/^\s+|\s+$/g, ""); for (d = Math.max(1, d - h); Hq(m, k) > d && 1 < m.length;)m = m.substr(0, m.length - 1); m += yq; h = Hq(m, k); c.pf.push(h); c.Ve = h; c.Re.push(m); return new ia(h, l) } var p = 0; 0 === b.length && (p = 1, c.pf.push(0), c.Re.push(b)); for (; 0 < b.length;) { m = Jq(b); for (b = b.substr(m.length); Hq(m, k) > d;) { n = 1; f = Hq(m.substr(0, n), k); for (h = 0; f <= d;)n++ , h = f, f = Hq(m.substr(0, n), k); 1 === n ? (c.pf[a.le + p] = f, e = Math.max(e, f)) : (c.pf[a.le + p] = h, e = Math.max(e, h)); n--; 1 > n && (n = 1); c.Re[a.le + p] = m.substr(0, n); p++; m = m.substr(n); if (a.le + p > a.hh) break } n = Jq(b); for (f = Hq(m + n, k); 0 < n.length && f <= d;)m += n, b = b.substr(n.length), n = Jq(b), f = Hq((m + n).replace(/^\s+|\s+$/g, ""), k); m = m.replace(/^\s+|\s+$/g, ""); if ("" !== m && ("\u00ad" === m[m.length - 1] && (m = m.substring(0, m.length - 1) + "\u2010"), 0 === n.length ? (c.pf.push(f), e = Math.max(e, f)) : (h = Hq(m, k), c.pf.push(h), e = Math.max(e, h)), c.Re.push(m), p++ , a.le + p > a.hh)) break } c.hj = Math.min(a.hh, p); c.Ve = Math.max(c.Ve, e); return new ia(c.Ve, l * c.hj) } function Jq(a) { for (var b = a.length, c = 0; c < b && !tq.test(a.charAt(c));)c++; for (; c < b && tq.test(a.charAt(c));)c++; return c >= b ? a : a.substr(0, c) } function Hq(a, b) { zq !== b && (zq = Aq.font = b); return Aq.measureText(a).width } function Gq(a) { if (null !== a.sf.Oj) return a.sf.Oj; var b = a.qg; zq !== b && (zq = Aq.font = b); var c = 0; void 0 !== uq[b] && 5E3 > vq ? c = uq[b] : (c = 1.3 * Aq.measureText("M").width, uq[b] = c, vq++); return a.sf.Oj = c } function Iq(a) { zq !== a && (zq = Aq.font = a); var b = 0; void 0 !== wq[a] && 5E3 > xq ? b = wq[a] : (b = Aq.measureText(yq).width, wq[a] = b, xq++); return b } function Fq(a, b, c) { var d = a.Hd.replace(/\r\n/g, "\n").replace(/\r/g, "\n"), e = a.fi + a.gi, e = Math.max(0, Gq(a) + e); if (0 === d.length) return c.Ve = 0, a.le = 1, e; if (!a.Cx) { var f = d.indexOf("\n", 0); 0 <= f && (d = d.substr(0, f)) } for (var f = 0, h = a.le = 0, k = -1, l = !1; !l;)k = d.indexOf("\n", h), -1 === k && (k = d.length, l = !0), h <= k && (h = d.substr(h, k - h), a.rk !== Bq ? (c.hj = 0, h = Eq(a, h, c, b), f += h.height, a.le += c.hj) : (Eq(a, h, c, b), f += e, a.le++), a.le === a.hh && (l = !0)), h = k + 1; return a.Zv = f } w.defineProperty(Hh, { tB: "textValidation" }, function () { return this.yl }, function (a) { var b = this.yl; b !== a && (null !== a && w.j(a, "function", Hh, "textValidation"), this.yl = a, this.h("textValidation", b, a)) }); w.defineProperty(Hh, { rG: "textEdited" }, function () { return this.kt }, function (a) { var b = this.kt; b !== a && (null !== a && w.j(a, "function", Hh, "textEdited"), this.kt = a, this.h("textEdited", b, a)) }); w.defineProperty(Hh, { ML: "spacingAbove" }, function () { return this.fi }, function (a) { var b = this.fi; b !== a && (this.fi = a, this.h("spacingAbove", b, a)) }); w.defineProperty(Hh, { NL: "spacingBelow" }, function () { return this.gi }, function (a) { var b = this.gi; b !== a && (this.gi = a, this.h("spacingBelow", b, a)) }); w.defineProperty(Hh, { SI: "maxLines" }, function () { return this.hh }, function (a) { var b = this.hh; b !== a && (a = Math.floor(a), 0 >= a && w.Fa(a, "> 0", Hh, "maxLines"), this.hh = a, this.h("maxLines", b, a), this.H()) }); w.u(Hh, { qL: "metrics" }, function () { return this.sf }); w.defineProperty(Hh, { CK: "choices" }, function () { return this.Sq }, function (a) { var b = this.Sq; b !== a && (null === a || Array.isArray(a) || w.Bd(a, "Array", Hh, "choices:value"), this.Sq = a, this.h("choices", b, a)) }); function Wp() { this.Ve = this.hj = 0; this.pf = []; this.Re = []; this.Oj = null } Wp.prototype.reset = function () { this.Ve = this.hj = 0; this.Oj = null; this.pf = []; this.Re = [] }; Wp.prototype.Jp = function (a) { this.hj = a.hj; this.Oj = a.Oj; this.Ve = a.Ve; this.pf = w.Jl(a.pf); this.Re = w.Jl(a.Re) }; w.u(Wp, { yK: "arrSize" }, function () { return this.pf }); w.u(Wp, { zK: "arrText" }, function () { return this.Re }); w.u(Wp, { pL: "maxLineWidth" }, function () { return this.Ve }); w.u(Wp, { XK: "fontHeight" }, function () { return this.Oj }); function xl() { G.call(this); this.Te = null; this.dt = ""; this.jk = Pd; this.Ko = Fe; this.ki = this.Ue = null; this.Jo = Hb; this.pg = Oj; this.vp = null; this.lz = !1; this.Av = !0; this.Xv = !1; this.mp = null } w.Ka(xl, G); w.ga("Picture", xl); xl.prototype.cloneProtected = function (a) { G.prototype.cloneProtected.call(this, a); a.element = this.Te; a.dt = this.dt; a.jk = this.jk.S(); a.Ko = this.Ko; a.pg = this.pg; a.Ue = this.Ue; a.ki = this.ki; a.Jo = this.Jo.S(); a.Av = this.Av; a.mp = this.mp }; xl.prototype.ic = function (a) { a === Oj || a === Qj || a === Rj ? this.nI = a : G.prototype.ic.call(this, a) }; xl.prototype.toString = function () { return "Picture(" + this.source + ")#" + w.Nd(this) }; var Kq = new sa, Lq = 0, rl = []; function Mq() { var a = rl; if (0 === a.length) for (var b = window.document.getElementsByTagName("canvas"), c = b.length, d = 0; d < c; d++) { var e = b[d]; e.parentElement && e.parentElement.$ && a.push(e.parentElement.$) } return a } var Nq; xl.clearCache = Nq = function (a) { void 0 === a && (a = ""); w.j(a, "string", xl, "clearCache:url"); "" !== a ? Kq[a] && (delete Kq[a], Lq--) : (Kq = new sa, Lq = 0) }; w.defineProperty(xl, { element: "element" }, function () { return this.Te }, function (a) { var b = this.Te; if (b !== a) { null === a || a instanceof HTMLImageElement || a instanceof HTMLVideoElement || a instanceof HTMLCanvasElement || w.k("Picture.element must be an instance of Image, Canvas, or Video, not: " + a); this.lz = a instanceof HTMLCanvasElement; this.Te = a; if (null !== a) if (a instanceof HTMLCanvasElement || !0 === a.complete) a.Io instanceof Event && null !== this.Ue && this.Ue(this, a.Io), !0 === a.Nv && null !== this.ki && this.ki(this, a.Bz), a.Nv = !0, this.Ca.I() || (am(this, !1), this.H()); else { var c = this; a.IC || (a.addEventListener("load", function (b) { Oq(a, b); c.Ca.I() || (am(c, !1), c.H()) }), a.addEventListener("error", function (b) { Pq(a, b) }), a.IC = !0) } this.h("element", b, a); this.na() } }); w.defineProperty(xl, { source: "source" }, function () { return this.dt }, function (a) { var b = this.dt; if (b !== a) { w.j(a, "string", xl, "source"); this.dt = a; var c = Kq, d = this.g; if (void 0 !== c[a]) var e = c[a].Ep[0].source; else { 30 < Lq && (Nq(), c = Kq); var e = w.createElement("img"), f = this; e.addEventListener("load", function (a) { Oq(e, a); f.Ca.I() || (am(f, !1), f.H()) }); e.addEventListener("error", function (a) { Pq(e, a) }); e.IC = !0; var h = this.mp; null !== h && (e.crossOrigin = h(this)); e.src = a; c[a] = new Qq(e); Lq++ } null !== d && nn(d, this); this.element = e; null !== d && mn(d, this); this.H(); this.na(); this.h("source", b, a) } }); function Oq(a, b) { a.Nv = !0; a.Io = !1; for (var c = null, d = Mq(), e = d.length, f = 0; f < e; f++) { var h = d[f], k = h.gp.ja(a.src); if (null !== k) for (var l = k.length, m = 0; m < l; m++)c = k[m], h.yz.add(c), h.Me(), null === a.Bz && (a.Bz = b, null !== c.ki && c.ki(c, b)) } } function Pq(a, b) { a.Io = b; for (var c = null, d = Mq(), e = d.length, f = 0; f < e; f++)if (c = d[f].gp.ja(a.src), null !== c) { for (var h = c.length, k = w.cb(), l = 0; l < h; l++)k.push(c[l]); for (l = 0; l < h; l++)c = k[l], null !== c.Ue && c.Ue(c, b); w.ua(k) } } w.defineProperty(xl, { LL: "sourceCrossOrigin" }, function () { return this.mp }, function (a) { if (this.mp !== a && (null !== a && w.j(a, "function", xl, "sourceCrossOrigin"), this.mp = a, null !== this.element)) { var b = this.element.src; null === a && "string" === typeof b ? this.element.crossOrigin = null : null !== a && (this.element.crossOrigin = a(this)); this.element.src = b } }); w.defineProperty(xl, { Cj: "sourceRect" }, function () { return this.jk }, function (a) { var b = this.jk; b.L(a) || (w.G(a, B, xl, "sourceRect"), this.jk = a = a.S(), this.na(), this.h("sourceRect", b, a)) }); w.defineProperty(xl, { nI: "imageStretch" }, function () { return this.Ko }, function (a) { var b = this.Ko; b !== a && (w.mb(a, G, xl, "imageStretch"), this.Ko = a, this.na(), this.h("imageStretch", b, a)) }); w.defineProperty(xl, { St: "flip" }, function () { return this.pg }, function (a) { var b = this.pg; b !== a && (w.mb(a, G, xl, "flip"), this.pg = a, this.na(), this.h("flip", b, a)) }); w.defineProperty(xl, { ZK: "imageAlignment" }, function () { return this.Jo }, function (a) { w.G(a, L, xl, "imageAlignment"); var b = this.Jo; b.L(a) || (this.Jo = a = a.S(), this.H(), this.h("imageAlignment", b, a)) }); w.defineProperty(xl, { lA: "errorFunction" }, function () { return this.Ue }, function (a) { var b = this.Ue; b !== a && (null !== a && w.j(a, "function", xl, "errorFunction"), this.Ue = a, this.h("errorFunction", b, a)) }); w.defineProperty(xl, { VL: "successFunction" }, function () { return this.ki }, function (a) { var b = this.ki; b !== a && (null !== a && w.j(a, "function", xl, "successFunction"), this.ki = a, this.h("successFunction", b, a)) }); xl.prototype.yk = function (a, b) { var c = this.Te; if (null !== c) { var d = c.src; null !== d && "" !== d || w.k('Element has no source ("src") attribute: ' + c); if (!(c.Io instanceof Event) && !0 === c.Nv) { var d = this.Ja, e = 0, f = 0, h = this.lz, k = h ? +c.width : c.naturalWidth, h = h ? +c.height : c.naturalHeight; void 0 === k && c.videoWidth && (k = c.videoWidth); void 0 === h && c.videoHeight && (h = c.videoHeight); k = k || d.width; h = h || d.height; if (0 !== k && 0 !== h) { var l = k, m = h; this.Cj.I() && (e = this.jk.x, f = this.jk.y, k = this.jk.width, h = this.jk.height); var n = k, p = h, q = this.Ko, r = this.Jo; switch (q) { case Oj: if (this.Cj.I()) break; n >= d.width && (e = e + r.offsetX + (n * r.x - d.width * r.x)); p >= d.height && (f = f + r.offsetY + (p * r.y - d.height * r.y)); k = Math.min(d.width, n); h = Math.min(d.height, p); break; case Fe: n = d.width; p = d.height; break; case Qj: case Rj: var s = 0; q === Qj ? (s = Math.min(d.height / p, d.width / n), n *= s, p *= s) : q === Rj && (s = Math.max(d.height / p, d.width / n), n *= s, p *= s, n >= d.width && (e = (e + r.offsetX + (n * r.x - d.width * r.x) / n) * k), p >= d.height && (f = (f + r.offsetY + (p * r.y - d.height * r.y) / p) * h), k *= 1 / (n / d.width), h *= 1 / (p / d.height), n = d.width, p = d.height) }var q = this.pj() * b.scale, u = k * h / (n * q * p * q), s = Kq[this.source], q = null; if (void 0 !== s && 16 < u) { 2 > s.Ep.length && (Rq(s, 4, l, m), Rq(s, 16, l, m)); for (var l = s.Ep, m = l.length, q = l[0], t = 0; t < m; t++)if (l[t].jq * l[t].jq < u) q = l[t]; else break } if (!b.pr) { if (null === this.vp) if (null === this.Te) this.vp = !1; else { l = (new Wc(null)).xk; l.drawImage(this.Te, 0, 0); try { l.getImageData(0, 0, 1, 1).data[3] && (this.vp = !1), this.vp = !1 } catch (x) { this.vp = !0 } } if (this.vp) return } l = 0; n < d.width && (l = r.offsetX + (d.width * r.x - n * r.x)); m = 0; p < d.height && (m = r.offsetY + (d.height * r.y - p * r.y)); switch (this.St) { case so: a.translate(Math.min(d.width, n), 0); a.scale(-1, 1); break; case ro: a.translate(0, Math.min(d.height, p)); a.scale(1, -1); break; case to: a.translate(Math.min(d.width, n), Math.min(d.height, p)), a.scale(-1, -1) }if (b.qj("pictureRatioOptimization") && !b.mz && void 0 !== s && null !== q && 1 !== q.jq) { a.save(); s = q.jq; try { a.drawImage(q.source, e / s, f / s, Math.min(q.source.width, k / s), Math.min(q.source.height, h / s), l, m, Math.min(d.width, n), Math.min(d.height, p)) } catch (v) { this.Av = !1 } a.restore() } else try { a.drawImage(c, e, f, k, h, l, m, Math.min(d.width, n), Math.min(d.height, p)) } catch (A) { this.Av = !1 } switch (this.St) { case so: a.scale(-1, 1); a.translate(-Math.min(d.width, n), 0); break; case ro: a.scale(1, -1); a.translate(0, -Math.min(d.height, p)); break; case to: a.scale(-1, -1), a.translate(-Math.min(d.width, n), -Math.min(d.height, p)) } } } } }; w.u(xl, { Ja: "naturalBounds" }, function () { return this.Uc }); xl.prototype.Nn = function (a, b, c, d) { var e = this.Ca, f = Eo(this, !0), h = this.Te, k = this.lz; if (k || !this.Xv && h && h.complete) this.Xv = !0; null === h && (isFinite(a) || (a = 0), isFinite(b) || (b = 0)); isFinite(e.width) || f === Fe || f === qo ? (isFinite(a) || (a = this.Cj.I() ? this.Cj.width : k ? +h.width : h.naturalWidth), c = 0) : null !== h && !1 !== this.Xv && (a = this.Cj.I() ? this.Cj.width : k ? +h.width : h.naturalWidth); isFinite(e.height) || f === Fe || f === po ? (isFinite(b) || (b = this.Cj.I() ? this.Cj.height : k ? +h.height : h.naturalHeight), d = 0) : null !== h && !1 !== this.Xv && (b = this.Cj.I() ? this.Cj.height : k ? +h.height : h.naturalHeight); isFinite(e.width) && (a = e.width); isFinite(e.height) && (b = e.height); e = this.Ff; f = this.Bh; c = Math.max(c, f.width); d = Math.max(d, f.height); a = Math.min(e.width, a); b = Math.min(e.height, b); a = Math.max(c, a); b = Math.max(d, b); null === h || h.complete || (isFinite(a) || (a = 0), isFinite(b) || (b = 0)); Pa(this.Uc, a, b); Bo(this, 0, 0, a, b) }; xl.prototype.jj = function (a, b, c, d) { Go(this, a, b, c, d) }; function Qq(a) { this.Ep = [new Sq(a, 1)] } function Rq(a, b, c, d) { var e = new Wc(null), f = e.xk, h = 1 / b; e.width = c / b; e.height = d / b; b = new Sq(e.Jd, b); c = a.Ep[a.Ep.length - 1]; f.setTransform(h * c.jq, 0, 0, h * c.jq, 0, 0); f.drawImage(c.source, 0, 0); a.Ep.push(b) } function Sq(a, b) { this.source = a; this.jq = b } function ka() { this.o = new Ce; this.Xb = null } g = ka.prototype; g.reset = function () { this.o = new Ce; this.Xb = null }; function M(a, b, c, d, e, f) { null === a.o && w.k("StreamGeometryContext has been closed"); void 0 !== e && !0 === e ? (null === a.Xb && w.k("Need to call beginFigure first"), d = new zf(pf), d.C = b, d.D = c, a.Xb.vb.add(d)) : (a.Xb = new Ee, a.Xb.ha = b, a.Xb.fa = c, a.Xb.fu = d, a.o.fc.add(a.Xb)); void 0 !== f && (a.Xb.Qo = f) } function P(a) { null === a.o && w.k("StreamGeometryContext has been closed"); null === a.Xb && w.k("Need to call beginFigure first"); var b = a.Xb.vb.length; 0 < b && a.Xb.vb.ea(b - 1).close() } function We(a) { null === a.o && w.k("StreamGeometryContext has been closed"); null === a.Xb && w.k("Need to call beginFigure first"); 0 < a.Xb.vb.length && (a.Xb.fu = !0) } g.bb = function (a) { null === this.o && w.k("StreamGeometryContext has been closed"); null === this.Xb && w.k("Need to call beginFigure first"); this.Xb.am = a }; g.moveTo = function (a, b, c) { void 0 === c && (c = !1); null === this.o && w.k("StreamGeometryContext has been closed"); null === this.Xb && w.k("Need to call beginFigure first"); var d = new zf(pf); d.C = a; d.D = b; c && d.close(); this.Xb.vb.add(d) }; g.lineTo = function (a, b, c) { void 0 === c && (c = !1); null === this.o && w.k("StreamGeometryContext has been closed"); null === this.Xb && w.k("Need to call beginFigure first"); var d = new zf(Re); d.C = a; d.D = b; c && d.close(); this.Xb.vb.add(d) }; function N(a, b, c, d, e, f, h, k) { void 0 === k && (k = !1); null === a.o && w.k("StreamGeometryContext has been closed"); null === a.Xb && w.k("Need to call beginFigure first"); var l = new zf(qf); l.uc = b; l.Qc = c; l.Dh = d; l.Eh = e; l.C = f; l.D = h; k && l.close(); a.Xb.vb.add(l) } function Ue(a, b, c, d, e) { var f; void 0 === f && (f = !1); null === a.o && w.k("StreamGeometryContext has been closed"); null === a.Xb && w.k("Need to call beginFigure first"); var h = new zf(rf); h.uc = b; h.Qc = c; h.C = d; h.D = e; f && h.close(); a.Xb.vb.add(h) } g.arcTo = function (a, b, c, d, e, f, h) { void 0 === f && (f = 0); void 0 === h && (h = !1); null === this.o && w.k("StreamGeometryContext has been closed"); null === this.Xb && w.k("Need to call beginFigure first"); var k = new zf(sf); k.ze = a; k.of = b; k.ka = c; k.ra = d; k.radiusX = e; k.radiusY = 0 !== f ? f : e; h && k.close(); this.Xb.vb.add(k) }; function Ve(a, b, c, d, e, f, h, k) { var l; void 0 === l && (l = !1); null === a.o && w.k("StreamGeometryContext has been closed"); null === a.Xb && w.k("Need to call beginFigure first"); b = new zf(tf, h, k, b, c, d, e, f); l && b.close(); a.Xb.vb.add(b) } function Tq(a) { a = Uq(a); var b = w.cb(); b[0] = a[0]; for (var c = 1, d = 1; d < a.length;)b[c] = a[d], b[c + 1] = a[d], b[c + 2] = a[d + 1], d += 2, c += 3; w.ua(a); return b } function Uq(a) { var b = Vq(a), c = w.cb(), d = Math.floor(b.length / 2), e = b.length - 1; a = 0 === a % 2 ? 2 : 1; for (var f = 0; f < e; f++) { var h = b[f], k = b[f + 1], l = b[(d + f - 1) % e], m = b[(d + f + a) % e]; c[2 * f] = h; c[2 * f + 1] = ne(h.x, h.y, l.x, l.y, k.x, k.y, m.x, m.y, new z) } c[c.length] = c[0]; w.ua(b); return c } function Vq(a) { for (var b = w.cb(), c = 1.5 * Math.PI, d = 0, e = 0; e < a; e++)d = 2 * Math.PI / a * e + c, b[e] = new z(.5 + .5 * Math.cos(d), .5 + .5 * Math.sin(d)); b.push(b[0]); return b } var jq = { None: "Rectangle", Rectangle: function (a, b, c) { a = new Ce; a.type = He; a.ha = 0; a.fa = 0; a.C = b; a.D = c; return a }, Square: function (a, b, c) { a = new Ce; a.be = Qj; a.type = He; a.ha = 0; a.fa = 0; a.C = Math.min(b, c); a.D = Math.min(b, c); return a }, Ellipse: function (a, b, c) { a = new Ce; a.type = Pe; a.ha = 0; a.fa = 0; a.C = b; a.D = c; a.A = Qd; a.B = Rd; return a }, Circle: function (a, b, c) { a = new Ce; a.be = Qj; a.type = Pe; a.ha = 0; a.fa = 0; a.C = Math.min(b, c); a.D = Math.min(b, c); a.A = Qd; a.B = Rd; return a }, Connector: "Ellipse", TriangleRight: function (a, b, c) { a = new Ce; var d = new Ee, e = new zf; e.C = b; e.D = .5 * c; d.vb.add(e); b = new zf; b.C = 0; b.D = c; d.vb.add(b.close()); a.fc.add(d); a.A = new L(0, .25); a.B = new L(.5, .75); return a }, TriangleDown: function (a, b, c) { a = new Ce; var d = new Ee, e = new zf; e.C = b; e.D = 0; d.vb.add(e); e = new zf; e.C = .5 * b; e.D = c; d.vb.add(e.close()); a.fc.add(d); a.A = new L(.25, 0); a.B = new L(.75, .5); return a }, TriangleLeft: function (a, b, c) { a = new Ce; var d = new Ee; d.ha = b; d.fa = c; var e = new zf; e.C = 0; e.D = .5 * c; d.vb.add(e); c = new zf; c.C = b; c.D = 0; d.vb.add(c.close()); a.fc.add(d); a.A = new L(.5, .25); a.B = new L(1, .75); return a }, TriangleUp: function (a, b, c) { a = new Ce; var d = new Ee; d.ha = b; d.fa = c; var e = new zf; e.C = 0; e.D = c; d.vb.add(e); c = new zf; c.C = .5 * b; c.D = 0; d.vb.add(c.close()); a.fc.add(d); a.A = new L(.25, .5); a.B = new L(.75, 1); return a }, Line1: function (a, b, c) { a = new Ce; a.type = Ge; a.ha = 0; a.fa = 0; a.C = b; a.D = c; return a }, Line2: function (a, b, c) { a = new Ce; a.type = Ge; a.ha = b; a.fa = 0; a.C = 0; a.D = c; return a }, MinusLine: "LineH", LineH: function (a, b, c) { a = new Ce; a.type = Ge; a.ha = 0; a.fa = c / 2; a.C = b; a.D = c / 2; return a }, LineV: function (a, b, c) { a = new Ce; a.type = Ge; a.ha = b / 2; a.fa = 0; a.C = b / 2; a.D = c; return a }, BarH: "Rectangle", BarV: "Rectangle", Curve1: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); N(a, dd * b, 0, 1 * b, (1 - dd) * c, b, c); b = a.o; w.q(a); return b }, Curve2: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); N(a, 0, dd * c, (1 - dd) * b, c, b, c); b = a.o; w.q(a); return b }, Curve3: function (a, b, c) { a = w.s(); M(a, 1 * b, 0, !1); N(a, 1 * b, dd * c, dd * b, 1 * c, 0, 1 * c); b = a.o; w.q(a); return b }, Curve4: function (a, b, c) { a = w.s(); M(a, 1 * b, 0, !1); N(a, (1 - dd) * b, 0, 0, (1 - dd) * c, 0, 1 * c); b = a.o; w.q(a); return b }, Alternative: "Triangle", Merge: "Triangle", Triangle: function (a, b, c) { a = w.s(); M(a, .5 * b, 0 * c, !0); a.lineTo(0 * b, 1 * c); a.lineTo(1 * b, 1 * c, !0); b = a.o; b.A = new L(.25, .5); b.B = new L(.75, 1); w.q(a); return b }, Decision: "Diamond", Diamond: function (a, b, c) { a = w.s(); M(a, .5 * b, 0, !0); a.lineTo(0, .5 * c); a.lineTo(.5 * b, 1 * c); a.lineTo(1 * b, .5 * c, !0); b = a.o; b.A = new L(.25, .25); b.B = new L(.75, .75); w.q(a); return b }, Pentagon: function (a, b, c) { var d = Vq(5); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; 5 > e; e++)a.lineTo(d[e].x * b, d[e].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.2, .22); b.B = new L(.8, .9); w.q(a); return b }, DataTransmission: "Hexagon", Hexagon: function (a, b, c) { var d = Vq(6); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; 6 > e; e++)a.lineTo(d[e].x * b, d[e].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.07, .25); b.B = new L(.93, .75); w.q(a); return b }, Heptagon: function (a, b, c) { var d = Vq(7); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; 7 > e; e++)a.lineTo(d[e].x * b, d[e].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.2, .15); b.B = new L(.8, .85); w.q(a); return b }, Octagon: function (a, b, c) { var d = Vq(8); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; 8 > e; e++)a.lineTo(d[e].x * b, d[e].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.15, .15); b.B = new L(.85, .85); w.q(a); return b }, Nonagon: function (a, b, c) { var d = Vq(9); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; 9 > e; e++)a.lineTo(d[e].x * b, d[e].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.17, .13); b.B = new L(.82, .82); w.q(a); return b }, Decagon: function (a, b, c) { var d = Vq(10); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; 10 > e; e++)a.lineTo(d[e].x * b, d[e].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.16, .16); b.B = new L(.84, .84); w.q(a); return b }, Dodecagon: function (a, b, c) { var d = Vq(12); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; 12 > e; e++)a.lineTo(d[e].x * b, d[e].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.16, .16); b.B = new L(.84, .84); w.q(a); return b }, FivePointedStar: function (a, b, c) { var d = Uq(5); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; 10 > e; e++)a.lineTo(d[e].x * b, d[e].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.312, .383); b.B = new L(.693, .765); w.q(a); return b }, SixPointedStar: function (a, b, c) { var d = Uq(6); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; 12 > e; e++)a.lineTo(d[e].x * b, d[e].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.17, .251); b.B = new L(.833, .755); w.q(a); return b }, SevenPointedStar: function (a, b, c) { var d = Uq(7); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; 14 > e; e++)a.lineTo(d[e].x * b, d[e].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.363, .361); b.B = new L(.641, .709); w.q(a); return b }, EightPointedStar: function (a, b, c) { var d = Uq(8); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; 16 > e; e++)a.lineTo(d[e].x * b, d[e].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.252, .255); b.B = new L(.75, .75); w.q(a); return b }, NinePointedStar: function (a, b, c) { var d = Uq(9); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; 18 > e; e++)a.lineTo(d[e].x * b, d[e].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.355, .361); b.B = new L(.645, .651); w.q(a); return b }, TenPointedStar: function (a, b, c) { var d = Uq(10); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; 20 > e; e++)a.lineTo(d[e].x * b, d[e].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.281, .261); b.B = new L(.723, .748); w.q(a); return b }, FivePointedBurst: function (a, b, c) { var d = Tq(5); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; e < d.length; e += 3)N(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.312, .383); b.B = new L(.693, .765); w.q(a); return b }, SixPointedBurst: function (a, b, c) { var d = Tq(6); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; e < d.length; e += 3)N(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.17, .251); b.B = new L(.833, .755); w.q(a); return b }, SevenPointedBurst: function (a, b, c) { var d = Tq(7); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; e < d.length; e += 3)N(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.363, .361); b.B = new L(.641, .709); w.q(a); return b }, EightPointedBurst: function (a, b, c) { var d = Tq(8); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; e < d.length; e += 3)N(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.252, .255); b.B = new L(.75, .75); w.q(a); return b }, NinePointedBurst: function (a, b, c) { var d = Tq(9); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; e < d.length; e += 3)N(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.355, .361); b.B = new L(.645, .651); w.q(a); return b }, TenPointedBurst: function (a, b, c) { var d = Tq(10); a = w.s(); M(a, d[0].x * b, d[0].y * c, !0); for (var e = 1; e < d.length; e += 3)N(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c); w.ua(d); P(a); b = a.o; b.A = new L(.281, .261); b.B = new L(.723, .748); w.q(a); return b }, Cloud: function (a, b, c) { a = w.s(); M(a, .08034461 * b, .1944299 * c, !0); N(a, -.09239631 * b, .07836421 * c, .1406031 * b, -.0542823 * c, .2008615 * b, .05349299 * c); N(a, .2450511 * b, -.00697547 * c, .3776197 * b, -.01112067 * c, .4338609 * b, .074219 * c); N(a, .4539471 * b, 0, .6066018 * b, -.02526587 * c, .6558228 * b, .07004196 * c); N(a, .6914277 * b, -.01904177 * c, .8921095 * b, -.01220843 * c, .8921095 * b, .08370865 * c); N(a, 1.036446 * b, .04105738 * c, 1.020377 * b, .3022052 * c, .9147671 * b, .3194596 * c); N(a, 1.04448 * b, .360238 * c, .992256 * b, .5219009 * c, .9082935 * b, .562044 * c); N(a, 1.032337 * b, .5771781 * c, 1.018411 * b, .8120651 * c, .9212406 * b, .8217117 * c); N(a, 1.028411 * b, .9571472 * c, .8556702 * b, 1.052487 * c, .7592566 * b, .9156953 * c); N(a, .7431877 * b, 1.009325 * c, .5624123 * b, 1.021761 * c, .5101666 * b, .9310455 * c); N(a, .4820677 * b, 1.031761 * c, .3030112 * b, 1.002796 * c, .2609328 * b, .9344623 * c); N(a, .2329994 * b, 1.01518 * c, .03213784 * b, 1.01518 * c, .08034461 * b, .870098 * c); N(a, -.02812061 * b, .9032597 * c, -.01205169 * b, .6835638 * c, .06829292 * b, .6545475 * c); N(a, -.01812061 * b, .6089503 * c, -.00606892 * b, .4555777 * c, .06427569 * b, .4265613 * c); N(a, -.01606892 * b, .3892545 * c, -.01205169 * b, .1944299 * c, .08034461 * b, .1944299 * c); P(a); b = a.o; b.A = new L(.1, .1); b.B = new L(.9, .9); w.q(a); return b }, Gate: "Crescent", Crescent: function (a, b, c) { a = w.s(); M(a, 0, 0, !0); N(a, 1 * b, 0, 1 * b, 1 * c, 0, 1 * c); N(a, .5 * b, .75 * c, .5 * b, .25 * c, 0, 0); P(a); b = a.o; b.A = new L(.511, .19); b.B = new L(.776, .76); w.q(a); return b }, FramedRectangle: function (a, b, c) { var d = w.s(), e = a ? a.Ec : NaN; a = a ? a.yu : NaN; isNaN(e) && (e = .1); isNaN(a) && (a = .1); M(d, 0, 0, !0); d.lineTo(1 * b, 0); d.lineTo(1 * b, 1 * c); d.lineTo(0, 1 * c, !0); M(d, e * b, a * c, !1, !0); d.lineTo(e * b, (1 - a) * c); d.lineTo((1 - e) * b, (1 - a) * c); d.lineTo((1 - e) * b, a * c, !0); b = d.o; b.A = new L(e, a); b.B = new L(1 - e, 1 - a); w.q(d); return b }, Delay: "HalfEllipse", HalfEllipse: function (a, b, c) { a = w.s(); M(a, 0, 0, !0); N(a, dd * b, 0, 1 * b, (.5 - dd / 2) * c, 1 * b, .5 * c); N(a, 1 * b, (.5 + dd / 2) * c, dd * b, 1 * c, 0, 1 * c); P(a); b = a.o; b.A = new L(0, .2); b.B = new L(.75, .8); w.q(a); return b }, Heart: function (a, b, c) { a = w.s(); M(a, .5 * b, 1 * c, !0); N(a, .1 * b, .8 * c, 0, .5 * c, 0 * b, .3 * c); N(a, 0 * b, 0, .45 * b, 0, .5 * b, .3 * c); N(a, .55 * b, 0, 1 * b, 0, 1 * b, .3 * c); N(a, b, .5 * c, .9 * b, .8 * c, .5 * b, 1 * c); P(a); b = a.o; b.A = new L(.15, .29); b.B = new L(.86, .68); w.q(a); return b }, Spade: function (a, b, c) { a = w.s(); M(a, .5 * b, 0, !0); a.lineTo(.51 * b, .01 * c); N(a, .6 * b, .2 * c, b, .25 * c, b, .5 * c); N(a, b, .8 * c, .6 * b, .8 * c, .55 * b, .7 * c); N(a, .5 * b, .75 * c, .55 * b, .95 * c, .75 * b, c); a.lineTo(.25 * b, c); N(a, .45 * b, .95 * c, .5 * b, .75 * c, .45 * b, .7 * c); N(a, .4 * b, .8 * c, 0, .8 * c, 0, .5 * c); N(a, 0, .25 * c, .4 * b, .2 * c, .49 * b, .01 * c); P(a); b = a.o; b.A = new L(.19, .26); b.B = new L(.8, .68); w.q(a); return b }, Club: function (a, b, c) { a = w.s(); M(a, .4 * b, .6 * c, !0); N(a, .5 * b, .75 * c, .45 * b, .95 * c, .15 * b, 1 * c); a.lineTo(.85 * b, c); N(a, .55 * b, .95 * c, .5 * b, .75 * c, .6 * b, .6 * c); var d = .2, e = .3, f = 0, h = 4 * (Math.SQRT2 - 1) / 3 * d; N(a, (.5 - d + e) * b, (.5 + h + f) * c, (.5 - h + e) * b, (.5 + d + f) * c, (.5 + e) * b, (.5 + d + f) * c); N(a, (.5 + h + e) * b, (.5 + d + f) * c, (.5 + d + e) * b, (.5 + h + f) * c, (.5 + d + e) * b, (.5 + f) * c); N(a, (.5 + d + e) * b, (.5 - h + f) * c, (.5 + h + e) * b, (.5 - d + f) * c, (.5 + e) * b, (.5 - d + f) * c); N(a, (.5 - h + e) * b, (.5 - d + f) * c, (.5 - d + e + .05) * b, (.5 - h + f - .02) * c, .65 * b, .36771243 * c); d = .2; e = 0; f = -.3; h = 4 * (Math.SQRT2 - 1) / 3 * d; N(a, (.5 + h + e) * b, (.5 + d + f) * c, (.5 + d + e) * b, (.5 + h + f) * c, (.5 + d + e) * b, (.5 + f) * c); N(a, (.5 + d + e) * b, (.5 - h + f) * c, (.5 + h + e) * b, (.5 - d + f) * c, (.5 + e) * b, (.5 - d + f) * c); N(a, (.5 - h + e) * b, (.5 - d + f) * c, (.5 - d + e) * b, (.5 - h + f) * c, (.5 - d + e) * b, (.5 + f) * c); N(a, (.5 - d + e) * b, (.5 + h + f) * c, (.5 - h + e) * b, (.5 + d + f) * c, .35 * b, .36771243 * c); d = .2; e = -.3; f = 0; h = 4 * (Math.SQRT2 - 1) / 3 * d; N(a, (.5 + d + e - .05) * b, (.5 - h + f - .02) * c, (.5 + h + e) * b, (.5 - d + f) * c, (.5 + e) * b, (.5 - d + f) * c); N(a, (.5 - h + e) * b, (.5 - d + f) * c, (.5 - d + e) * b, (.5 - h + f) * c, (.5 - d + e) * b, (.5 + f) * c); N(a, (.5 - d + e) * b, (.5 + h + f) * c, (.5 - h + e) * b, (.5 + d + f) * c, (.5 + e) * b, (.5 + d + f) * c); N(a, (.5 + h + e) * b, (.5 + d + f) * c, (.5 + d + e) * b, (.5 + h + f) * c, .4 * b, .6 * c); P(a); b = a.o; b.A = new L(.06, .39); b.B = new L(.93, .58); w.q(a); return b }, Ring: function (a, b, c) { a = w.s(); var d = 4 * (Math.SQRT2 - 1) / 3 * .5; M(a, b, .5 * c, !0); N(a, b, (.5 - d) * c, (.5 + d) * b, 0, .5 * b, 0); N(a, (.5 - d) * b, 0, 0, (.5 - d) * c, 0, .5 * c); N(a, 0, (.5 + d) * c, (.5 - d) * b, c, .5 * b, c); N(a, (.5 + d) * b, c, b, (.5 + d) * c, b, .5 * c); d = 4 * (Math.SQRT2 - 1) / 3 * .4; M(a, .5 * b, .1 * c, !0, !0); N(a, (.5 + d) * b, .1 * c, .9 * b, (.5 - d) * c, .9 * b, .5 * c); N(a, .9 * b, (.5 + d) * c, (.5 + d) * b, .9 * c, .5 * b, .9 * c); N(a, (.5 - d) * b, .9 * c, .1 * b, (.5 + d) * c, .1 * b, .5 * c); N(a, .1 * b, (.5 - d) * c, (.5 - d) * b, .1 * c, .5 * b, .1 * c); b = a.o; b.A = new L(.146, .146); b.B = new L(.853, .853); b.be = Qj; w.q(a); return b }, YinYang: function (a, b, c) { var d = .5; a = w.s(); d = .5; M(a, .5 * b, 0, !0); a.arcTo(270, 180, .5 * b, .5 * b, .5 * b); N(a, 1 * b, d * c, 0, d * c, d * b, 0, !0); var d = .1, e = .25; M(a, (.5 + d) * b, e * c, !0, !0); a.arcTo(0, -360, .5 * b, c * e, d * b); P(a); M(a, .5 * b, 0, !1); a.arcTo(270, -180, .5 * b, .5 * b, .5 * b); a.bb(!1); e = .75; M(a, (.5 + d) * b, e * c, !0); a.arcTo(0, 360, .5 * b, c * e, d * b); P(a); b = a.o; b.be = Qj; w.q(a); return b }, Peace: function (a, b, c) { a = w.s(); var d = 4 * (Math.SQRT2 - 1) / 3 * .5; M(a, b, .5 * c, !0); N(a, b, (.5 - d) * c, (.5 + d) * b, 0, .5 * b, 0); N(a, (.5 - d) * b, 0, 0, (.5 - d) * c, 0, .5 * c); N(a, 0, (.5 + d) * c, (.5 - d) * b, c, .5 * b, c); N(a, (.5 + d) * b, c, b, (.5 + d) * c, b, .5 * c); d = 4 * (Math.SQRT2 - 1) / 3 * .4; M(a, .5 * b, .1 * c, !0, !0); N(a, (.5 + d) * b, .1 * c, .9 * b, (.5 - d) * c, .9 * b, .5 * c); N(a, .9 * b, (.5 + d) * c, (.5 + d) * b, .9 * c, .5 * b, .9 * c); N(a, (.5 - d) * b, .9 * c, .1 * b, (.5 + d) * c, .1 * b, .5 * c); N(a, .1 * b, (.5 - d) * c, (.5 - d) * b, .1 * c, .5 * b, .1 * c); var d = .07, e = 0, f = -.707 * .11, h = 4 * (Math.SQRT2 - 1) / 3 * d; M(a, (.5 + d + e) * b, (.5 + f) * c, !0); N(a, (.5 + d + e) * b, (.5 - h + f) * c, (.5 + h + e) * b, (.5 - d + f) * c, (.5 + e) * b, (.5 - d + f) * c); N(a, (.5 - h + e) * b, (.5 - d + f) * c, (.5 - d + e) * b, (.5 - h + f) * c, (.5 - d + e) * b, (.5 + f) * c); N(a, (.5 - d + e) * b, (.5 + h + f) * c, (.5 - h + e) * b, (.5 + d + f) * c, (.5 + e) * b, (.5 + d + f) * c); N(a, (.5 + h + e) * b, (.5 + d + f) * c, (.5 + d + e) * b, (.5 + h + f) * c, (.5 + d + e) * b, (.5 + f) * c); d = .07; e = -.707 * .11; f = .707 * .11; h = 4 * (Math.SQRT2 - 1) / 3 * d; M(a, (.5 + d + e) * b, (.5 + f) * c, !0); N(a, (.5 + d + e) * b, (.5 - h + f) * c, (.5 + h + e) * b, (.5 - d + f) * c, (.5 + e) * b, (.5 - d + f) * c); N(a, (.5 - h + e) * b, (.5 - d + f) * c, (.5 - d + e) * b, (.5 - h + f) * c, (.5 - d + e) * b, (.5 + f) * c); N(a, (.5 - d + e) * b, (.5 + h + f) * c, (.5 - h + e) * b, (.5 + d + f) * c, (.5 + e) * b, (.5 + d + f) * c); N(a, (.5 + h + e) * b, (.5 + d + f) * c, (.5 + d + e) * b, (.5 + h + f) * c, (.5 + d + e) * b, (.5 + f) * c); d = .07; e = .707 * .11; f = .707 * .11; h = 4 * (Math.SQRT2 - 1) / 3 * d; M(a, (.5 + d + e) * b, (.5 + f) * c, !0); N(a, (.5 + d + e) * b, (.5 - h + f) * c, (.5 + h + e) * b, (.5 - d + f) * c, (.5 + e) * b, (.5 - d + f) * c); N(a, (.5 - h + e) * b, (.5 - d + f) * c, (.5 - d + e) * b, (.5 - h + f) * c, (.5 - d + e) * b, (.5 + f) * c); N(a, (.5 - d + e) * b, (.5 + h + f) * c, (.5 - h + e) * b, (.5 + d + f) * c, (.5 + e) * b, (.5 + d + f) * c); N(a, (.5 + h + e) * b, (.5 + d + f) * c, (.5 + d + e) * b, (.5 + h + f) * c, (.5 + d + e) * b, (.5 + f) * c); b = a.o; b.A = new L(.146, .146); b.B = new L(.853, .853); b.be = Qj; w.q(a); return b }, NotAllowed: function (a, b, c) { var d = .5 * dd, e = .5; a = w.s(); M(a, .5 * b, (.5 - e) * c, !0); N(a, (.5 - d) * b, (.5 - e) * c, (.5 - e) * b, (.5 - d) * c, (.5 - e) * b, .5 * c); N(a, (.5 - e) * b, (.5 + d) * c, (.5 - d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c); N(a, (.5 + d) * b, (.5 + e) * c, (.5 + e) * b, (.5 + d) * c, (.5 + e) * b, .5 * c); N(a, (.5 + e) * b, (.5 - d) * c, (.5 + d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c); var e = .4, d = .4 * dd, f = w.K(), h = w.K(), k = w.K(), l = w.K(); fe(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .42, f, h, k, l, l); var m = w.K(), n = w.K(), p = w.K(); fe(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .58, l, l, p, m, n); var q = w.K(), r = w.K(), s = w.K(); fe(.5, .5 + e, .5 - d, .5 + e, .5 - e, .5 + d, .5 - e, .5, .42, q, r, s, l, l); var u = w.K(), t = w.K(), x = w.K(); fe(.5, .5 + e, .5 - d, .5 + e, .5 - e, .5 + d, .5 - e, .5, .58, l, l, x, u, t); M(a, x.x * b, x.y * c, !0, !0); N(a, u.x * b, u.y * c, t.x * b, t.y * c, (.5 - e) * b, .5 * c); N(a, (.5 - e) * b, (.5 - d) * c, (.5 - d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c); N(a, f.x * b, f.y * c, h.x * b, h.y * c, k.x * b, k.y * c); a.lineTo(x.x * b, x.y * c); P(a); M(a, s.x * b, s.y * c, !0, !0); a.lineTo(p.x * b, p.y * c); N(a, m.x * b, m.y * c, n.x * b, n.y * c, (.5 + e) * b, .5 * c); N(a, (.5 + e) * b, (.5 + d) * c, (.5 + d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c); N(a, q.x * b, q.y * c, r.x * b, r.y * c, s.x * b, s.y * c); P(a); w.v(f); w.v(h); w.v(k); w.v(l); w.v(m); w.v(n); w.v(p); w.v(q); w.v(r); w.v(s); w.v(u); w.v(t); w.v(x); b = a.o; w.q(a); b.be = Qj; return b }, Fragile: function (a, b, c) { a = w.s(); M(a, 0, 0, !0); a.lineTo(.25 * b, 0); a.lineTo(.2 * b, .15 * c); a.lineTo(.3 * b, .25 * c); a.lineTo(.29 * b, .33 * c); a.lineTo(.35 * b, .25 * c); a.lineTo(.3 * b, .15 * c); a.lineTo(.4 * b, 0); a.lineTo(1 * b, 0); N(a, 1 * b, .25 * c, .75 * b, .5 * c, .55 * b, .5 * c); a.lineTo(.55 * b, .9 * c); a.lineTo(.7 * b, .9 * c); a.lineTo(.7 * b, 1 * c); a.lineTo(.3 * b, 1 * c); a.lineTo(.3 * b, .9 * c); a.lineTo(.45 * b, .9 * c); a.lineTo(.45 * b, .5 * c); N(a, .25 * b, .5 * c, 0, .25 * c, 0, 0); P(a); b = a.o; b.A = new L(.25, 0); b.B = new L(.75, .4); w.q(a); return b }, HourGlass: function (a, b, c) { a = w.s(); M(a, .65 * b, .5 * c, !0); a.lineTo(1 * b, 1 * c); a.lineTo(0, 1 * c); a.lineTo(.35 * b, .5 * c); a.lineTo(0, 0); a.lineTo(1 * b, 0); P(a); b = a.o; w.q(a); return b }, Lightning: function (a, b, c) { a = w.s(); M(a, 0 * b, .55 * c, !0); a.lineTo(.75 * b, 0); a.lineTo(.25 * b, .45 * c); a.lineTo(.9 * b, .48 * c); a.lineTo(.4 * b, 1 * c); a.lineTo(.65 * b, .55 * c); P(a); b = a.o; w.q(a); return b }, Parallelogram1: function (a, b, c) { a = a ? a.Ec : NaN; isNaN(a) && (a = .1); var d = w.s(); M(d, a * b, 0, !0); d.lineTo(1 * b, 0); d.lineTo((1 - a) * b, 1 * c); d.lineTo(0, 1 * c); P(d); b = d.o; b.A = new L(a, 0); b.B = new L(1 - a, 1); w.q(d); return b }, Input: "Output", Output: function (a, b, c) { a = w.s(); M(a, 0, 1 * c, !0); a.lineTo(.1 * b, 0); a.lineTo(1 * b, 0); a.lineTo(.9 * b, 1 * c); P(a); b = a.o; b.A = new L(.1, 0); b.B = new L(.9, 1); w.q(a); return b }, Parallelogram2: function (a, b, c) { a = a ? a.Ec : NaN; isNaN(a) && (a = .25); var d = w.s(); M(d, a * b, 0, !0); d.lineTo(1 * b, 0); d.lineTo((1 - a) * b, 1 * c); d.lineTo(0, 1 * c); P(d); b = d.o; b.A = new L(a, 0); b.B = new L(1 - a, 1); w.q(d); return b }, ThickCross: function (a, b, c) { a = a ? a.Ec : NaN; isNaN(a) && (a = .25); var d = w.s(); M(d, (.5 - a / 2) * b, 0, !0); d.lineTo((.5 + a / 2) * b, 0); d.lineTo((.5 + a / 2) * b, (.5 - a / 2) * c); d.lineTo(1 * b, (.5 - a / 2) * c); d.lineTo(1 * b, (.5 + a / 2) * c); d.lineTo((.5 + a / 2) * b, (.5 + a / 2) * c); d.lineTo((.5 + a / 2) * b, 1 * c); d.lineTo((.5 - a / 2) * b, 1 * c); d.lineTo((.5 - a / 2) * b, (.5 + a / 2) * c); d.lineTo(0, (.5 + a / 2) * c); d.lineTo(0, (.5 - a / 2) * c); d.lineTo((.5 - a / 2) * b, (.5 - a / 2) * c); P(d); b = d.o; b.A = new L(.5 - a / 2, .5 - a / 2); b.B = new L(.5 + a / 2, .5 + a / 2); w.q(d); return b }, ThickX: function (a, b, c) { a = .25 / Math.SQRT2; var d = w.s(); M(d, .3 * b, 0, !0); d.lineTo(.5 * b, .2 * c); d.lineTo(.7 * b, 0); d.lineTo(1 * b, .3 * c); d.lineTo(.8 * b, .5 * c); d.lineTo(1 * b, .7 * c); d.lineTo(.7 * b, 1 * c); d.lineTo(.5 * b, .8 * c); d.lineTo(.3 * b, 1 * c); d.lineTo(0, .7 * c); d.lineTo(.2 * b, .5 * c); d.lineTo(0, .3 * c); P(d); b = d.o; b.A = new L(.5 - a, .5 - a); b.B = new L(.5 + a, .5 + a); w.q(d); return b }, ThinCross: function (a, b, c) { var d = a ? a.Ec : NaN; isNaN(d) && (d = .1); a = w.s(); M(a, (.5 - d / 2) * b, 0, !0); a.lineTo((.5 + d / 2) * b, 0); a.lineTo((.5 + d / 2) * b, (.5 - d / 2) * c); a.lineTo(1 * b, (.5 - d / 2) * c); a.lineTo(1 * b, (.5 + d / 2) * c); a.lineTo((.5 + d / 2) * b, (.5 + d / 2) * c); a.lineTo((.5 + d / 2) * b, 1 * c); a.lineTo((.5 - d / 2) * b, 1 * c); a.lineTo((.5 - d / 2) * b, (.5 + d / 2) * c); a.lineTo(0, (.5 + d / 2) * c); a.lineTo(0, (.5 - d / 2) * c); a.lineTo((.5 - d / 2) * b, (.5 - d / 2) * c); P(a); b = a.o; w.q(a); return b }, ThinX: function (a, b, c) { a = w.s(); M(a, .1 * b, 0, !0); a.lineTo(.5 * b, .4 * c); a.lineTo(.9 * b, 0); a.lineTo(1 * b, .1 * c); a.lineTo(.6 * b, .5 * c); a.lineTo(1 * b, .9 * c); a.lineTo(.9 * b, 1 * c); a.lineTo(.5 * b, .6 * c); a.lineTo(.1 * b, 1 * c); a.lineTo(0, .9 * c); a.lineTo(.4 * b, .5 * c); a.lineTo(0, .1 * c); P(a); b = a.o; w.q(a); return b }, RightTriangle: function (a, b, c) { a = w.s(); M(a, 0, 0, !0); a.lineTo(1 * b, 1 * c); a.lineTo(0, 1 * c); P(a); b = a.o; b.A = new L(0, .5); b.B = new L(.5, 1); w.q(a); return b }, RoundedIBeam: function (a, b, c) { a = w.s(); M(a, 0, 0, !0); a.lineTo(1 * b, 0); N(a, .5 * b, .25 * c, .5 * b, .75 * c, 1 * b, 1 * c); a.lineTo(0, 1 * c); N(a, .5 * b, .75 * c, .5 * b, .25 * c, 0, 0); P(a); b = a.o; w.q(a); return b }, RoundedRectangle: function (a, b, c) { var d = a ? a.Ec : NaN; isNaN(d) && (d = 5); d = Math.min(d, b / 3); d = Math.min(d, c / 3); a = d * dd; var e = w.s(); M(e, d, 0, !0); e.lineTo(b - d, 0); N(e, b - a, 0, b, a, b, d); e.lineTo(b, c - d); N(e, b, c - a, b - a, c, b - d, c); e.lineTo(d, c); N(e, a, c, 0, c - a, 0, c - d); e.lineTo(0, d); N(e, 0, a, a, 0, d, 0); P(e); b = e.o; 1 < a ? (b.A = new L(0, 0, a, a), b.B = new L(1, 1, -a, -a)) : (b.A = xb, b.B = Nb); w.q(e); return b }, Border: function (a, b, c) { var d = a ? a.Ec : NaN; isNaN(d) && (d = 5); d = Math.min(d, b / 3); d = Math.min(d, c / 3); a = w.s(); M(a, d, 0, !0); a.lineTo(b - d, 0); N(a, b - 0, 0, b, 0, b, d); a.lineTo(b, c - d); N(a, b, c - 0, b - 0, c, b - d, c); a.lineTo(d, c); N(a, 0, c, 0, c - 0, 0, c - d); a.lineTo(0, d); N(a, 0, 0, 0, 0, d, 0); P(a); b = a.o; b.A = xb; b.B = Nb; w.q(a); return b }, SquareIBeam: function (a, b, c) { var d = a ? a.Ec : NaN; isNaN(d) && (d = .2); a = w.s(); M(a, 0, 0, !0); a.lineTo(1 * b, 0); a.lineTo(1 * b, d * c); a.lineTo((.5 + d / 2) * b, d * c); a.lineTo((.5 + d / 2) * b, (1 - d) * c); a.lineTo(1 * b, (1 - d) * c); a.lineTo(1 * b, 1 * c); a.lineTo(0, 1 * c); a.lineTo(0, (1 - d) * c); a.lineTo((.5 - d / 2) * b, (1 - d) * c); a.lineTo((.5 - d / 2) * b, d * c); a.lineTo(0, d * c); P(a); b = a.o; w.q(a); return b }, Trapezoid: function (a, b, c) { a = a ? a.Ec : NaN; isNaN(a) && (a = .2); var d = w.s(); M(d, a * b, 0, !0); d.lineTo((1 - a) * b, 0); d.lineTo(1 * b, 1 * c); d.lineTo(0, 1 * c); P(d); b = d.o; b.A = new L(a, 0); b.B = new L(1 - a, 1); w.q(d); return b }, ManualLoop: "ManualOperation", ManualOperation: function (a, b, c) { var d = a ? a.Ec : NaN; isNaN(d) && (d = 0); a = w.s(); M(a, d, 0, !0); a.lineTo(0, 0); a.lineTo(1 * b, 0); a.lineTo(.9 * b, 1 * c); a.lineTo(.1 * b, 1 * c); P(a); b = a.o; b.A = new L(.1, 0); b.B = new L(.9, 1); w.q(a); return b }, GenderMale: function (a, b, c) { a = w.s(); var d = .4 * dd, e = .4, f = w.K(), h = w.K(), k = w.K(), l = w.K(); M(a, (.5 - e) * b, .5 * c, !0); N(a, (.5 - e) * b, (.5 - d) * c, (.5 - d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c); fe(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .44, k, l, h, f, f); N(a, k.x * b, k.y * c, l.x * b, l.y * c, h.x * b, h.y * c); var m = w.xb(h.x, h.y); fe(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .56, f, f, h, k, l); var n = w.xb(h.x, h.y); a.lineTo((.1 * m.x + .855) * b, .1 * m.y * c); a.lineTo(.85 * b, .1 * m.y * c); a.lineTo(.85 * b, 0); a.lineTo(1 * b, 0); a.lineTo(1 * b, .15 * c); a.lineTo((.1 * n.x + .9) * b, .15 * c); a.lineTo((.1 * n.x + .9) * b, (.1 * n.y + .05 * .9) * c); a.lineTo(n.x * b, n.y * c); N(a, k.x * b, k.y * c, l.x * b, l.y * c, (.5 + e) * b, .5 * c); N(a, (.5 + e) * b, (.5 + d) * c, (.5 + d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c); N(a, (.5 - d) * b, (.5 + e) * c, (.5 - e) * b, (.5 + d) * c, (.5 - e) * b, .5 * c); e = .35; d = .35 * dd; M(a, .5 * b, (.5 - e) * c, !0, !0); N(a, (.5 - d) * b, (.5 - e) * c, (.5 - e) * b, (.5 - d) * c, (.5 - e) * b, .5 * c); N(a, (.5 - e) * b, (.5 + d) * c, (.5 - d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c); N(a, (.5 + d) * b, (.5 + e) * c, (.5 + e) * b, (.5 + d) * c, (.5 + e) * b, .5 * c); N(a, (.5 + e) * b, (.5 - d) * c, (.5 + d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c); M(a, (.5 - e) * b, .5 * c, !0); w.v(f); w.v(h); w.v(k); w.v(l); w.v(m); w.v(n); b = a.o; b.A = new L(.202, .257); b.B = new L(.692, .839); b.be = Qj; w.q(a); return b }, GenderFemale: function (a, b, c) { a = w.s(); var d = .375, e = 0, f = -.125, h = 4 * (Math.SQRT2 - 1) / 3 * d; M(a, (.525 + e) * b, (.5 + d + f) * c, !0); N(a, (.5 + h + e) * b, (.5 + d + f) * c, (.5 + d + e) * b, (.5 + h + f) * c, (.5 + d + e) * b, (.5 + f) * c); N(a, (.5 + d + e) * b, (.5 - h + f) * c, (.5 + h + e) * b, (.5 - d + f) * c, (.5 + e) * b, (.5 - d + f) * c); N(a, (.5 - h + e) * b, (.5 - d + f) * c, (.5 - d + e) * b, (.5 - h + f) * c, (.5 - d + e) * b, (.5 + f) * c); N(a, (.5 - d + e) * b, (.5 + h + f) * c, (.5 - h + e) * b, (.5 + d + f) * c, (.475 + e) * b, (.5 + d + f) * c); a.lineTo(.475 * b, .85 * c); a.lineTo(.425 * b, .85 * c); a.lineTo(.425 * b, .9 * c); a.lineTo(.475 * b, .9 * c); a.lineTo(.475 * b, 1 * c); a.lineTo(.525 * b, 1 * c); a.lineTo(.525 * b, .9 * c); a.lineTo(.575 * b, .9 * c); a.lineTo(.575 * b, .85 * c); a.lineTo(.525 * b, .85 * c); P(a); d = .325; e = 0; f = -.125; h = 4 * (Math.SQRT2 - 1) / 3 * d; M(a, (.5 + d + e) * b, (.5 + f) * c, !0, !0); N(a, (.5 + d + e) * b, (.5 + h + f) * c, (.5 + h + e) * b, (.5 + d + f) * c, (.5 + e) * b, (.5 + d + f) * c); N(a, (.5 - h + e) * b, (.5 + d + f) * c, (.5 - d + e) * b, (.5 + h + f) * c, (.5 - d + e) * b, (.5 + f) * c); N(a, (.5 - d + e) * b, (.5 - h + f) * c, (.5 - h + e) * b, (.5 - d + f) * c, (.5 + e) * b, (.5 - d + f) * c); N(a, (.5 + h + e) * b, (.5 - d + f) * c, (.5 + d + e) * b, (.5 - h + f) * c, (.5 + d + e) * b, (.5 + f) * c); M(a, (.525 + e) * b, (.5 + d + f) * c, !0); b = a.o; b.A = new L(.232, .136); b.B = new L(.782, .611); b.be = Qj; w.q(a); return b }, PlusLine: function (a, b, c) { a = w.s(); M(a, 0, .5 * c, !1); a.lineTo(1 * b, .5 * c); a.moveTo(.5 * b, 0); a.lineTo(.5 * b, 1 * c); b = a.o; w.q(a); return b }, XLine: function (a, b, c) { a = w.s(); M(a, 0, 1 * c, !1); a.lineTo(1 * b, 0); a.moveTo(0, 0); a.lineTo(1 * b, 1 * c); b = a.o; w.q(a); return b }, AsteriskLine: function (a, b, c) { a = w.s(); var d = .2 / Math.SQRT2; M(a, d * b, (1 - d) * c, !1); a.lineTo((1 - d) * b, d * c); a.moveTo(d * b, d * c); a.lineTo((1 - d) * b, (1 - d) * c); a.moveTo(0 * b, .5 * c); a.lineTo(1 * b, .5 * c); a.moveTo(.5 * b, 0 * c); a.lineTo(.5 * b, 1 * c); b = a.o; w.q(a); return b }, CircleLine: function (a, b, c) { var d = .5 * dd; a = w.s(); M(a, 1 * b, .5 * c, !1); N(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c); N(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0); N(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c); b = a.o; b.A = new L(.146, .146); b.B = new L(.853, .853); b.be = Qj; w.q(a); return b }, Pie: function (a, b, c) { a = w.s(); var d = 4 * (Math.SQRT2 - 1) / 3 * .5; M(a, (.5 * Math.SQRT2 / 2 + .5) * b, (.5 - .5 * Math.SQRT2 / 2) * c, !0); N(a, .7 * b, 0 * c, .5 * b, 0 * c, .5 * b, 0 * c); N(a, (.5 - d + 0) * b, 0 * c, 0 * b, (.5 - d + 0) * c, 0 * b, .5 * c); N(a, 0 * b, (.5 + d + 0) * c, (.5 - d + 0) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 + d + 0) * b, 1 * c, 1 * b, (.5 + d + 0) * c, 1 * b, .5 * c); a.lineTo(.5 * b, .5 * c); P(a); b = a.o; w.q(a); return b }, PiePiece: function (a, b, c) { var d = dd / Math.SQRT2 * .5, e = Math.SQRT2 / 2, f = 1 - Math.SQRT2 / 2; a = w.s(); M(a, b, c, !0); N(a, b, (1 - d) * c, (e + d) * b, (f + d) * c, e * b, f * c); a.lineTo(0, c); P(a); b = a.o; w.q(a); return b }, StopSign: function (a, b, c) { a = 1 / (Math.SQRT2 + 2); var d = w.s(); M(d, a * b, 0, !0); d.lineTo((1 - a) * b, 0); d.lineTo(1 * b, a * c); d.lineTo(1 * b, (1 - a) * c); d.lineTo((1 - a) * b, 1 * c); d.lineTo(a * b, 1 * c); d.lineTo(0, (1 - a) * c); d.lineTo(0, a * c); P(d); b = d.o; b.A = new L(a / 2, a / 2); b.B = new L(1 - a / 2, 1 - a / 2); w.q(d); return b }, LogicImplies: function (a, b, c) { var d = a ? a.Ec : NaN; isNaN(d) && (d = .2); a = w.s(); M(a, (1 - d) * b, 0 * c, !1); a.lineTo(1 * b, .5 * c); a.lineTo((1 - d) * b, c); a.moveTo(0, .5 * c); a.lineTo(b, .5 * c); b = a.o; b.A = xb; b.B = new L(.8, .5); w.q(a); return b }, LogicIff: function (a, b, c) { var d = a ? a.Ec : NaN; isNaN(d) && (d = .2); a = w.s(); M(a, (1 - d) * b, 0 * c, !1); a.lineTo(1 * b, .5 * c); a.lineTo((1 - d) * b, c); a.moveTo(0, .5 * c); a.lineTo(b, .5 * c); a.moveTo(d * b, 0); a.lineTo(0, .5 * c); a.lineTo(d * b, c); b = a.o; b.A = new L(.2, 0); b.B = new L(.8, .5); w.q(a); return b }, LogicNot: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); a.lineTo(1 * b, 0); a.lineTo(1 * b, 1 * c); b = a.o; w.q(a); return b }, LogicAnd: function (a, b, c) { a = w.s(); M(a, 0, 1 * c, !1); a.lineTo(.5 * b, 0); a.lineTo(1 * b, 1 * c); b = a.o; b.A = new L(.25, .5); b.B = new L(.75, 1); w.q(a); return b }, LogicOr: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); a.lineTo(.5 * b, 1 * c); a.lineTo(1 * b, 0); b = a.o; b.A = new L(.219, 0); b.B = new L(.78, .409); w.q(a); return b }, LogicXor: function (a, b, c) { a = w.s(); M(a, .5 * b, 0, !1); a.lineTo(.5 * b, 1 * c); a.moveTo(0, .5 * c); a.lineTo(1 * b, .5 * c); var d = .5 * dd; N(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c); N(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0); N(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c); b = a.o; b.be = Qj; w.q(a); return b }, LogicTruth: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); a.lineTo(1 * b, 0); a.moveTo(.5 * b, 0); a.lineTo(.5 * b, 1 * c); b = a.o; w.q(a); return b }, LogicFalsity: function (a, b, c) { a = w.s(); M(a, 0, 1 * c, !1); a.lineTo(1 * b, 1 * c); a.moveTo(.5 * b, 1 * c); a.lineTo(.5 * b, 0); b = a.o; w.q(a); return b }, LogicThereExists: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); a.lineTo(1 * b, 0); a.lineTo(1 * b, .5 * c); a.lineTo(0, .5 * c); a.moveTo(1 * b, .5 * c); a.lineTo(1 * b, 1 * c); a.lineTo(0, 1 * c); b = a.o; w.q(a); return b }, LogicForAll: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); a.lineTo(.5 * b, 1 * c); a.lineTo(1 * b, 0); a.moveTo(.25 * b, .5 * c); a.lineTo(.75 * b, .5 * c); b = a.o; b.A = new L(.25, 0); b.B = new L(.75, .5); w.q(a); return b }, LogicIsDefinedAs: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); a.lineTo(b, 0); a.moveTo(0, .5 * c); a.lineTo(b, .5 * c); a.moveTo(0, c); a.lineTo(b, c); b = a.o; b.A = new L(.01, .01); b.B = new L(.99, .49); w.q(a); return b }, LogicIntersect: function (a, b, c) { var d = .5 * dd; a = w.s(); M(a, 0, 1 * c, !1); a.lineTo(0, .5 * c); N(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0); N(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c); a.lineTo(1 * b, 1 * c); b = a.o; b.A = new L(0, .5); b.B = Nb; w.q(a); return b }, LogicUnion: function (a, b, c) { var d = .5 * dd; a = w.s(); M(a, 1 * b, 0, !1); a.lineTo(1 * b, .5 * c); N(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c); a.lineTo(0, 0); b = a.o; b.A = xb; b.B = new L(1, .5); w.q(a); return b }, Arrow: function (a, b, c) { var d = a ? a.Ec : NaN, e = a ? a.yu : NaN; isNaN(d) && (d = .3); isNaN(e) && (e = .3); a = w.s(); M(a, 0, (.5 - e / 2) * c, !0); a.lineTo((1 - d) * b, (.5 - e / 2) * c); a.lineTo((1 - d) * b, 0); a.lineTo(1 * b, .5 * c); a.lineTo((1 - d) * b, 1 * c); a.lineTo((1 - d) * b, (.5 + e / 2) * c); a.lineTo(0, (.5 + e / 2) * c); P(a); b = a.o; b.A = new L(0, .5 - e / 2); d = ne(0, .5 + e / 2, 1, .5 + e / 2, 1 - d, 1, 1, .5, w.K()); b.B = new L(d.x, d.y); w.v(d); w.q(a); return b }, ISOProcess: "Chevron", Chevron: function (a, b, c) { a = w.s(); M(a, 0, 0, !0); a.lineTo(.5 * b, 0); a.lineTo(1 * b, .5 * c); a.lineTo(.5 * b, 1 * c); a.lineTo(0, 1 * c); a.lineTo(.5 * b, .5 * c); P(a); b = a.o; w.q(a); return b }, DoubleArrow: function (a, b, c) { a = w.s(); M(a, 0, 0, !0); a.lineTo(.3 * b, .214 * c); a.lineTo(.3 * b, 0); a.lineTo(1 * b, .5 * c); a.lineTo(.3 * b, 1 * c); a.lineTo(.3 * b, .786 * c); a.lineTo(0, 1 * c); P(a); M(a, .3 * b, .214 * c, !1); a.lineTo(.3 * b, .786 * c); a.bb(!1); b = a.o; w.q(a); return b }, DoubleEndArrow: function (a, b, c) { a = w.s(); M(a, 1 * b, .5 * c, !0); a.lineTo(.7 * b, 1 * c); a.lineTo(.7 * b, .7 * c); a.lineTo(.3 * b, .7 * c); a.lineTo(.3 * b, 1 * c); a.lineTo(0, .5 * c); a.lineTo(.3 * b, 0); a.lineTo(.3 * b, .3 * c); a.lineTo(.7 * b, .3 * c); a.lineTo(.7 * b, 0); P(a); b = a.o; c = ne(0, .5, .3, 0, 0, .3, .3, .3, w.K()); b.A = new L(c.x, c.y); c = ne(.7, 1, 1, .5, .7, .7, 1, .7, c); b.B = new L(c.x, c.y); w.v(c); w.q(a); return b }, IBeamArrow: function (a, b, c) { a = w.s(); M(a, 1 * b, .5 * c, !0); a.lineTo(.7 * b, 1 * c); a.lineTo(.7 * b, .7 * c); a.lineTo(.2 * b, .7 * c); a.lineTo(.2 * b, 1 * c); a.lineTo(0, 1 * c); a.lineTo(0, 0); a.lineTo(.2 * b, 0); a.lineTo(.2 * b, .3 * c); a.lineTo(.7 * b, .3 * c); a.lineTo(.7 * b, 0); P(a); b = a.o; b.A = new L(0, .3); c = ne(.7, 1, 1, .5, .7, .7, 1, .7, w.K()); b.B = new L(c.x, c.y); w.v(c); w.q(a); return b }, Pointer: function (a, b, c) { a = w.s(); M(a, 1 * b, .5 * c, !0); a.lineTo(0, 1 * c); a.lineTo(.2 * b, .5 * c); a.lineTo(0, 0); P(a); b = a.o; b.A = new L(.2, .35); c = ne(.2, .65, 1, .65, 0, 1, 1, .5, w.K()); b.B = new L(c.x, c.y); w.v(c); w.q(a); return b }, RoundedPointer: function (a, b, c) { a = w.s(); M(a, 1 * b, .5 * c, !0); a.lineTo(0, 1 * c); N(a, .5 * b, .75 * c, .5 * b, .25 * c, 0, 0); P(a); b = a.o; b.A = new L(.4, .35); c = ne(.2, .65, 1, .65, 0, 1, 1, .5, w.K()); b.B = new L(c.x, c.y); w.v(c); w.q(a); return b }, SplitEndArrow: function (a, b, c) { a = w.s(); M(a, 1 * b, .5 * c, !0); a.lineTo(.7 * b, 1 * c); a.lineTo(.7 * b, .7 * c); a.lineTo(0, .7 * c); a.lineTo(.2 * b, .5 * c); a.lineTo(0, .3 * c); a.lineTo(.7 * b, .3 * c); a.lineTo(.7 * b, 0); P(a); b = a.o; b.A = new L(.2, .3); c = ne(.7, 1, 1, .5, .7, .7, 1, .7, w.K()); b.B = new L(c.x, c.y); w.v(c); w.q(a); return b }, MessageToUser: "SquareArrow", SquareArrow: function (a, b, c) { a = w.s(); M(a, 1 * b, .5 * c, !0); a.lineTo(.7 * b, 1 * c); a.lineTo(0, 1 * c); a.lineTo(0, 0); a.lineTo(.7 * b, 0); P(a); b = a.o; b.A = xb; b.B = new L(.7, 1); w.q(a); return b }, Cone1: function (a, b, c) { var d = .5 * dd, e = .1 * dd; a = w.s(); M(a, 0, .9 * c, !0); a.lineTo(.5 * b, 0); a.lineTo(1 * b, .9 * c); N(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c); P(a); b = a.o; b.A = new L(.25, .5); b.B = new L(.75, .97); w.q(a); return b }, Cone2: function (a, b, c) { a = w.s(); M(a, 0, .9 * c, !0); N(a, (1 - .85 / .9) * b, 1 * c, .85 / .9 * b, 1 * c, 1 * b, .9 * c); a.lineTo(.5 * b, 0); a.lineTo(0, .9 * c); P(a); M(a, 0, .9 * c, !1); N(a, (1 - .85 / .9) * b, .8 * c, .85 / .9 * b, .8 * c, 1 * b, .9 * c); a.bb(!1); b = a.o; b.A = new L(.25, .5); b.B = new L(.75, .82); w.q(a); return b }, Cube1: function (a, b, c) { a = w.s(); M(a, .5 * b, 1 * c, !0); a.lineTo(1 * b, .85 * c); a.lineTo(1 * b, .15 * c); a.lineTo(.5 * b, 0 * c); a.lineTo(0 * b, .15 * c); a.lineTo(0 * b, .85 * c); P(a); M(a, .5 * b, 1 * c, !1); a.lineTo(.5 * b, .3 * c); a.lineTo(0, .15 * c); a.moveTo(.5 * b, .3 * c); a.lineTo(1 * b, .15 * c); a.bb(!1); b = a.o; b.A = new L(0, .3); b.B = new L(.5, .85); w.q(a); return b }, Cube2: function (a, b, c) { a = w.s(); M(a, 0, .3 * c, !0); a.lineTo(0 * b, 1 * c); a.lineTo(.7 * b, c); a.lineTo(1 * b, .7 * c); a.lineTo(1 * b, 0 * c); a.lineTo(.3 * b, 0 * c); P(a); M(a, 0, .3 * c, !1); a.lineTo(.7 * b, .3 * c); a.lineTo(1 * b, 0 * c); a.moveTo(.7 * b, .3 * c); a.lineTo(.7 * b, 1 * c); a.bb(!1); b = a.o; b.A = new L(0, .3); b.B = new L(.7, 1); w.q(a); return b }, MagneticData: "Cylinder1", Cylinder1: function (a, b, c) { var d = .5 * dd, e = .1 * dd; a = w.s(); M(a, 0, .1 * c, !0); N(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0); N(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c); a.lineTo(b, .9 * c); N(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c); a.lineTo(0, .1 * c); M(a, 0, .1 * c, !1); N(a, 0, (.1 + e) * c, (.5 - d) * b, .2 * c, .5 * b, .2 * c); N(a, (.5 + d) * b, .2 * c, 1 * b, (.1 + e) * c, 1 * b, .1 * c); a.bb(!1); b = a.o; b.A = new L(0, .2); b.B = new L(1, .9); w.q(a); return b }, Cylinder2: function (a, b, c) { var d = .5 * dd, e = .1 * dd; a = w.s(); M(a, 0, .9 * c, !0); a.lineTo(0, .1 * c); N(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0); N(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c); a.lineTo(1 * b, .9 * c); N(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c); M(a, 0, .9 * c, !1); N(a, 0, (.9 - e) * c, (.5 - d) * b, .8 * c, .5 * b, .8 * c); N(a, (.5 + d) * b, .8 * c, 1 * b, (.9 - e) * c, 1 * b, .9 * c); a.bb(!1); b = a.o; b.A = new L(0, .1); b.B = new L(1, .8); w.q(a); return b }, Cylinder3: function (a, b, c) { var d = .1 * dd, e = .5 * dd; a = w.s(); M(a, .1 * b, 0, !0); a.lineTo(.9 * b, 0); N(a, (.9 + d) * b, 0, 1 * b, (.5 - e) * c, 1 * b, .5 * c); N(a, 1 * b, (.5 + e) * c, (.9 + d) * b, 1 * c, .9 * b, 1 * c); a.lineTo(.1 * b, 1 * c); N(a, (.1 - d) * b, 1 * c, 0, (.5 + e) * c, 0, .5 * c); N(a, 0, (.5 - e) * c, (.1 - d) * b, 0, .1 * b, 0); M(a, .1 * b, 0, !1); N(a, (.1 + d) * b, 0, .2 * b, (.5 - e) * c, .2 * b, .5 * c); N(a, .2 * b, (.5 + e) * c, (.1 + d) * b, 1 * c, .1 * b, 1 * c); a.bb(!1); b = a.o; b.A = new L(.2, 0); b.B = new L(.9, 1); w.q(a); return b }, DirectData: "Cylinder4", Cylinder4: function (a, b, c) { var d = .1 * dd, e = .5 * dd; a = w.s(); M(a, .9 * b, 0, !0); N(a, (.9 + d) * b, 0, 1 * b, (.5 - e) * c, 1 * b, .5 * c); N(a, 1 * b, (.5 + e) * c, (.9 + d) * b, 1 * c, .9 * b, 1 * c); a.lineTo(.1 * b, 1 * c); N(a, (.1 - d) * b, 1 * c, 0, (.5 + e) * c, 0, .5 * c); N(a, 0, (.5 - e) * c, (.1 - d) * b, 0, .1 * b, 0); a.lineTo(.9 * b, 0); M(a, .9 * b, 0, !1); N(a, (.9 - d) * b, 0, .8 * b, (.5 - e) * c, .8 * b, .5 * c); N(a, .8 * b, (.5 + e) * c, (.9 - d) * b, 1 * c, .9 * b, 1 * c); a.bb(!1); b = a.o; b.A = new L(.1, 0); b.B = new L(.8, 1); w.q(a); return b }, Prism1: function (a, b, c) { a = w.s(); M(a, .25 * b, .25 * c, !0); a.lineTo(.75 * b, 0); a.lineTo(b, .5 * c); a.lineTo(.5 * b, c); a.lineTo(0, c); P(a); M(a, .25 * b, .25 * c, !1); a.lineTo(.5 * b, c); a.bb(!1); b = a.o; b.A = new L(.408, .172); b.B = new L(.833, .662); w.q(a); return b }, Prism2: function (a, b, c) { a = w.s(); M(a, 0, .25 * c, !0); a.lineTo(.75 * b, 0); a.lineTo(1 * b, .25 * c); a.lineTo(.75 * b, .75 * c); a.lineTo(0, 1 * c); P(a); M(a, 0, c, !1); a.lineTo(.25 * b, .5 * c); a.lineTo(b, .25 * c); a.moveTo(0, .25 * c); a.lineTo(.25 * b, .5 * c); a.bb(!1); b = a.o; b.A = new L(.25, .5); b.B = new L(.75, .75); w.q(a); return b }, Pyramid1: function (a, b, c) { a = w.s(); M(a, .5 * b, 0, !0); a.lineTo(b, .75 * c); a.lineTo(.5 * b, 1 * c); a.lineTo(0, .75 * c); P(a); M(a, .5 * b, 0, !1); a.lineTo(.5 * b, 1 * c); a.bb(!1); b = a.o; b.A = new L(.25, .367); b.B = new L(.75, .875); w.q(a); return b }, Pyramid2: function (a, b, c) { a = w.s(); M(a, .5 * b, 0, !0); a.lineTo(b, .85 * c); a.lineTo(.5 * b, 1 * c); a.lineTo(0, .85 * c); P(a); M(a, .5 * b, 0, !1); a.lineTo(.5 * b, .7 * c); a.lineTo(0, .85 * c); a.moveTo(.5 * b, .7 * c); a.lineTo(1 * b, .85 * c); a.bb(!1); b = a.o; b.A = new L(.25, .367); b.B = new L(.75, .875); w.q(a); return b }, Actor: function (a, b, c) { var d = .2 * dd, e = .1 * dd, f = .5, h = .1; a = w.s(); M(a, f * b, (h + .1) * c, !0); N(a, (f - d) * b, (h + .1) * c, (f - .2) * b, (h + e) * c, (f - .2) * b, h * c); N(a, (f - .2) * b, (h - e) * c, (f - d) * b, (h - .1) * c, f * b, (h - .1) * c); N(a, (f + d) * b, (h - .1) * c, (f + .2) * b, (h - e) * c, (f + .2) * b, h * c); N(a, (f + .2) * b, (h + e) * c, (f + d) * b, (h + .1) * c, f * b, (h + .1) * c); d = .05; e = dd * d; M(a, .5 * b, .2 * c, !0); a.lineTo(.95 * b, .2 * c); f = .95; h = .25; N(a, (f + e) * b, (h - d) * c, (f + d) * b, (h - e) * c, (f + d) * b, h * c); a.lineTo(1 * b, .6 * c); a.lineTo(.85 * b, .6 * c); a.lineTo(.85 * b, .35 * c); d = .025; e = dd * d; f = .825; h = .35; N(a, (f + d) * b, (h - e) * c, (f + e) * b, (h - d) * c, f * b, (h - d) * c); N(a, (f - e) * b, (h - d) * c, (f - d) * b, (h - e) * c, (f - d) * b, h * c); a.lineTo(.8 * b, 1 * c); a.lineTo(.55 * b, 1 * c); a.lineTo(.55 * b, .7 * c); d = .05; e = dd * d; f = .5; h = .7; N(a, (f + d) * b, (h - e) * c, (f + e) * b, (h - d) * c, f * b, (h - d) * c); N(a, (f - e) * b, (h - d) * c, (f - d) * b, (h - e) * c, (f - d) * b, h * c); a.lineTo(.45 * b, 1 * c); a.lineTo(.2 * b, 1 * c); a.lineTo(.2 * b, .35 * c); d = .025; e = dd * d; f = .175; h = .35; N(a, (f + d) * b, (h - e) * c, (f + e) * b, (h - d) * c, f * b, (h - d) * c); N(a, (f - e) * b, (h - d) * c, (f - d) * b, (h - e) * c, (f - d) * b, h * c); a.lineTo(.15 * b, .6 * c); a.lineTo(0 * b, .6 * c); a.lineTo(0 * b, .25 * c); d = .05; e = dd * d; f = .05; h = .25; N(a, (f - d) * b, (h - e) * c, (f - e) * b, (h - d) * c, f * b, (h - d) * c); a.lineTo(.5 * b, .2 * c); b = a.o; b.A = new L(.2, .2); b.B = new L(.8, .65); w.q(a); return b }, Card: function (a, b, c) { a = w.s(); M(a, 1 * b, 0 * c, !0); a.lineTo(1 * b, 1 * c); a.lineTo(0 * b, 1 * c); a.lineTo(0 * b, .2 * c); a.lineTo(.2 * b, 0 * c); P(a); b = a.o; b.A = new L(0, .2); b.B = Nb; w.q(a); return b }, Collate: function (a, b, c) { a = w.s(); M(a, .5 * b, .5 * c, !0); a.lineTo(0, 0); a.lineTo(1 * b, 0); a.lineTo(.5 * b, .5 * c); M(a, .5 * b, .5 * c, !0); a.lineTo(1 * b, 1 * c); a.lineTo(0, 1 * c); a.lineTo(.5 * b, .5 * c); b = a.o; b.A = new L(.25, 0); b.B = new L(.75, .25); w.q(a); return b }, CreateRequest: function (a, b, c) { a = a ? a.Ec : NaN; isNaN(a) && (a = .1); var d = w.s(); M(d, 0, 0, !0); d.lineTo(1 * b, 0); d.lineTo(1 * b, 1 * c); d.lineTo(0, 1 * c); P(d); M(d, 0, a * c, !1); d.lineTo(1 * b, a * c); d.moveTo(0, (1 - a) * c); d.lineTo(1 * b, (1 - a) * c); d.bb(!1); b = d.o; b.A = new L(0, a); b.B = new L(1, 1 - a); w.q(d); return b }, Database: function (a, b, c) { a = w.s(); var d = .5 * dd, e = .1 * dd; M(a, 1 * b, .1 * c, !0); a.lineTo(1 * b, .9 * c); N(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c); a.lineTo(0, .1 * c); N(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0); N(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c); M(a, 1 * b, .1 * c, !1); N(a, 1 * b, (.1 + e) * c, (.5 + d) * b, .2 * c, .5 * b, .2 * c); N(a, (.5 - d) * b, .2 * c, 0, (.1 + e) * c, 0, .1 * c); a.moveTo(1 * b, .2 * c); N(a, 1 * b, (.2 + e) * c, (.5 + d) * b, .3 * c, .5 * b, .3 * c); N(a, (.5 - d) * b, .3 * c, 0, (.2 + e) * c, 0, .2 * c); a.moveTo(1 * b, .3 * c); N(a, 1 * b, (.3 + e) * c, (.5 + d) * b, .4 * c, .5 * b, .4 * c); N(a, (.5 - d) * b, .4 * c, 0, (.3 + e) * c, 0, .3 * c); a.bb(!1); b = a.o; b.A = new L(0, .4); b.B = new L(1, .9); w.q(a); return b }, StoredData: "DataStorage", DataStorage: function (a, b, c) { a = w.s(); M(a, 0, 0, !0); a.lineTo(.75 * b, 0); N(a, 1 * b, 0, 1 * b, 1 * c, .75 * b, 1 * c); a.lineTo(0, 1 * c); N(a, .25 * b, .9 * c, .25 * b, .1 * c, 0, 0); P(a); b = a.o; b.A = new L(.226, 0); b.B = new L(.81, 1); w.q(a); return b }, DiskStorage: function (a, b, c) { a = w.s(); var d = .5 * dd, e = .1 * dd; M(a, 1 * b, .1 * c, !0); a.lineTo(1 * b, .9 * c); N(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c); a.lineTo(0, .1 * c); N(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0); N(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c); M(a, 1 * b, .1 * c, !1); N(a, 1 * b, (.1 + e) * c, (.5 + d) * b, .2 * c, .5 * b, .2 * c); N(a, (.5 - d) * b, .2 * c, 0, (.1 + e) * c, 0, .1 * c); a.moveTo(1 * b, .2 * c); N(a, 1 * b, (.2 + e) * c, (.5 + d) * b, .3 * c, .5 * b, .3 * c); N(a, (.5 - d) * b, .3 * c, 0, (.2 + e) * c, 0, .2 * c); a.bb(!1); b = a.o; b.A = new L(0, .3); b.B = new L(1, .9); w.q(a); return b }, Display: function (a, b, c) { a = w.s(); M(a, .25 * b, 0, !0); a.lineTo(.75 * b, 0); N(a, 1 * b, 0, 1 * b, 1 * c, .75 * b, 1 * c); a.lineTo(.25 * b, 1 * c); a.lineTo(0, .5 * c); P(a); b = a.o; b.A = new L(.25, 0); b.B = new L(.75, 1); w.q(a); return b }, DividedEvent: function (a, b, c) { a = a ? a.Ec : NaN; isNaN(a) ? a = .2 : .15 > a && (a = .15); var d = w.s(), e = .2 * dd; M(d, 0, .2 * c, !0); N(d, 0, (.2 - e) * c, (.2 - e) * b, 0, .2 * b, 0); d.lineTo(.8 * b, 0); N(d, (.8 + e) * b, 0, 1 * b, (.2 - e) * c, 1 * b, .2 * c); d.lineTo(1 * b, .8 * c); N(d, 1 * b, (.8 + e) * c, (.8 + e) * b, 1 * c, .8 * b, 1 * c); d.lineTo(.2 * b, 1 * c); N(d, (.2 - e) * b, 1 * c, 0, (.8 + e) * c, 0, .8 * c); d.lineTo(0, .2 * c); M(d, 0, a * c, !1); d.lineTo(1 * b, a * c); d.bb(!1); b = d.o; b.A = new L(0, a); b.B = new L(1, 1 - a); w.q(d); return b }, DividedProcess: function (a, b, c) { a = a ? a.Ec : NaN; if (isNaN(a) || .1 > a) a = .1; var d = w.s(); M(d, 0, 0, !0); d.lineTo(1 * b, 0); d.lineTo(1 * b, 1 * c); d.lineTo(0, 1 * c); P(d); M(d, 0, a * c, !1); d.lineTo(1 * b, a * c); d.bb(!1); b = d.o; b.A = new L(0, a); b.B = Nb; w.q(d); return b }, Document: function (a, b, c) { c /= .8; a = w.s(); M(a, 0, .7 * c, !0); a.lineTo(0, 0); a.lineTo(1 * b, 0); a.lineTo(1 * b, .7 * c); N(a, .5 * b, .4 * c, .5 * b, 1 * c, 0, .7 * c); P(a); b = a.o; b.A = xb; b.B = new L(1, .6); w.q(a); return b }, ExternalOrganization: function (a, b, c) { a = a ? a.Ec : NaN; if (isNaN(a) || .2 > a) a = .2; var d = w.s(); M(d, 0, 0, !0); d.lineTo(1 * b, 0); d.lineTo(1 * b, 1 * c); d.lineTo(0, 1 * c); P(d); M(d, a * b, 0, !1); d.lineTo(0, a * c); d.moveTo(1 * b, a * c); d.lineTo((1 - a) * b, 0); d.moveTo(0, (1 - a) * c); d.lineTo(a * b, 1 * c); d.moveTo((1 - a) * b, 1 * c); d.lineTo(1 * b, (1 - a) * c); d.bb(!1); b = d.o; b.A = new L(a / 2, a / 2); b.B = new L(1 - a / 2, 1 - a / 2); w.q(d); return b }, ExternalProcess: function (a, b, c) { a = w.s(); M(a, .5 * b, 0, !0); a.lineTo(1 * b, .5 * c); a.lineTo(.5 * b, 1 * c); a.lineTo(0, .5 * c); P(a); M(a, .1 * b, .4 * c, !1); a.lineTo(.1 * b, .6 * c); a.moveTo(.9 * b, .6 * c); a.lineTo(.9 * b, .4 * c); a.moveTo(.6 * b, .1 * c); a.lineTo(.4 * b, .1 * c); a.moveTo(.4 * b, .9 * c); a.lineTo(.6 * b, .9 * c); a.bb(!1); b = a.o; b.A = new L(.25, .25); b.B = new L(.75, .75); w.q(a); return b }, File: function (a, b, c) { a = w.s(); M(a, 0, 0, !0); a.lineTo(.75 * b, 0); a.lineTo(1 * b, .25 * c); a.lineTo(1 * b, 1 * c); a.lineTo(0, 1 * c); P(a); M(a, .75 * b, 0, !1); a.lineTo(.75 * b, .25 * c); a.lineTo(1 * b, .25 * c); a.bb(!1); b = a.o; b.A = new L(0, .25); b.B = Nb; w.q(a); return b }, Interrupt: function (a, b, c) { a = w.s(); M(a, 1 * b, .5 * c, !0); a.lineTo(0, 1 * c); a.lineTo(0, 0); a.lineTo(1 * b, .5 * c); M(a, 1 * b, .5 * c, !1); a.lineTo(1 * b, 1 * c); M(a, 1 * b, .5 * c, !1); a.lineTo(1 * b, 0); b = a.o; b.A = new L(0, .25); b.B = new L(.5, .75); w.q(a); return b }, InternalStorage: function (a, b, c) { var d = a ? a.Ec : NaN; a = a ? a.yu : NaN; isNaN(d) && (d = .1); isNaN(a) && (a = .1); var e = w.s(); M(e, 0, 0, !0); e.lineTo(1 * b, 0); e.lineTo(1 * b, 1 * c); e.lineTo(0, 1 * c); P(e); M(e, d * b, 0, !1); e.lineTo(d * b, 1 * c); e.moveTo(0, a * c); e.lineTo(1 * b, a * c); e.bb(!1); b = e.o; b.A = new L(d, a); b.B = Nb; w.q(e); return b }, Junction: function (a, b, c) { a = w.s(); var d = 1 / Math.SQRT2, e = (1 - 1 / Math.SQRT2) / 2, f = .5 * dd; M(a, 1 * b, .5 * c, !0); N(a, 1 * b, (.5 + f) * c, (.5 + f) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - f) * b, 1 * c, 0, (.5 + f) * c, 0, .5 * c); N(a, 0, (.5 - f) * c, (.5 - f) * b, 0, .5 * b, 0); N(a, (.5 + f) * b, 0, 1 * b, (.5 - f) * c, 1 * b, .5 * c); M(a, (e + d) * b, (e + d) * c, !1); a.lineTo(e * b, e * c); a.moveTo(e * b, (e + d) * c); a.lineTo((e + d) * b, e * c); a.bb(!1); b = a.o; b.be = Qj; w.q(a); return b }, LinedDocument: function (a, b, c) { c /= .8; a = w.s(); M(a, 0, .7 * c, !0); a.lineTo(0, 0); a.lineTo(1 * b, 0); a.lineTo(1 * b, .7 * c); N(a, .5 * b, .4 * c, .5 * b, 1 * c, 0, .7 * c); P(a); M(a, .1 * b, 0, !1); a.lineTo(.1 * b, .75 * c); a.bb(!1); b = a.o; b.A = new L(.1, 0); b.B = new L(1, .6); w.q(a); return b }, LoopLimit: function (a, b, c) { a = w.s(); M(a, 0, 1 * c, !0); a.lineTo(0, .25 * c); a.lineTo(.25 * b, 0); a.lineTo(.75 * b, 0); a.lineTo(1 * b, .25 * c); a.lineTo(1 * b, 1 * c); P(a); b = a.o; b.A = new L(0, .25); b.B = Nb; w.q(a); return b }, SequentialData: "MagneticTape", MagneticTape: function (a, b, c) { a = w.s(); var d = .5 * dd; M(a, .5 * b, 1 * c, !0); N(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c); N(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0); N(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c); N(a, 1 * b, (.5 + d) * c, (.5 + d) * b, .9 * c, .6 * b, .9 * c); a.lineTo(1 * b, .9 * c); a.lineTo(1 * b, 1 * c); a.lineTo(.5 * b, 1 * c); b = a.o; b.A = new L(.15, .15); b.B = new L(.85, .8); w.q(a); return b }, ManualInput: function (a, b, c) { a = w.s(); M(a, 1 * b, 0, !0); a.lineTo(1 * b, 1 * c); a.lineTo(0, 1 * c); a.lineTo(0, .25 * c); P(a); b = a.o; b.A = new L(0, .25); b.B = Nb; w.q(a); return b }, MessageFromUser: function (a, b, c) { a = a ? a.Ec : NaN; isNaN(a) && (a = .7); var d = w.s(); M(d, 0, 0, !0); d.lineTo(1 * b, 0); d.lineTo(a * b, .5 * c); d.lineTo(1 * b, 1 * c); d.lineTo(0, 1 * c); P(d); b = d.o; b.A = xb; b.B = new L(a, 1); w.q(d); return b }, MicroformProcessing: function (a, b, c) { a = a ? a.Ec : NaN; isNaN(a) && (a = .25); var d = w.s(); M(d, 0, 0, !0); d.lineTo(.5 * b, a * c); d.lineTo(1 * b, 0); d.lineTo(1 * b, 1 * c); d.lineTo(.5 * b, (1 - a) * c); d.lineTo(0, 1 * c); P(d); b = d.o; b.A = new L(0, a); b.B = new L(1, 1 - a); w.q(d); return b }, MicroformRecording: function (a, b, c) { a = w.s(); M(a, 0, 0, !0); a.lineTo(.75 * b, .25 * c); a.lineTo(1 * b, .15 * c); a.lineTo(1 * b, .85 * c); a.lineTo(.75 * b, .75 * c); a.lineTo(0, 1 * c); P(a); b = a.o; b.A = new L(0, .25); b.B = new L(1, .75); w.q(a); return b }, MultiDocument: function (a, b, c) { c /= .8; a = w.s(); M(a, b, 0, !0); a.lineTo(b, .5 * c); N(a, .96 * b, .47 * c, .93 * b, .45 * c, .9 * b, .44 * c); a.lineTo(.9 * b, .6 * c); N(a, .86 * b, .57 * c, .83 * b, .55 * c, .8 * b, .54 * c); a.lineTo(.8 * b, .7 * c); N(a, .4 * b, .4 * c, .4 * b, 1 * c, 0, .7 * c); a.lineTo(0, .2 * c); a.lineTo(.1 * b, .2 * c); a.lineTo(.1 * b, .1 * c); a.lineTo(.2 * b, .1 * c); a.lineTo(.2 * b, 0); P(a); M(a, .1 * b, .2 * c, !1); a.lineTo(.8 * b, .2 * c); a.lineTo(.8 * b, .54 * c); a.moveTo(.2 * b, .1 * c); a.lineTo(.9 * b, .1 * c); a.lineTo(.9 * b, .44 * c); a.bb(!1); b = a.o; b.A = new L(0, .25); b.B = new L(.8, .77); w.q(a); return b }, MultiProcess: function (a, b, c) { a = w.s(); M(a, .1 * b, .1 * c, !0); a.lineTo(.2 * b, .1 * c); a.lineTo(.2 * b, 0); a.lineTo(1 * b, 0); a.lineTo(1 * b, .8 * c); a.lineTo(.9 * b, .8 * c); a.lineTo(.9 * b, .9 * c); a.lineTo(.8 * b, .9 * c); a.lineTo(.8 * b, 1 * c); a.lineTo(0, 1 * c); a.lineTo(0, .2 * c); a.lineTo(.1 * b, .2 * c); P(a); M(a, .2 * b, .1 * c, !1); a.lineTo(.9 * b, .1 * c); a.lineTo(.9 * b, .8 * c); a.moveTo(.1 * b, .2 * c); a.lineTo(.8 * b, .2 * c); a.lineTo(.8 * b, .9 * c); a.bb(!1); b = a.o; b.A = new L(0, .2); b.B = new L(.8, 1); w.q(a); return b }, OfflineStorage: function (a, b, c) { a = a ? a.Ec : NaN; isNaN(a) && (a = .1); var d = 1 - a, e = w.s(); M(e, 0, 0, !0); e.lineTo(1 * b, 0); e.lineTo(.5 * b, 1 * c); P(e); M(e, .5 * a * b, a * c, !1); e.lineTo((1 - .5 * a) * b, a * c); e.bb(!1); b = e.o; b.A = new L(d / 4 + .5 * a, a); b.B = new L(3 * d / 4 + .5 * a, a + .5 * d); w.q(e); return b }, OffPageConnector: function (a, b, c) { a = w.s(); M(a, 0, 0, !0); a.lineTo(.75 * b, 0); a.lineTo(1 * b, .5 * c); a.lineTo(.75 * b, 1 * c); a.lineTo(0, 1 * c); P(a); b = a.o; b.A = xb; b.B = new L(.75, 1); w.q(a); return b }, Or: function (a, b, c) { a = w.s(); var d = .5 * dd; M(a, 1 * b, .5 * c, !0); N(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c); N(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0); N(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c); M(a, 1 * b, .5 * c, !1); a.lineTo(0, .5 * c); a.moveTo(.5 * b, 1 * c); a.lineTo(.5 * b, 0); a.bb(!1); b = a.o; b.be = Qj; w.q(a); return b }, PaperTape: function (a, b, c) { c /= .8; a = w.s(); M(a, 0, .7 * c, !0); a.lineTo(0, .3 * c); N(a, .5 * b, .6 * c, .5 * b, 0, 1 * b, .3 * c); a.lineTo(1 * b, .7 * c); N(a, .5 * b, .4 * c, .5 * b, 1 * c, 0, .7 * c); P(a); b = a.o; b.A = new L(0, .49); b.B = new L(1, .75); w.q(a); return b }, PrimitiveFromCall: function (a, b, c) { var d = a ? a.Ec : NaN; a = a ? a.yu : NaN; isNaN(d) && (d = .1); isNaN(a) && (a = .3); var e = w.s(); M(e, 0, 0, !0); e.lineTo(1 * b, 0); e.lineTo((1 - a) * b, .5 * c); e.lineTo(1 * b, 1 * c); e.lineTo(0, 1 * c); P(e); b = e.o; b.A = new L(d, 0); b.B = new L(1 - a, 1); w.q(e); return b }, PrimitiveToCall: function (a, b, c) { var d = a ? a.Ec : NaN; a = a ? a.yu : NaN; isNaN(d) && (d = .1); isNaN(a) && (a = .3); var e = w.s(); M(e, 0, 0, !0); e.lineTo((1 - a) * b, 0); e.lineTo(1 * b, .5 * c); e.lineTo((1 - a) * b, 1 * c); e.lineTo(0, 1 * c); P(e); b = e.o; b.A = new L(d, 0); b.B = new L(1 - a, 1); w.q(e); return b }, Subroutine: "Procedure", Procedure: function (a, b, c) { a = a ? a.Ec : NaN; isNaN(a) && (a = .1); var d = w.s(); M(d, 0, 0, !0); d.lineTo(1 * b, 0); d.lineTo(1 * b, 1 * c); d.lineTo(0, 1 * c); P(d); M(d, (1 - a) * b, 0, !1); d.lineTo((1 - a) * b, 1 * c); d.moveTo(a * b, 0); d.lineTo(a * b, 1 * c); d.bb(!1); b = d.o; b.A = new L(a, 0); b.B = new L(1 - a, 1); w.q(d); return b }, Process: function (a, b, c) { a = a ? a.Ec : NaN; isNaN(a) && (a = .1); var d = w.s(); M(d, 0, 0, !0); d.lineTo(1 * b, 0); d.lineTo(1 * b, 1 * c); d.lineTo(0, 1 * c); P(d); M(d, a * b, 0, !1); d.lineTo(a * b, 1 * c); d.bb(!1); b = d.o; b.A = new L(a, 0); b.B = Nb; w.q(d); return b }, Sort: function (a, b, c) { a = w.s(); M(a, .5 * b, 0, !0); a.lineTo(1 * b, .5 * c); a.lineTo(.5 * b, 1 * c); a.lineTo(0, .5 * c); P(a); M(a, 0, .5 * c, !1); a.lineTo(1 * b, .5 * c); a.bb(!1); b = a.o; b.A = new L(.25, .25); b.B = new L(.75, .5); w.q(a); return b }, Start: function (a, b, c) { a = w.s(); M(a, .25 * b, 0, !0); M(a, .25 * b, 0, !0); a.arcTo(270, 180, .75 * b, .5 * c, .25 * b, .5 * c); a.arcTo(90, 180, .25 * b, .5 * c, .25 * b, .5 * c); M(a, .25 * b, 0, !1); a.lineTo(.25 * b, 1 * c); a.moveTo(.75 * b, 0); a.lineTo(.75 * b, 1 * c); a.bb(!1); b = a.o; b.A = new L(.25, 0); b.B = new L(.75, 1); w.q(a); return b }, Terminator: function (a, b, c) { a = w.s(); M(a, .25 * b, 0, !0); a.arcTo(270, 180, .75 * b, .5 * c, .25 * b, .5 * c); a.arcTo(90, 180, .25 * b, .5 * c, .25 * b, .5 * c); b = a.o; b.A = new L(.23, 0); b.B = new L(.77, 1); w.q(a); return b }, TransmittalTape: function (a, b, c) { a = a ? a.Ec : NaN; isNaN(a) && (a = .1); var d = w.s(); M(d, 0, 0, !0); d.lineTo(1 * b, 0); d.lineTo(1 * b, 1 * c); d.lineTo(.75 * b, (1 - a) * c); d.lineTo(0, (1 - a) * c); P(d); b = d.o; b.A = xb; b.B = new L(1, 1 - a); w.q(d); return b }, AndGate: function (a, b, c) { a = w.s(); var d = .5 * dd; M(a, 0, 0, !0); a.lineTo(.5 * b, 0); N(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c); N(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); a.lineTo(0, 1 * c); P(a); b = a.o; b.A = xb; b.B = new L(.55, 1); w.q(a); return b }, Buffer: function (a, b, c) { a = w.s(); M(a, 0, 0, !0); a.lineTo(1 * b, .5 * c); a.lineTo(0, 1 * c); P(a); b = a.o; b.A = new L(0, .25); b.B = new L(.5, .75); w.q(a); return b }, Clock: function (a, b, c) { a = w.s(); var d = .5 * dd; M(a, 1 * b, .5 * c, !0); N(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c); N(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0); N(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c); M(a, 1 * b, .5 * c, !1); a.lineTo(1 * b, .5 * c); M(a, .8 * b, .75 * c, !1); a.lineTo(.8 * b, .25 * c); a.lineTo(.6 * b, .25 * c); a.lineTo(.6 * b, .75 * c); a.lineTo(.4 * b, .75 * c); a.lineTo(.4 * b, .25 * c); a.lineTo(.2 * b, .25 * c); a.lineTo(.2 * b, .75 * c); a.bb(!1); b = a.o; b.be = Qj; w.q(a); return b }, Ground: function (a, b, c) { a = w.s(); M(a, .5 * b, 0, !1); a.lineTo(.5 * b, .4 * c); a.moveTo(.2 * b, .6 * c); a.lineTo(.8 * b, .6 * c); a.moveTo(.3 * b, .8 * c); a.lineTo(.7 * b, .8 * c); a.moveTo(.4 * b, 1 * c); a.lineTo(.6 * b, 1 * c); b = a.o; w.q(a); return b }, Inverter: function (a, b, c) { a = w.s(); var d = .1 * dd; M(a, .8 * b, .5 * c, !0); a.lineTo(0, 1 * c); a.lineTo(0, 0); a.lineTo(.8 * b, .5 * c); M(a, 1 * b, .5 * c, !0); N(a, 1 * b, (.5 + d) * c, (.9 + d) * b, .6 * c, .9 * b, .6 * c); N(a, (.9 - d) * b, .6 * c, .8 * b, (.5 + d) * c, .8 * b, .5 * c); N(a, .8 * b, (.5 - d) * c, (.9 - d) * b, .4 * c, .9 * b, .4 * c); N(a, (.9 + d) * b, .4 * c, 1 * b, (.5 - d) * c, 1 * b, .5 * c); b = a.o; b.A = new L(0, .25); b.B = new L(.4, .75); w.q(a); return b }, NandGate: function (a, b, c) { a = w.s(); var d = .5 * dd, e = .4 * dd, f = .1 * dd; M(a, .8 * b, .5 * c, !0); N(a, .8 * b, (.5 + e) * c, (.4 + d) * b, 1 * c, .4 * b, 1 * c); a.lineTo(0, 1 * c); a.lineTo(0, 0); a.lineTo(.4 * b, 0); N(a, (.4 + d) * b, 0, .8 * b, (.5 - e) * c, .8 * b, .5 * c); M(a, 1 * b, .5 * c, !0); N(a, 1 * b, (.5 + f) * c, (.9 + f) * b, .6 * c, .9 * b, .6 * c); N(a, (.9 - f) * b, .6 * c, .8 * b, (.5 + f) * c, .8 * b, .5 * c); N(a, .8 * b, (.5 - f) * c, (.9 - f) * b, .4 * c, .9 * b, .4 * c); N(a, (.9 + f) * b, .4 * c, 1 * b, (.5 - f) * c, 1 * b, .5 * c); b = a.o; b.A = new L(0, .05); b.B = new L(.55, .95); w.q(a); return b }, NorGate: function (a, b, c) { a = w.s(); var d = .5, e = dd * d, f = 0, h = .5; M(a, .8 * b, .5 * c, !0); N(a, .7 * b, (h + e) * c, (f + e) * b, (h + d) * c, 0, 1 * c); N(a, .25 * b, .75 * c, .25 * b, .25 * c, 0, 0); N(a, (f + e) * b, (h - d) * c, .7 * b, (h - e) * c, .8 * b, .5 * c); d = .1; e = .1 * dd; f = .9; h = .5; M(a, (f - d) * b, h * c, !0); N(a, (f - d) * b, (h - e) * c, (f - e) * b, (h - d) * c, f * b, (h - d) * c); N(a, (f + e) * b, (h - d) * c, (f + d) * b, (h - e) * c, (f + d) * b, h * c); N(a, (f + d) * b, (h + e) * c, (f + e) * b, (h + d) * c, f * b, (h + d) * c); N(a, (f - e) * b, (h + d) * c, (f - d) * b, (h + e) * c, (f - d) * b, h * c); b = a.o; b.A = new L(.2, .25); b.B = new L(.6, .75); w.q(a); return b }, OrGate: function (a, b, c) { a = w.s(); var d = .5 * dd; M(a, 0, 0, !0); N(a, (0 + d + d) * b, 0 * c, .8 * b, (.5 - d) * c, 1 * b, .5 * c); N(a, .8 * b, (.5 + d) * c, (0 + d + d) * b, 1 * c, 0, 1 * c); N(a, .25 * b, .75 * c, .25 * b, .25 * c, 0, 0); P(a); b = a.o; b.A = new L(.2, .25); b.B = new L(.75, .75); w.q(a); return b }, XnorGate: function (a, b, c) { a = w.s(); var d = .5, e = dd * d, f = .2, h = .5; M(a, .1 * b, 0, !1); N(a, .35 * b, .25 * c, .35 * b, .75 * c, .1 * b, 1 * c); M(a, .8 * b, .5 * c, !0); N(a, .7 * b, (h + e) * c, (f + e) * b, (h + d) * c, .2 * b, 1 * c); N(a, .45 * b, .75 * c, .45 * b, .25 * c, .2 * b, 0); N(a, (f + e) * b, (h - d) * c, .7 * b, (h - e) * c, .8 * b, .5 * c); d = .1; e = .1 * dd; f = .9; h = .5; M(a, (f - d) * b, h * c, !0); N(a, (f - d) * b, (h - e) * c, (f - e) * b, (h - d) * c, f * b, (h - d) * c); N(a, (f + e) * b, (h - d) * c, (f + d) * b, (h - e) * c, (f + d) * b, h * c); N(a, (f + d) * b, (h + e) * c, (f + e) * b, (h + d) * c, f * b, (h + d) * c); N(a, (f - e) * b, (h + d) * c, (f - d) * b, (h + e) * c, (f - d) * b, h * c); b = a.o; b.A = new L(.4, .25); b.B = new L(.65, .75); w.q(a); return b }, XorGate: function (a, b, c) { a = w.s(); var d = .5 * dd; M(a, .1 * b, 0, !1); N(a, .35 * b, .25 * c, .35 * b, .75 * c, .1 * b, 1 * c); M(a, .2 * b, 0, !0); N(a, (.2 + d) * b, 0 * c, .9 * b, (.5 - d) * c, 1 * b, .5 * c); N(a, .9 * b, (.5 + d) * c, (.2 + d) * b, 1 * c, .2 * b, 1 * c); N(a, .45 * b, .75 * c, .45 * b, .25 * c, .2 * b, 0); P(a); b = a.o; b.A = new L(.4, .25); b.B = new L(.8, .75); w.q(a); return b }, Capacitor: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); a.lineTo(0, 1 * c); a.moveTo(1 * b, 0); a.lineTo(1 * b, 1 * c); b = a.o; w.q(a); return b }, Resistor: function (a, b, c) { a = w.s(); M(a, 0, .5 * c, !1); a.lineTo(.1 * b, 0); a.lineTo(.2 * b, 1 * c); a.lineTo(.3 * b, 0); a.lineTo(.4 * b, 1 * c); a.lineTo(.5 * b, 0); a.lineTo(.6 * b, 1 * c); a.lineTo(.7 * b, .5 * c); b = a.o; w.q(a); return b }, Inductor: function (a, b, c) { a = w.s(); var d = .1 * dd, e = .1; M(a, (e - .5 * d) * b, c, !1); N(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0); e = .3; N(a, (e + .1) * b, 0, (e + d) * b, c, e * b, c); N(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0); e = .5; N(a, (e + .1) * b, 0, (e + d) * b, c, e * b, c); N(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0); e = .7; N(a, (e + .1) * b, 0, (e + d) * b, c, e * b, c); N(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0); e = .9; N(a, (e + .1) * b, 0, (e + d) * b, c, (e + .5 * d) * b, c); b = a.o; w.q(a); return b }, ACvoltageSource: function (a, b, c) { a = w.s(); var d = .5 * dd; M(a, 0 * b, .5 * c, !1); N(a, 0 * b, (.5 - d) * c, (.5 - d) * b, 0 * c, .5 * b, 0 * c); N(a, (.5 + d) * b, 0 * c, 1 * b, (.5 - d) * c, 1 * b, .5 * c); N(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - d) * b, 1 * c, 0 * b, (.5 + d) * c, 0 * b, .5 * c); a.moveTo(.1 * b, .5 * c); N(a, .5 * b, 0 * c, .5 * b, 1 * c, .9 * b, .5 * c); b = a.o; b.be = Qj; w.q(a); return b }, DCvoltageSource: function (a, b, c) { a = w.s(); M(a, 0, .75 * c, !1); a.lineTo(0, .25 * c); a.moveTo(1 * b, 0); a.lineTo(1 * b, 1 * c); b = a.o; w.q(a); return b }, Diode: function (a, b, c) { a = w.s(); M(a, 1 * b, 0, !1); a.lineTo(1 * b, .5 * c); a.lineTo(0, 1 * c); a.lineTo(0, 0); a.lineTo(1 * b, .5 * c); a.lineTo(1 * b, 1 * c); b = a.o; b.A = new L(0, .25); b.B = new L(.5, .75); w.q(a); return b }, Wifi: function (a, b, c) { var d = b, e = c; b *= .38; c *= .6; a = w.s(); var f = .8 * dd, h = .8, k = 0, l = .5, d = (d - b) / 2, e = (e - c) / 2; M(a, k * b + d, (l + h) * c + e, !0); N(a, (k - f) * b + d, (l + h) * c + e, (k - h) * b + d, (l + f) * c + e, (k - h) * b + d, l * c + e); N(a, (k - h) * b + d, (l - f) * c + e, (k - f) * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e); N(a, k * b + d, (l - h) * c + e, (k - h + .5 * f) * b + d, (l - f) * c + e, (k - h + .5 * f) * b + d, l * c + e); N(a, (k - h + .5 * f) * b + d, (l + f) * c + e, k * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e); P(a); f = .4 * dd; h = .4; k = .2; l = .5; M(a, k * b + d, (l + h) * c + e, !0); N(a, (k - f) * b + d, (l + h) * c + e, (k - h) * b + d, (l + f) * c + e, (k - h) * b + d, l * c + e); N(a, (k - h) * b + d, (l - f) * c + e, (k - f) * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e); N(a, k * b + d, (l - h) * c + e, (k - h + .5 * f) * b + d, (l - f) * c + e, (k - h + .5 * f) * b + d, l * c + e); N(a, (k - h + .5 * f) * b + d, (l + f) * c + e, k * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e); P(a); f = .2 * dd; h = .2; l = k = .5; M(a, (k - h) * b + d, l * c + e, !0); N(a, (k - h) * b + d, (l - f) * c + e, (k - f) * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e); N(a, (k + f) * b + d, (l - h) * c + e, (k + h) * b + d, (l - f) * c + e, (k + h) * b + d, l * c + e); N(a, (k + h) * b + d, (l + f) * c + e, (k + f) * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e); N(a, (k - f) * b + d, (l + h) * c + e, (k - h) * b + d, (l + f) * c + e, (k - h) * b + d, l * c + e); f = .4 * dd; h = .4; k = .8; l = .5; M(a, k * b + d, (l - h) * c + e, !0); N(a, (k + f) * b + d, (l - h) * c + e, (k + h) * b + d, (l - f) * c + e, (k + h) * b + d, l * c + e); N(a, (k + h) * b + d, (l + f) * c + e, (k + f) * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e); N(a, k * b + d, (l + h) * c + e, (k + h - .5 * f) * b + d, (l + f) * c + e, (k + h - .5 * f) * b + d, l * c + e); N(a, (k + h - .5 * f) * b + d, (l - f) * c + e, k * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e); P(a); f = .8 * dd; h = .8; k = 1; l = .5; M(a, k * b + d, (l - h) * c + e, !0); N(a, (k + f) * b + d, (l - h) * c + e, (k + h) * b + d, (l - f) * c + e, (k + h) * b + d, l * c + e); N(a, (k + h) * b + d, (l + f) * c + e, (k + f) * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e); N(a, k * b + d, (l + h) * c + e, (k + h - .5 * f) * b + d, (l + f) * c + e, (k + h - .5 * f) * b + d, l * c + e); N(a, (k + h - .5 * f) * b + d, (l - f) * c + e, k * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e); P(a); b = a.o; w.q(a); return b }, Email: function (a, b, c) { a = w.s(); M(a, 0, 0, !0); a.lineTo(1 * b, 0); a.lineTo(1 * b, 1 * c); a.lineTo(0, 1 * c); a.lineTo(0, 0); P(a); M(a, 0, 0, !1); a.lineTo(.5 * b, .6 * c); a.lineTo(1 * b, 0); a.moveTo(0, 1 * c); a.lineTo(.45 * b, .54 * c); a.moveTo(1 * b, 1 * c); a.lineTo(.55 * b, .54 * c); a.bb(!1); b = a.o; w.q(a); return b }, Ethernet: function (a, b, c) { a = w.s(); M(a, .35 * b, 0, !0); a.lineTo(.65 * b, 0); a.lineTo(.65 * b, .4 * c); a.lineTo(.35 * b, .4 * c); a.lineTo(.35 * b, 0); P(a); M(a, .1 * b, 1 * c, !0, !0); a.lineTo(.4 * b, 1 * c); a.lineTo(.4 * b, .6 * c); a.lineTo(.1 * b, .6 * c); a.lineTo(.1 * b, 1 * c); P(a); M(a, .6 * b, 1 * c, !0, !0); a.lineTo(.9 * b, 1 * c); a.lineTo(.9 * b, .6 * c); a.lineTo(.6 * b, .6 * c); a.lineTo(.6 * b, 1 * c); P(a); M(a, 0, .5 * c, !1); a.lineTo(1 * b, .5 * c); a.moveTo(.5 * b, .5 * c); a.lineTo(.5 * b, .4 * c); a.moveTo(.75 * b, .5 * c); a.lineTo(.75 * b, .6 * c); a.moveTo(.25 * b, .5 * c); a.lineTo(.25 * b, .6 * c); a.bb(!1); b = a.o; w.q(a); return b }, Power: function (a, b, c) { a = w.s(); var d = .4 * dd, e = .4, f = w.K(), h = w.K(), k = w.K(), l = w.K(); fe(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .5, f, f, h, k, l); var m = w.xb(h.x, h.y); M(a, h.x * b, h.y * c, !0); N(a, k.x * b, k.y * c, l.x * b, l.y * c, (.5 + e) * b, .5 * c); N(a, (.5 + e) * b, (.5 + d) * c, (.5 + d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c); N(a, (.5 - d) * b, (.5 + e) * c, (.5 - e) * b, (.5 + d) * c, (.5 - e) * b, .5 * c); fe(.5 - e, .5, .5 - e, .5 - d, .5 - d, .5 - e, .5, .5 - e, .5, k, l, h, f, f); N(a, k.x * b, k.y * c, l.x * b, l.y * c, h.x * b, h.y * c); d = .3 * dd; e = .3; fe(.5 - e, .5, .5 - e, .5 - d, .5 - d, .5 - e, .5, .5 - e, .5, k, l, h, f, f); a.lineTo(h.x * b, h.y * c); N(a, l.x * b, l.y * c, k.x * b, k.y * c, (.5 - e) * b, .5 * c); N(a, (.5 - e) * b, (.5 + d) * c, (.5 - d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c); N(a, (.5 + d) * b, (.5 + e) * c, (.5 + e) * b, (.5 + d) * c, (.5 + e) * b, .5 * c); fe(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .5, f, f, h, k, l); N(a, l.x * b, l.y * c, k.x * b, k.y * c, h.x * b, h.y * c); P(a); M(a, .45 * b, 0, !0); a.lineTo(.45 * b, .5 * c); a.lineTo(.55 * b, .5 * c); a.lineTo(.55 * b, 0); P(a); w.v(f); w.v(h); w.v(k); w.v(l); w.v(m); b = a.o; b.A = new L(.25, .55); b.B = new L(.75, .8); w.q(a); return b }, Fallout: function (a, b, c) { a = w.s(); var d = .5 * dd; M(a, 0 * b, .5 * c, !0); N(a, 0 * b, (.5 - d) * c, (.5 - d) * b, 0 * c, .5 * b, 0 * c); N(a, (.5 + d) * b, 0 * c, 1 * b, (.5 - d) * c, 1 * b, .5 * c); N(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - d) * b, 1 * c, 0 * b, (.5 + d) * c, 0 * b, .5 * c); var e = d = 0; M(a, (.3 + d) * b, (.8 + e) * c, !0, !0); a.lineTo((.5 + d) * b, (.5 + e) * c); a.lineTo((.1 + d) * b, (.5 + e) * c); a.lineTo((.3 + d) * b, (.8 + e) * c); d = .4; e = 0; P(a); M(a, (.3 + d) * b, (.8 + e) * c, !0, !0); a.lineTo((.5 + d) * b, (.5 + e) * c); a.lineTo((.1 + d) * b, (.5 + e) * c); a.lineTo((.3 + d) * b, (.8 + e) * c); d = .2; e = -.3; P(a); M(a, (.3 + d) * b, (.8 + e) * c, !0, !0); a.lineTo((.5 + d) * b, (.5 + e) * c); a.lineTo((.1 + d) * b, (.5 + e) * c); a.lineTo((.3 + d) * b, (.8 + e) * c); P(a); b = a.o; b.be = Qj; w.q(a); return b }, IrritationHazard: function (a, b, c) { a = w.s(); M(a, .2 * b, 0 * c, !0); a.lineTo(.5 * b, .3 * c); a.lineTo(.8 * b, 0 * c); a.lineTo(1 * b, .2 * c); a.lineTo(.7 * b, .5 * c); a.lineTo(1 * b, .8 * c); a.lineTo(.8 * b, 1 * c); a.lineTo(.5 * b, .7 * c); a.lineTo(.2 * b, 1 * c); a.lineTo(0 * b, .8 * c); a.lineTo(.3 * b, .5 * c); a.lineTo(0 * b, .2 * c); P(a); b = a.o; b.A = new L(.3, .3); b.B = new L(.7, .7); w.q(a); return b }, ElectricalHazard: function (a, b, c) { a = w.s(); M(a, .37 * b, 0 * c, !0); a.lineTo(.5 * b, .11 * c); a.lineTo(.77 * b, .04 * c); a.lineTo(.33 * b, .49 * c); a.lineTo(1 * b, .37 * c); a.lineTo(.63 * b, .86 * c); a.lineTo(.77 * b, .91 * c); a.lineTo(.34 * b, 1 * c); a.lineTo(.34 * b, .78 * c); a.lineTo(.44 * b, .8 * c); a.lineTo(.65 * b, .56 * c); a.lineTo(0 * b, .68 * c); P(a); b = a.o; w.q(a); return b }, FireHazard: function (a, b, c) { a = w.s(); M(a, .1 * b, 1 * c, !0); N(a, -.25 * b, .63 * c, .45 * b, .44 * c, .29 * b, 0 * c); N(a, .48 * b, .17 * c, .54 * b, .35 * c, .51 * b, .42 * c); N(a, .59 * b, .29 * c, .58 * b, .28 * c, .59 * b, .18 * c); N(a, .8 * b, .34 * c, .88 * b, .43 * c, .75 * b, .6 * c); N(a, .87 * b, .48 * c, .88 * b, .43 * c, .88 * b, .31 * c); N(a, 1.17 * b, .76 * c, .82 * b, .8 * c, .9 * b, 1 * c); P(a); b = a.o; b.A = new L(.05, .645); b.B = new L(.884, .908); w.q(a); return b }, BpmnActivityLoop: function (a, b, c) { a = w.s(); var d = 4 * (Math.SQRT2 - 1) / 3 * .5; M(a, .65 * b, 1 * c, !1); N(a, (1 - d + 0) * b, 1 * c, 1 * b, (.5 + d + 0) * c, 1 * b, .5 * c); N(a, 1 * b, (.5 - d + 0) * c, (.5 + d + 0) * b, 0 * c, .5 * b, 0 * c); N(a, (.5 - d + 0) * b, 0 * c, 0 * b, (.5 - d + 0) * c, 0 * b, .5 * c); N(a, 0 * b, (.5 + d + 0) * c, (.5 - d + 0) * b, 1 * c, .35 * b, .98 * c); a.moveTo(.25 * b, .8 * c); a.lineTo(.35 * b, 1 * c); a.lineTo(.1 * b, 1 * c); b = a.o; w.q(a); return b }, BpmnActivityParallel: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); a.lineTo(0, 1 * c); a.moveTo(.5 * b, 0); a.lineTo(.5 * b, 1 * c); a.moveTo(1 * b, 0); a.lineTo(1 * b, 1 * c); b = a.o; w.q(a); return b }, BpmnActivitySequential: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); a.lineTo(1 * b, 0); a.moveTo(0, .5 * c); a.lineTo(1 * b, .5 * c); a.moveTo(0, 1 * c); a.lineTo(1 * b, 1 * c); b = a.o; w.q(a); return b }, BpmnActivityAdHoc: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); M(a, 1 * b, 1 * c, !1); M(a, 0, .5 * c, !1); N(a, .2 * b, .35 * c, .3 * b, .35 * c, .5 * b, .5 * c); N(a, .7 * b, .65 * c, .8 * b, .65 * c, 1 * b, .5 * c); b = a.o; w.q(a); return b }, BpmnActivityCompensation: function (a, b, c) { a = w.s(); M(a, 0, .5 * c, !0); a.lineTo(.5 * b, 0); a.lineTo(.5 * b, .5 * c); a.lineTo(1 * b, 1 * c); a.lineTo(1 * b, 0); a.lineTo(.5 * b, .5 * c); a.lineTo(.5 * b, 1 * c); P(a); b = a.o; w.q(a); return b }, BpmnTaskMessage: function (a, b, c) { a = w.s(); M(a, 0, .2 * c, !0); a.lineTo(1 * b, .2 * c); a.lineTo(1 * b, .8 * c); a.lineTo(0, .8 * c); a.lineTo(0, .8 * c); P(a); M(a, 0, .2 * c, !1); a.lineTo(.5 * b, .5 * c); a.lineTo(1 * b, .2 * c); a.bb(!1); b = a.o; w.q(a); return b }, BpmnTaskScript: function (a, b, c) { a = w.s(); M(a, .7 * b, 1 * c, !0); a.lineTo(.3 * b, 1 * c); N(a, .6 * b, .5 * c, 0, .5 * c, .3 * b, 0); a.lineTo(.7 * b, 0); N(a, .4 * b, .5 * c, 1 * b, .5 * c, .7 * b, 1 * c); P(a); M(a, .45 * b, .73 * c, !1); a.lineTo(.7 * b, .73 * c); a.moveTo(.38 * b, .5 * c); a.lineTo(.63 * b, .5 * c); a.moveTo(.31 * b, .27 * c); a.lineTo(.56 * b, .27 * c); a.bb(!1); b = a.o; w.q(a); return b }, BpmnTaskUser: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); M(a, .335 * b, (1 - .555) * c, !0); a.lineTo(.335 * b, .595 * c); a.lineTo(.665 * b, .595 * c); a.lineTo(.665 * b, (1 - .555) * c); N(a, .88 * b, .46 * c, .98 * b, .54 * c, 1 * b, .68 * c); a.lineTo(1 * b, 1 * c); a.lineTo(0, 1 * c); a.lineTo(0, .68 * c); N(a, .02 * b, .54 * c, .12 * b, .46 * c, .335 * b, (1 - .555) * c); a.lineTo(.365 * b, .405 * c); var d = .5 - .285, e = Math.PI / 4, f = 4 * (1 - Math.cos(e)) / (3 * Math.sin(e)), e = f * d, f = f * d; N(a, (.5 - (e + d) / 2) * b, (d + (d + f) / 2) * c, (.5 - d) * b, (d + f) * c, (.5 - d) * b, d * c); N(a, (.5 - d) * b, (d - f) * c, (.5 - e) * b, (d - d) * c, .5 * b, (d - d) * c); N(a, (.5 + e) * b, (d - d) * c, (.5 + d) * b, (d - f) * c, (.5 + d) * b, d * c); N(a, (.5 + d) * b, (d + f) * c, (.5 + (e + d) / 2) * b, (d + (d + f) / 2) * c, .635 * b, .405 * c); a.lineTo(.635 * b, .405 * c); a.lineTo(.665 * b, (1 - .555) * c); a.lineTo(.665 * b, .595 * c); a.lineTo(.335 * b, .595 * c); M(a, .2 * b, 1 * c, !1); a.lineTo(.2 * b, .8 * c); M(a, .8 * b, 1 * c, !1); a.lineTo(.8 * b, .8 * c); b = a.o; w.q(a); return b }, BpmnEventConditional: function (a, b, c) { a = w.s(); M(a, .1 * b, 0, !0); a.lineTo(.9 * b, 0); a.lineTo(.9 * b, 1 * c); a.lineTo(.1 * b, 1 * c); P(a); M(a, .2 * b, .2 * c, !1); a.lineTo(.8 * b, .2 * c); a.moveTo(.2 * b, .4 * c); a.lineTo(.8 * b, .4 * c); a.moveTo(.2 * b, .6 * c); a.lineTo(.8 * b, .6 * c); a.moveTo(.2 * b, .8 * c); a.lineTo(.8 * b, .8 * c); a.bb(!1); b = a.o; w.q(a); return b }, BpmnEventError: function (a, b, c) { a = w.s(); M(a, 0, 1 * c, !0); a.lineTo(.33 * b, 0); a.lineTo(.66 * b, .5 * c); a.lineTo(1 * b, 0); a.lineTo(.66 * b, 1 * c); a.lineTo(.33 * b, .5 * c); P(a); b = a.o; w.q(a); return b }, BpmnEventEscalation: function (a, b, c) { a = w.s(); M(a, 0, 0, !1); M(a, 1 * b, 1 * c, !1); M(a, .1 * b, 1 * c, !0); a.lineTo(.5 * b, 0); a.lineTo(.9 * b, 1 * c); a.lineTo(.5 * b, .5 * c); P(a); b = a.o; w.q(a); return b }, BpmnEventTimer: function (a, b, c) { a = w.s(); var d = .5 * dd; M(a, 1 * b, .5 * c, !0); N(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c); N(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c); N(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0); N(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c); M(a, .5 * b, 0, !1); a.lineTo(.5 * b, .15 * c); a.moveTo(.5 * b, 1 * c); a.lineTo(.5 * b, .85 * c); a.moveTo(0, .5 * c); a.lineTo(.15 * b, .5 * c); a.moveTo(1 * b, .5 * c); a.lineTo(.85 * b, .5 * c); a.moveTo(.5 * b, .5 * c); a.lineTo(.58 * b, .1 * c); a.moveTo(.5 * b, .5 * c); a.lineTo(.78 * b, .54 * c); a.bb(!1); b = a.o; b.be = Qj; w.q(a); return b } }, Wq; for (Wq in jq) jq[Wq.toLowerCase()] = Wq; var qq = { "": "", Standard: "F1 m 0,0 l 8,4 -8,4 2,-4 z", Backward: "F1 m 8,0 l -2,4 2,4 -8,-4 z", Triangle: "F1 m 0,0 l 8,4.62 -8,4.62 z", BackwardTriangle: "F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z", Boomerang: "F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z", BackwardBoomerang: "F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z", SidewaysV: "m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z", BackwardV: "m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z", OpenTriangle: "m 0,0 l 8,4 -8,4", BackwardOpenTriangle: "m 8,0 l -8,4 8,4", OpenTriangleLine: "m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8", BackwardOpenTriangleLine: "m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8", OpenTriangleTop: "m 0,0 l 8,4 m 0,4", BackwardOpenTriangleTop: "m 8,0 l -8,4 m 0,4", OpenTriangleBottom: "m 0,8 l 8,-4", BackwardOpenTriangleBottom: "m 0,4 l 8,4", HalfTriangleTop: "F1 m 0,0 l 0,4 8,0 z m 0,8", BackwardHalfTriangleTop: "F1 m 8,0 l 0,4 -8,0 z m 0,8", HalfTriangleBottom: "F1 m 0,4 l 0,4 8,-4 z", BackwardHalfTriangleBottom: "F1 m 8,4 l 0,4 -8,-4 z", ForwardSemiCircle: "m 4,0 b 270 180 0 4 4", BackwardSemiCircle: "m 4,8 b 90 180 0 -4 4", Feather: "m 0,0 l 3,4 -3,4", BackwardFeather: "m 3,0 l -3,4 3,4", DoubleFeathers: "m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4", BackwardDoubleFeathers: "m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4", TripleFeathers: "m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4", BackwardTripleFeathers: "m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4", ForwardSlash: "m 0,8 l 5,-8", BackSlash: "m 0,0 l 5,8", DoubleForwardSlash: "m 0,8 l 4,-8 m -2,8 l 4,-8", DoubleBackSlash: "m 0,0 l 4,8 m -2,-8 l 4,8", TripleForwardSlash: "m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8", TripleBackSlash: "m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8", Fork: "m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4", BackwardFork: "m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4", LineFork: "m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4", BackwardLineFork: "m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8", CircleFork: "F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4", BackwardCircleFork: "F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3", CircleLineFork: "F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4", BackwardCircleLineFork: "F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3", Circle: "F1 m 8,4 b 0 360 -4 0 4 z", Block: "F1 m 0,0 l 0,8 8,0 0,-8 z", StretchedDiamond: "F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z", Diamond: "F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z", Chevron: "F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z", StretchedChevron: "F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z", NormalArrow: "F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z", X: "m 0,0 l 8,8 m 0,-8 l -8,8", TailedNormalArrow: "F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z", DoubleTriangle: "F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z", BigEndArrow: "F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z", ConcaveTailArrow: "F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z", RoundedTriangle: "F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z", SimpleArrow: "F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z", AccelerationArrow: "F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z", BoxArrow: "F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z", TriangleLine: "F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8", CircleEndedArrow: "F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z", DynamicWidthArrow: "F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z", EquilibriumArrow: "m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3", FastForward: "F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z", Kite: "F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z", HalfArrowTop: "F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8", HalfArrowBottom: "F1 m 0,8 l 4,-4 4,0 -8,4 z", OpposingDirectionDoubleArrow: "F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z", PartialDoubleTriangle: "F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z", LineCircle: "F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z", DoubleLineCircle: "F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z", TripleLineCircle: "F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z", CircleLine: "F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8", DiamondCircle: "F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z", PlusCircle: "F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8", OpenRightTriangleTop: "m 8,0 l 0,4 -8,0 m 0,4", OpenRightTriangleBottom: "m 8,8 l 0,-4 -8,0", Line: "m 0,0 l 0,8", DoubleLine: "m 0,0 l 0,8 m 2,0 l 0,-8", TripleLine: "m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8", PentagonArrow: "F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z" }; function nq(a) { var b = Td[a]; if (void 0 === b) { var c = a.toLowerCase(); if ("none" === c) return "None"; b = Td[c]; if (void 0 === b) { var d = null, e; for (e in qq) if (e.toLowerCase() === c) { d = e; break } if (null !== d) return a = Te(qq[d], !1), Td[d] = a, c !== d && (Td[c] = d), d } } return "string" === typeof b ? b : b instanceof Ce ? a : null } function T(a) { C.call(this, a); this.N = 2408959; this.nl = this.xi = ""; this.Ls = this.Is = this.Us = this.Ur = null; this.Ws = ""; this.vi = this.Hr = this.Vs = this.$m = null; this.Ks = ""; this.ip = null; this.Js = Gd; this.Ms = ""; this.jp = null; this.Hd = ""; this.Uv = this.Vq = this.$k = null; this.Si = (new z(NaN, NaN)).freeze(); this.Zr = ""; this.ql = null; this.$r = xb; this.hs = pd; this.as = qd; this.or = null; this.Vr = Xq; this.bn = od; this.an = "gray"; this.Eg = 4; this.aD = -1; this.ut = NaN; this.KG = new B; this.Om = null; this.ck = NaN } w.Ka(T, C); w.ga("Part", T); T.prototype.cloneProtected = function (a) { C.prototype.cloneProtected.call(this, a); a.N = this.N & -4097 | 49152; a.xi = this.xi; a.nl = this.nl; a.Ur = this.Ur; a.Us = this.Us; a.Is = this.Is; a.Ls = this.Ls; a.Ws = this.Ws; a.Vs = this.Vs; a.Hr = this.Hr; a.vi = null; a.Ks = this.Ks; a.Js = this.Js.S(); a.Ms = this.Ms; a.Hd = this.Hd; a.Vq = this.Vq; a.Si.assign(this.Si); a.Zr = this.Zr; a.$r = this.$r.S(); a.hs = this.hs.S(); a.as = this.as.S(); a.or = this.or; a.Vr = this.Vr; a.bn = this.bn.S(); a.an = this.an; a.Eg = this.Eg; a.ut = this.ut }; T.prototype.oi = function (a) { C.prototype.oi.call(this, a); a.Fk(); a.$m = null; a.ip = null; a.jp = null; a.ql = null; a.Om = null }; T.prototype.toString = function () { var a = w.kf(Object.getPrototypeOf(this)) + "#" + w.Nd(this); null !== this.data && (a += "(" + Sf(this.data) + ")"); return a }; T.LayoutNone = 0; var Lm; T.LayoutAdded = Lm = 1; var Um; T.LayoutRemoved = Um = 2; T.LayoutShown = 4; T.LayoutHidden = 8; T.LayoutNodeSized = 16; var An; T.LayoutGroupLayout = An = 32; T.LayoutNodeReplaced = 64; var Xq; T.LayoutStandard = Xq = Lm | Um | 28 | An | 64; T.LayoutAll = 16777215; T.prototype.Vn = function (a, b, c, d, e, f, h) { var k = this.g; null !== k && (a === Qf && "elements" === b ? e instanceof C ? Mm(e, function (a) { Om(k, a); Nm(k, a) }) : e instanceof xl && mn(k, e) : a === Rf && "elements" === b && (e instanceof C ? Mm(e, function (a) { Sm(k, a); Rm(k, a) }) : e instanceof xl && nn(k, e)), k.Zc(a, b, c, d, e, f, h)) }; T.prototype.updateTargetBindings = T.prototype.Hb = function (a) { C.prototype.Hb.call(this, a); if (null !== this.data) { a = this.xa.n; for (var b = a.length, c = 0; c < b; c++) { var d = a[c]; d instanceof C && Mm(d, function (a) { null !== a.data && a.Hb() }) } } }; T.prototype.updateRelationshipsFromData = function () { var a = this.data; if (null !== a) { var b = this.g; if (null !== b) { var c = b.ba; c instanceof R && (a = c.An(a), b = b.UH(a), null === b || b instanceof V) && (this.Da = b) } } }; w.u(T, { Pw: "adornments" }, function () { return null === this.vi ? va : this.vi.yF }); T.prototype.findAdornment = T.prototype.Qp = function (a) { var b = this.vi; return null === b ? null : b.ja(a) }; T.prototype.addAdornment = T.prototype.Cl = function (a, b) { if (null !== b) { var c = null, d = this.vi; null !== d && (c = d.ja(a)); if (c !== b) { if (null !== c) { var e = c.g; null !== e && e.remove(c) } null === d && (this.vi = d = new la("string", jh)); b.xi !== a && (b.ud = a); d.add(a, b); c = this.g; null !== c && (c.add(b), b.data = this.data) } } }; T.prototype.removeAdornment = T.prototype.Bj = function (a) { var b = this.vi; if (null !== b) { var c = b.ja(a); if (null !== c) { var d = c.g; null !== d && d.remove(c) } b.remove(a); 0 === b.count && (this.vi = null) } }; T.prototype.clearAdornments = T.prototype.Dt = function () { var a = this.vi; if (null !== a) { for (var b = w.cb(), a = a.i; a.next();)b.push(a.key); for (var a = b.length, c = 0; c < a; c++)this.Bj(b[c]); w.ua(b) } }; T.prototype.updateAdornments = function () { var a = this.g; if (null !== a) { a: { if (this.ib && this.BJ) { var b = this.Hu; if (!(null !== b && this.Y.I() && this.isVisible() && b.xj() && b.Y.I())) break a; var c = this.Qp("Selection"); if (null === c) { c = this.CJ; null === c && (c = this instanceof W ? a.NI : this instanceof V ? a.hI : a.fJ); if (!(c instanceof jh)) break a; lh(c); c = c.copy(); null !== c && (c.rb = b) } if (null !== c) { var d = c.placeholder; if (null !== d) { var e = b.pj(), f = 0; b instanceof Y && (f = b.lb); var h = w.jm(); h.m((b.Ja.width + f) * e, (b.Ja.height + f) * e); d.Ca = h; w.Bk(h) } c.angle = b.Tl(); c.type !== hj && (d = w.K(), c.location = b.Wa(xb, d), w.v(d)); this.Cl("Selection", c); break a } } this.Bj("Selection") } Yq(this, a); for (a = this.Pw; a.next();)b = a.value, b.Hb(), b.H() } }; function Yq(a, b) { b.eb.cf.each(function (b) { b.isEnabled && b.updateAdornments(a) }); b.eb.updateAdornments(a) } w.u(T, { layer: "layer" }, function () { return this.Uv }); w.u(T, { g: "diagram" }, function () { var a = this.Uv; return null !== a ? a.g : null }); w.defineProperty(T, { Zf: "layerName" }, function () { return this.nl }, function (a) { var b = this.nl; if (b !== a) { w.j(a, "string", T, "layerName"); var c = this.g; if (null === c || null !== c.Mt(a) && !c.Fq) if (this.nl = a, null !== c && c.sc(), this.h("layerName", b, a), b = this.layer, null !== b && b.name !== a && (c = b.g, null !== c && (a = c.Mt(a), null !== a && a !== b))) { var d = b.lf(-1, this, !0); 0 <= d && c.Zc(Rf, "parts", b, this, null, d, !0); b.visible !== a.visible && this.yd(a.visible); d = a.Xp(99999999, this, !0); 0 <= d && c.Zc(Qf, "parts", a, null, this, !0, d); d = this.Hx; if (null !== d) { var e = c.Ta; c.Ta = !0; d(this, b, a); c.Ta = e } } } }); w.defineProperty(T, { Hx: "layerChanged" }, function () { return this.Ur }, function (a) { var b = this.Ur; b !== a && (null !== a && w.j(a, "function", T, "layerChanged"), this.Ur = a, this.h("layerChanged", b, a)) }); w.defineProperty(T, { ho: "zOrder" }, function () { return this.ut }, function (a) { var b = this.ut; if (b !== a) { w.j(a, "number", T, "zOrder"); this.ut = a; var c = this.layer; null !== c && ol(c, -1, this); this.h("zOrder", b, a); a = this.g; null !== a && a.na() } }); T.prototype.invalidateAdornments = T.prototype.de = function () { var a = this.g; null !== a && (Ml(a), 0 !== (this.N & 16384) !== !0 && (this.N |= 16384, a.Me())) }; function kl(a) { 0 !== (a.N & 16384) !== !1 && (a.updateAdornments(), a.N &= -16385) } function Zq(a) { if (!1 === Em(a)) { var b = a.g; null !== b && (b.vg.add(a), b.Me()); $q(a, !0); a.Li() } } function ar(a) { a.N |= 2097152; if (!1 !== Em(a)) { var b = a.position, c = a.location; c.I() && b.I() || br(a, b, c); var c = a.oc, d = c.copy(); c.Qa(); c.x = b.x; c.y = b.y; c.freeze(); a.Px(d, c); $q(a, !1) } } w.u(T, { $f: "locationObject" }, function () { if (null === this.ql) { var a = this.HA; "" !== a ? (a = this.xd(a), this.ql = null !== a ? a : this) : this.ql = this instanceof jh ? this.type !== hj && null !== this.placeholder ? this.placeholder : this : this } return this.ql.visible ? this.ql : this }); w.defineProperty(T, { ZI: "minLocation" }, function () { return this.hs }, function (a) { var b = this.hs; b.L(a) || (this.hs = a = a.S(), this.h("minLocation", b, a)) }); w.defineProperty(T, { TI: "maxLocation" }, function () { return this.as }, function (a) { var b = this.as; b.L(a) || (this.as = a = a.S(), this.h("maxLocation", b, a)) }); w.defineProperty(T, { HA: "locationObjectName" }, function () { return this.Zr }, function (a) { var b = this.Zr; b !== a && (this.Zr = a, this.ql = null, this.H(), this.h("locationObjectName", b, a)) }); w.defineProperty(T, { Ef: "locationSpot" }, function () { return this.$r }, function (a) { var b = this.$r; b.L(a) || (this.$r = a = a.S(), this.H(), this.h("locationSpot", b, a)) }); T.prototype.move = function (a) { this.position = a }; T.prototype.moveTo = T.prototype.moveTo = function (a, b) { var c = w.xb(a, b); this.move(c); w.v(c) }; T.prototype.isVisible = function () { if (!this.visible) return !1; var a = this.layer; if (null !== a && !a.visible) return !1; a = this.g; if (null !== a && (a = a.Oa, a.mf && (a = a.Qm.ja(this), null !== a && a.Yx))) return !0; a = this.Da; return null === a || a.hd && a.isVisible() ? !0 : !1 }; T.prototype.yd = function (a) { var b = this.g; a ? (this.J(4), this.de(), null !== b && b.vg.add(this)) : (this.J(8), this.Dt()); this.Fk(); null !== b && (b.sc(), b.na()) }; T.prototype.findObject = T.prototype.xd = function (a) { if (this.name === a) return this; var b = this.Om; null === b && (this.Om = b = new sa); if (void 0 !== b[a]) return b[a]; for (var c = this.xa.n, d = c.length, e = 0; e < d; e++) { var f = c[e]; if (f.name === a) return b[a] = f; if (f instanceof C) if (null === f.$j && null === f.xg) { if (f = f.xd(a), null !== f) return b[a] = f } else if (kn(f) && (f = f.xa.first(), null !== f && f.name === a)) return b[a] = f } return b[a] = null }; function cr(a, b, c, d) { void 0 === d && (d = new z); c = c.Rd() ? Hb : c; var e = b.Ja; d.m(e.width * c.x + c.offsetX, e.height * c.y + c.offsetY); if (null === b || b === a) return d; b.transform.nb(d); for (b = b.O; null !== b && b !== a;)b.transform.nb(d), b = b.O; a.Ri.nb(d); d.offset(-a.rd.x, -a.rd.y); return d } T.prototype.ensureBounds = T.prototype.af = function () { xk(this, Infinity, Infinity); this.jc() }; function nl(a, b) { var c = a.KG, d; isNaN(a.ck) && (a.ck = $p(a)); d = a.ck; var e = 2 * d; if (!a.am) return c.m(b.x - 1 - d, b.y - 1 - d, b.width + 2 + e, b.height + 2 + e), c; d = b.x; var e = b.y, f = b.width, h = b.height, k = a.shadowBlur, l = a.GJ, f = f + k, h = h + k; d -= k / 2; e -= k / 2; 0 < l.x ? f += l.x : (d += l.x, f -= l.x); 0 < l.y ? h += l.y : (e += l.y, h -= l.y); c.m(d - 1, e - 1, f + 2, h + 2); return c } T.prototype.jc = function () { this.Li(); if (!1 === Dm(this)) ar(this); else { var a = this.oc, b = w.If(); b.assign(a); a.Qa(); var c = jl(this); this.jj(0, 0, this.rd.width, this.rd.height); var d = this.position; br(this, d, this.location); a.x = d.x; a.y = d.y; a.freeze(); this.Px(b, a); Fo(this, !1); b.L(a) ? this.Gf(c) : !this.ee() || J(b.width, a.width) && J(b.height, a.height) || 0 <= this.aD && this.J(16); w.Db(b); $q(this, !1) } }; T.prototype.Px = function (a, b) { var c = this.g; if (null !== c) { var d = !1; if (!1 === c.Vj && a.I()) { var e = c.se, f = c.padding, h = e.x + f.left, k = e.y + f.top, l = e.width - 2 * f.right, e = e.height - 2 * f.bottom; a.x > h && a.y > k && a.right < l && a.bottom < e && b.x > h && b.y > k && b.right < l && b.bottom < e && (d = !0) } 0 !== (this.N & 65536) !== !0 && a.L(b) || Pm(this, d, c); c.na(); Qa(a, b) || (this instanceof U && !c.oa.ab && this.Xf(), this.Fk()) } }; w.defineProperty(T, { location: "location" }, function () { return this.Si }, function (a) { var b = a.x, c = a.y, d = this.Si, e = d.x, f = d.y; (e === b || isNaN(e) && isNaN(b)) && (f === c || isNaN(f) && isNaN(c)) || (a = a.S(), b = a, this instanceof W ? b = !1 : (this.Si = b, this.N |= 2097152, !1 === Dm(this) && (Zq(this), c = this.jb, c.I() && (e = c.copy(), c.m(c.x + (b.x - d.x), c.y + (b.y - d.y)), dr(this, this.g, c, e), this.h("position", e, c))), b = !0), b && this.h("location", d, a)) }); g = T.prototype; g.lB = function (a, b) { if (this instanceof W || !a.I()) return !1; var c = this.g; if (null !== c && (dr(this, c, a, b), !0 === c.oa.ab)) return !0; this.jb = a; this.N &= -2097153; c = this.Si; if (c.I()) { var d = c.copy(); c.m(c.x + (a.x - b.x), c.y + (a.y - b.y)); this.h("location", d, c) } !1 === Em(this) && !1 === Dm(this) && (Zq(this), ar(this)); return !0 }; function dr(a, b, c, d) { null === b || a instanceof jh || (b = b.Oa, b.qc && Yk(b, a, "position", d.copy(), c.copy(), !1)) } g.my = function (a, b) { var c = this.Si, d = this.jb; Em(this) || Dm(this) ? c.m(NaN, NaN) : c.m(c.x + a - d.x, c.y + b - d.y); d.m(a, b); Zq(this) }; g.mB = function () { this.N &= -2097153; Zq(this) }; function br(a, b, c) { var d = w.K(), e = a.Ef, f = a.$f; e.Rd() && w.k("determineOffset: Part's locationSpot must be real: " + e.toString()); var h = f.Ja, k = f instanceof Y ? f.lb : 0; d.Ku(0, 0, h.width + k, h.height + k, e); if (f !== a) for (d.offset(-k / 2, -k / 2), f.transform.nb(d), e = f.O; null !== e && e !== a;)e.transform.nb(d), e = e.O; a.Ri.nb(d); d.offset(-a.rd.x, -a.rd.y); e = a.g; f = c.I(); h = b.I(); f && h ? 0 !== (a.N & 2097152) ? er(a, b, c, e, d) : fr(a, b, c, e, d) : f ? er(a, b, c, e, d) : h && fr(a, b, c, e, d); a.N |= 2097152; w.v(d); a.Li() } function er(a, b, c, d, e) { var f = b.x, h = b.y; b.m(c.x - e.x, c.y - e.y); null !== d && (c = d.Oa, (e = c.Wj) || !c.qc || a instanceof jh || Yk(c, a, "position", new z(f, h), b, !1), e || b.x === f && b.y === h || (c = d.wb, d.wb = !0, a.h("position", new z(f, h), b), d.wb = c)) } function fr(a, b, c, d, e) { var f = c.copy(); c.m(b.x + e.x, b.y + e.y); c.L(f) || null === d || (b = d.wb, d.wb = !0, a.h("location", f, c), d.wb = b) } function Pm(a, b, c) { Ho(a, !1); a instanceof U && c.AA(a); a.layer.Mc || b || c.sc(); b = a.oc; var d = c.pb; d.I() ? (jl(a) ? Za(b, d) || a.Gf(!1) : b.Wf(d) && a.Gf(!0), a.updateAdornments()) : c.il = !0 } g.$l = function () { return !0 }; function ll(a, b) { var c = a.oc; if (0 !== c.width && 0 !== c.height && !isNaN(c.x) && !isNaN(c.y) && a.isVisible()) { var d = a.transform; null !== a.bc && (No(a, b, a.bc, !0, !0), b.fillRect(c.x, c.y, c.width, c.height)); null === a.bc && null === a.Eb && (No(a, b, "rgba(0,0,0,0.4)", !0, !1), b.fillRect(c.x, c.y, c.width, c.height)); null !== a.Eb && (d.gu() || b.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy), c = a.Ja, No(a, b, a.Eb, !0, !1), b.fillRect(0, 0, c.width, c.height), d.gu() || (c = 1 / (d.m11 * d.m22 - d.m12 * d.m21), b.transform(d.m22 * c, -d.m12 * c, -d.m21 * c, d.m11 * c, c * (d.m21 * d.dy - d.m22 * d.dx), c * (d.m12 * d.dx - d.m11 * d.dy)))) } } g.ee = function () { return !0 }; g.tj = function () { return !0 }; w.defineProperty(T, { ud: "category" }, function () { return this.xi }, function (a) { var b = this.xi; if (b !== a) { w.j(a, "string", T, "category"); var c = this.g, d = this.data, e = null; if (null !== c && null !== d && !(this instanceof jh)) { var f = c.ba.oa; f.isEnabled && !f.ab && (e = this.clone(), e.xa.Jc(this.xa)) } this.xi = a; this.h("category", b, a); null === c || null === d || this instanceof jh ? (e = this.uf, null !== e && (a = e.vi, null !== a && a.remove(b), e.Cl(this.ud, this))) : (f = c.ba, f.oa.ab || (this instanceof W ? (f instanceof R ? f.iG(d, a) : f instanceof ag && f.EJ(d, a), c = un(c, a), null !== c && (lh(c), c = c.copy(), null !== c && gr(this, c, b, a))) : (null !== f && f.jy(d, a), c = rn(c, d, a), null !== c && (lh(c), c = c.copy(), null === c || c instanceof W || (c.location = this.location, gr(this, c, b, a)))), null !== e && (b = this.clone(), b.xa.Jc(this.xa), this.h("self", e, b)))) } }); w.defineProperty(T, { self: "self" }, function () { return this }, function (a) { gr(this, a, this.ud, a.ud) }); var hr = !1; function gr(a, b, c, d) { b.constructor === a.constructor || hr || (hr = !0, w.trace('Should not change the class of the Part when changing category from "' + c + '" to "' + d + '"'), w.trace(" Old class: " + w.kf(a) + ", new class: " + w.kf(b) + ", part: " + a.toString())); a.Dt(); var e = a.data; c = a.Zf; var f = a.ib, h = a.Pg, k = !0, l = !0, m = !1; if (a instanceof U) var n = a, k = n.wj, l = n.tc, m = n.zq; b.oi(a); b.cloneProtected(a); a.xi = d; a.H(); a.na(); b = a.g; d = !0; null !== b && (d = b.wb, b.wb = !0); a.Yd = e; null !== e && a.Hb(); null !== b && (b.wb = d); e = a.Zf; e !== c && (a.nl = c, a.Zf = e); a instanceof U && (n = a, n.wj = k, n.tc = l, n.zq = m, n.ee() && n.J(64)); a.ib = f; a.Pg = h } T.prototype.canCopy = function () { if (!this.FH) return !1; var a = this.layer; if (null === a) return !0; if (!a.tk) return !1; a = a.g; return null === a ? !0 : a.tk ? !0 : !1 }; T.prototype.canDelete = function () { if (!this.KH) return !1; var a = this.layer; if (null === a) return !0; if (!a.hn) return !1; a = a.g; return null === a ? !0 : a.hn ? !0 : !1 }; T.prototype.canEdit = function () { if (!this.NJ) return !1; var a = this.layer; if (null === a) return !0; if (!a.Tw) return !1; a = a.g; return null === a ? !0 : a.Tw ? !0 : !1 }; T.prototype.canGroup = function () { if (!this.iI) return !1; var a = this.layer; if (null === a) return !0; if (!a.Qw) return !1; a = a.g; return null === a ? !0 : a.Qw ? !0 : !1 }; T.prototype.canMove = function () { if (!this.dJ) return !1; var a = this.layer; if (null === a) return !0; if (!a.Fl) return !1; a = a.g; return null === a ? !0 : a.Fl ? !0 : !1 }; T.prototype.canReshape = function () { if (!this.qJ) return !1; var a = this.layer; if (null === a) return !0; if (!a.Rw) return !1; a = a.g; return null === a ? !0 : a.Rw ? !0 : !1 }; T.prototype.canResize = function () { if (!this.rJ) return !1; var a = this.layer; if (null === a) return !0; if (!a.Ct) return !1; a = a.g; return null === a ? !0 : a.Ct ? !0 : !1 }; T.prototype.canRotate = function () { if (!this.uJ) return !1; var a = this.layer; if (null === a) return !0; if (!a.Sw) return !1; a = a.g; return null === a ? !0 : a.Sw ? !0 : !1 }; T.prototype.canSelect = function () { if (!this.dm) return !1; var a = this.layer; if (null === a) return !0; if (!a.vf) return !1; a = a.g; return null === a ? !0 : a.vf ? !0 : !1 }; w.defineProperty(T, { FH: "copyable" }, function () { return 0 !== (this.N & 1) }, function (a) { var b = 0 !== (this.N & 1); b !== a && (this.N ^= 1, this.h("copyable", b, a)) }); w.defineProperty(T, { KH: "deletable" }, function () { return 0 !== (this.N & 2) }, function (a) { var b = 0 !== (this.N & 2); b !== a && (this.N ^= 2, this.h("deletable", b, a)) }); w.defineProperty(T, { NJ: "textEditable" }, function () { return 0 !== (this.N & 4) }, function (a) { var b = 0 !== (this.N & 4); b !== a && (this.N ^= 4, this.h("textEditable", b, a), this.de()) }); w.defineProperty(T, { iI: "groupable" }, function () { return 0 !== (this.N & 8) }, function (a) { var b = 0 !== (this.N & 8); b !== a && (this.N ^= 8, this.h("groupable", b, a)) }); w.defineProperty(T, { dJ: "movable" }, function () { return 0 !== (this.N & 16) }, function (a) { var b = 0 !== (this.N & 16); b !== a && (this.N ^= 16, this.h("movable", b, a)) }); w.defineProperty(T, { BJ: "selectionAdorned" }, function () { return 0 !== (this.N & 32) }, function (a) { var b = 0 !== (this.N & 32); b !== a && (this.N ^= 32, this.h("selectionAdorned", b, a), this.de()) }); w.defineProperty(T, { DA: "isInDocumentBounds" }, function () { return 0 !== (this.N & 64) }, function (a) { var b = 0 !== (this.N & 64); if (b !== a) { this.N ^= 64; var c = this.g; null !== c && c.sc(); this.h("isInDocumentBounds", b, a) } }); w.defineProperty(T, { tF: "isLayoutPositioned" }, function () { return 0 !== (this.N & 128) }, function (a) { var b = 0 !== (this.N & 128); b !== a && (this.N ^= 128, this.h("isLayoutPositioned", b, a), this.J(a ? 4 : 8)) }); w.defineProperty(T, { dm: "selectable" }, function () { return 0 !== (this.N & 256) }, function (a) { var b = 0 !== (this.N & 256); b !== a && (this.N ^= 256, this.h("selectable", b, a), this.de()) }); w.defineProperty(T, { qJ: "reshapable" }, function () { return 0 !== (this.N & 512) }, function (a) { var b = 0 !== (this.N & 512); b !== a && (this.N ^= 512, this.h("reshapable", b, a), this.de()) }); w.defineProperty(T, { rJ: "resizable" }, function () { return 0 !== (this.N & 1024) }, function (a) { var b = 0 !== (this.N & 1024); b !== a && (this.N ^= 1024, this.h("resizable", b, a), this.de()) }); w.defineProperty(T, { uJ: "rotatable" }, function () { return 0 !== (this.N & 2048) }, function (a) { var b = 0 !== (this.N & 2048); b !== a && (this.N ^= 2048, this.h("rotatable", b, a), this.de()) }); w.defineProperty(T, { ib: "isSelected" }, function () { return 0 !== (this.N & 4096) }, function (a) { var b = 0 !== (this.N & 4096); if (b !== a) { var c = this.g; if (!a || this.canSelect() && !(null !== c && c.selection.count >= c.UI)) { this.N ^= 4096; var d = !1; if (null !== c) { d = c.wb; c.wb = !0; var e = c.selection; e.Qa(); a ? e.add(this) : e.remove(this); e.freeze() } this.h("isSelected", b, a); this.de(); a = this.DJ; null !== a && a(this); null !== c && (c.Me(), c.wb = d) } } }); w.defineProperty(T, { Pg: "isHighlighted" }, function () { return 0 !== (this.N & 524288) }, function (a) { var b = 0 !== (this.N & 524288); if (b !== a) { this.N ^= 524288; var c = this.g; null !== c && (c = c.Wl, c.Qa(), a ? c.add(this) : c.remove(this), c.freeze()); this.h("isHighlighted", b, a); this.na(); a = this.lI; null !== a && a(this) } }); w.defineProperty(T, { am: "isShadowed" }, function () { return 0 !== (this.N & 8192) }, function (a) { var b = 0 !== (this.N & 8192); b !== a && (this.N ^= 8192, this.h("isShadowed", b, a), this.na()) }); function Em(a) { return 0 !== (a.N & 32768) } function $q(a, b) { a.N = b ? a.N | 32768 : a.N & -32769 } function Ho(a, b) { a.N = b ? a.N | 65536 : a.N & -65537 } function jl(a) { return 0 !== (a.N & 131072) } T.prototype.Gf = function (a) { this.N = a ? this.N | 131072 : this.N & -131073 }; function ir(a, b) { a.N = b ? a.N | 1048576 : a.N & -1048577 } w.defineProperty(T, { kF: "isAnimated" }, function () { return 0 !== (this.N & 262144) }, function (a) { var b = 0 !== (this.N & 262144); b !== a && (this.N ^= 262144, this.h("isAnimated", b, a)) }); w.defineProperty(T, { lI: "highlightedChanged" }, function () { return this.Hr }, function (a) { var b = this.Hr; b !== a && (null !== a && w.j(a, "function", T, "highlightedChanged"), this.Hr = a, this.h("highlightedChanged", b, a)) }); w.defineProperty(T, { gB: "selectionObjectName" }, function () { return this.Ws }, function (a) { var b = this.Ws; b !== a && (this.Ws = a, this.$m = null, this.h("selectionObjectName", b, a)) }); w.defineProperty(T, { CJ: "selectionAdornmentTemplate" }, function () { return this.Us }, function (a) { var b = this.Us; b !== a && (this instanceof W && (a.type = hj), this.Us = a, this.h("selectionAdornmentTemplate", b, a)) }); w.u(T, { Hu: "selectionObject" }, function () { if (null === this.$m) { var a = this.gB; null !== a && "" !== a ? (a = this.xd(a), this.$m = null !== a ? a : this) : this instanceof W ? (a = this.path, this.$m = null !== a ? a : this) : this.$m = this } return this.$m }); w.defineProperty(T, { DJ: "selectionChanged" }, function () { return this.Vs }, function (a) { var b = this.Vs; b !== a && (null !== a && w.j(a, "function", T, "selectionChanged"), this.Vs = a, this.h("selectionChanged", b, a)) }); w.defineProperty(T, { YF: "resizeAdornmentTemplate" }, function () { return this.Is }, function (a) { var b = this.Is; b !== a && (this.Is = a, this.h("resizeAdornmentTemplate", b, a)) }); w.defineProperty(T, { $F: "resizeObjectName" }, function () { return this.Ks }, function (a) { var b = this.Ks; b !== a && (this.Ks = a, this.ip = null, this.h("resizeObjectName", b, a)) }); w.u(T, { ZF: "resizeObject" }, function () { if (null === this.ip) { var a = this.$F; null !== a && "" !== a ? (a = this.xd(a), this.ip = null !== a ? a : this) : this.ip = this } return this.ip }); w.defineProperty(T, { sJ: "resizeCellSize" }, function () { return this.Js }, function (a) { var b = this.Js; b.L(a) || (this.Js = a = a.S(), this.h("resizeCellSize", b, a)) }); w.defineProperty(T, { vJ: "rotateAdornmentTemplate" }, function () { return this.Ls }, function (a) { var b = this.Ls; b !== a && (this.Ls = a, this.h("rotateAdornmentTemplate", b, a)) }); w.defineProperty(T, { wJ: "rotateObjectName" }, function () { return this.Ms }, function (a) { var b = this.Ms; b !== a && (this.Ms = a, this.jp = null, this.h("rotateObjectName", b, a)) }); w.u(T, { bG: "rotateObject" }, function () { if (null === this.jp) { var a = this.wJ; null !== a && "" !== a ? (a = this.xd(a), this.jp = null !== a ? a : this) : this.jp = this } return this.jp }); w.defineProperty(T, { text: "text" }, function () { return this.Hd }, function (a) { var b = this.Hd; b !== a && (this.Hd = a, this.h("text", b, a)) }); w.defineProperty(T, { Da: "containingGroup" }, function () { return this.$k }, function (a) { if (this.ee()) { var b = this.$k; if (b !== a) { null === a || this !== a && !a.qi(this) || (this === a && w.k("Cannot make a Group a member of itself: " + this.toString()), w.k("Cannot make a Group indirectly contain itself: " + this.toString() + " already contains " + a.toString())); this.J(Um); var c = this.g; null !== b ? jr(b, this) : this instanceof V && null !== c && c.zl.remove(this); this.$k = a; null !== a ? kr(a, this) : this instanceof V && null !== c && c.zl.add(this); this.J(Lm); if (null !== c) { var d = this.data, e = c.ba; null !== d && e instanceof R && e.jB(d, e.sb(null !== a ? a.data : null)) } d = this.xE; null !== d && (e = !0, null !== c && (e = c.Ta, c.Ta = !0), d(this, b, a), null !== c && (c.Ta = e)); if (this instanceof V) for (c = new I(T), ih(c, this, !0, 0, !0), c = c.i; c.next();)if (d = c.value, d instanceof U) for (d = d.ge; d.next();)pn(d.value); if (this instanceof U) { for (d = this.ge; d.next();)pn(d.value); c = this.Wb; null !== c && pn(c) } this.h("containingGroup", b, a); null !== a && (b = a.layer, null !== b && ol(b, -1, a)) } } else w.k("cannot set the Part.containingGroup of a Link or Adornment") }); g = T.prototype; g.Fk = function () { var a = this.Da; null !== a && (a.H(), null !== a.Kb && a.Kb.H(), a.Xf()) }; g.na = function () { var a = this.g; null !== a && !Dm(this) && !Em(this) && this.isVisible() && this.oc.I() && a.na(nl(this, this.oc)) }; g.H = function () { C.prototype.H.call(this); var a = this.g; null !== a && (a.vg.add(this), this instanceof U && null !== this.Wb && Ro(this.Wb), a.Me(!0)) }; g.$t = function (a) { a || (a = this.$k, null !== a && kr(a, this)) }; g.au = function (a) { a || (a = this.$k, null !== a && jr(a, this)) }; g.wn = function () { var a = this.data; if (null !== a) { var b = this.g; null !== b && (b = b.ba, null !== b && b.ay(a)) } }; w.defineProperty(T, { xE: "containingGroupChanged" }, function () { return this.Vq }, function (a) { var b = this.Vq; b !== a && (null !== a && w.j(a, "function", T, "containingGroupChanged"), this.Vq = a, this.h("containingGroupChanged", b, a)) }); T.prototype.findSubGraphLevel = function () { return lr(this, this) }; function lr(a, b) { var c = b.Da; return null !== c ? 1 + lr(a, c) : b instanceof U && (c = b.Wb, null !== c) ? lr(a, c) : 0 } T.prototype.findTopLevelPart = function () { return mr(this, this) }; function mr(a, b) { var c = b.Da; return null !== c ? mr(a, c) : b instanceof U && (c = b.Wb, null !== c) ? mr(a, c) : b } w.u(T, { $p: "isTopLevel" }, function () { return null !== this.Da || this instanceof U && null !== this.Wb ? !1 : !0 }); T.prototype.isMemberOf = T.prototype.qi = function (a) { return a instanceof V ? nr(this, this, a) : !1 }; function nr(a, b, c) { if (b === c || null === c) return !1; var d = b.Da; return null === d || d !== c && !nr(a, d, c) ? b instanceof U && (b = b.Wb, null !== b) ? nr(a, b, c) : !1 : !0 } T.prototype.findCommonContainingGroup = T.prototype.SH = function (a) { if (null === a) return null; if (this === a) return this.Da; for (var b = this; null !== b;) { b instanceof V && ir(b, !0); if (b instanceof U) { var c = b.Wb; null !== c && (b = c) } b = b.Da } for (var d = null, b = a; null !== b;) { if (0 !== (b.N & 1048576)) { d = b; break } b instanceof U && (c = b.Wb, null !== c && (b = c)); b = b.Da } for (b = this; null !== b;)b instanceof V && ir(b, !1), b instanceof U && (c = b.Wb, null !== c && (b = c)), b = b.Da; return d }; w.defineProperty(T, { II: "layoutConditions" }, function () { return this.Vr }, function (a) { var b = this.Vr; b !== a && (this.Vr = a, this.h("layoutConditions", b, a)) }); T.prototype.canLayout = function () { if (!this.tF || !this.isVisible()) return !1; var a = this.layer; return null !== a && a.Mc || this instanceof U && this.Af ? !1 : !0 }; T.prototype.invalidateLayout = T.prototype.J = function (a) { void 0 === a && (a = 16777215); var b; this.tF && 0 !== (a & this.II) ? (b = this.layer, null !== b && b.Mc || this instanceof U && this.Af ? b = !1 : (b = this.g, b = null !== b && b.oa.ab ? !1 : !0)) : b = !1; if (b) if (b = this.$k, null !== b) { var c = b.Tb; null !== c ? c.J() : b.J(a) } else a = this.g, null !== a && (c = a.Tb, null !== c && c.J()) }; function Qm(a) { if (!a.isVisible()) return !1; a = a.layer; return null !== a && a.Mc ? !1 : !0 } w.defineProperty(T, { HE: "dragComputation" }, function () { return this.or }, function (a) { var b = this.or; b !== a && (null !== a && w.j(a, "function", T, "dragComputation"), this.or = a, this.h("dragComputation", b, a)) }); w.defineProperty(T, { GJ: "shadowOffset" }, function () { return this.bn }, function (a) { var b = this.bn; b.L(a) || (this.bn = a = a.S(), this.na(), this.h("shadowOffset", b, a)) }); w.defineProperty(T, { shadowColor: "shadowColor" }, function () { return this.an }, function (a) { var b = this.an; b !== a && (this.an = a, this.na(), this.h("shadowColor", b, a)) }); w.defineProperty(T, { shadowBlur: "shadowBlur" }, function () { return this.Eg }, function (a) { var b = this.Eg; b !== a && (this.Eg = a, this.na(), this.h("shadowBlur", b, a)) }); function jh(a) { 0 === arguments.length ? T.call(this, Tj) : T.call(this, a); this.N &= -257; this.nl = "Adornment"; this.Fc = null; this.lD = 0; this.cE = !1; this.Kb = this.bh = null } w.Ka(jh, T); w.ga("Adornment", jh); jh.prototype.toString = function () { var a = this.uf; return "Adornment(" + this.ud + ")" + (null !== a ? a.toString() : "") }; jh.prototype.updateRelationshipsFromData = function () { }; jh.prototype.pu = function (a) { var b = this.rb.U, c = this.rb; if (b instanceof W && c instanceof Y) { var d = b.path, c = d.jf; b.pu(a); c = d.jf; a = this.xa.n; b = a.length; for (d = 0; d < b; d++) { var e = a[d]; e.Yf && e instanceof Y && (e.Ua = c) } } }; w.u(jh, { placeholder: "placeholder" }, function () { return this.Kb }); w.defineProperty(jh, { rb: "adornedObject" }, function () { return this.Fc }, function (a) { var b = this.uf, c = null; null !== a && (c = a.U); null === b || null !== a && b === c || b.Bj(this.ud); this.Fc = a; null !== c && c.Cl(this.ud, this) }); w.u(jh, { uf: "adornedPart" }, function () { var a = this.Fc; return null !== a ? a.U : null }); jh.prototype.$l = function () { var a = this.Fc; if (null === a) return !0; a = a.U; return null === a || !Dm(a) }; jh.prototype.ee = function () { return !1 }; w.u(jh, { Da: "containingGroup" }, function () { return null }); jh.prototype.Vn = function (a, b, c, d, e, f, h) { if (a === Qf && "elements" === b) if (e instanceof Nj) { var k = e; null === this.Kb ? this.Kb = k : this.Kb !== k && w.k("Cannot insert a second Placeholder into the visual tree of an Adornment.") } else e instanceof C && (k = e.Lt(function (a) { return a instanceof Nj }), k instanceof Nj && (null === this.Kb ? this.Kb = k : this.Kb !== k && w.k("Cannot insert a second Placeholder into the visual tree of an Adornment."))); else a === Rf && "elements" === b && null !== this.Kb && (d === this.Kb ? this.Kb = null : d instanceof C && this.Kb.Zl(d) && (this.Kb = null)); T.prototype.Vn.call(this, a, b, c, d, e, f, h) }; jh.prototype.updateAdornments = function () { }; jh.prototype.wn = function () { }; function U(a) { T.call(this, a); this.ya = 13; this.pc = new H(W); this.pt = this.Uo = this.pl = this.Xr = this.Wr = null; this.Oq = nd; this.ne = this.Lh = null; this.Es = or; this.qk = !1 } w.Ka(U, T); w.ga("Node", U); U.prototype.cloneProtected = function (a) { T.prototype.cloneProtected.call(this, a); a.ya = this.ya; a.ya = this.ya & -17; a.Wr = this.Wr; a.Xr = this.Xr; a.pl = this.pl; a.pt = this.pt; a.Oq = this.Oq.S(); a.Es = this.Es }; U.prototype.oi = function (a) { T.prototype.oi.call(this, a); a.Xf(); a.Lh = this.Lh; a.ne = null }; var pr; U.DirectionDefault = pr = w.p(U, "DirectionDefault", 0); U.DirectionAbsolute = w.p(U, "DirectionAbsolute", 1); var qr; U.DirectionRotatedNode = qr = w.p(U, "DirectionRotatedNode", 2); var xo; U.DirectionRotatedNodeOrthogonal = xo = w.p(U, "DirectionRotatedNodeOrthogonal", 3); U.SpreadingNone = w.p(U, "SpreadingNone", 10); var or; U.SpreadingEvenly = or = w.p(U, "SpreadingEvenly", 11); var rr; U.SpreadingPacked = rr = w.p(U, "SpreadingPacked", 12); function sr(a, b) { null !== b && (null === a.Lh && (a.Lh = new I(yl)), a.Lh.add(b)) } function tr(a, b, c, d) { if (null === b || null === a.Lh) return null; for (var e = a.Lh.i; e.next();) { var f = e.value; if (f.gq === a && f.uu === b && f.Sx === c && f.Tx === d || f.gq === b && f.uu === a && f.Sx === d && f.Tx === c) return f } return null } U.prototype.invalidateLinkBundle = function (a, b, c) { if (void 0 === b || null === b) b = ""; if (void 0 === c || null === c) c = ""; a = tr(this, a, b, c); null !== a && a.Yp() }; U.prototype.Vn = function (a, b, c, d, e, f, h) { a === Qf && "elements" === b ? this.ne = null : a === Rf && "elements" === b && (null === this.g ? this.ne = null : d instanceof G && $o(this, d, function (a, b) { Xo(a, b, !0) })); T.prototype.Vn.call(this, a, b, c, d, e, f, h) }; U.prototype.invalidateConnectedLinks = U.prototype.Xf = function (a) { void 0 === a && (a = null); for (var b = this.ge; b.next();) { var c = b.value; null !== a && a.contains(c) || (ur(this, c.Lc), ur(this, c.kd), c.$b()) } }; function Io(a, b) { for (var c = a.ge; c.next();) { var d = c.value; if (d.Lc === b || d.kd === b) ur(a, d.Lc), ur(a, d.kd), d.$b() } } function ur(a, b) { if (null !== b) { var c = b.Ds; null !== c && c.Yp(); c = a.Da; null === c || c.hd || ur(c, c.Ql("")) } } U.prototype.$l = function () { return !0 }; w.defineProperty(U, { jJ: "portSpreading" }, function () { return this.Es }, function (a) { var b = this.Es; b !== a && (this.Es = a, this.h("portSpreading", b, a), a = this.g, null !== a && a.oa.ab || this.Xf()) }); w.defineProperty(U, { Vz: "avoidable" }, function () { return 0 !== (this.ya & 8) }, function (a) { var b = 0 !== (this.ya & 8); if (b !== a) { this.ya ^= 8; var c = this.g; null !== c && c.AA(this); this.h("avoidable", b, a) } }); w.defineProperty(U, { nH: "avoidableMargin" }, function () { return this.Oq }, function (a) { "number" === typeof a ? a = new db(a) : w.G(a, db, U, "avoidableMargin"); var b = this.Oq; if (!b.L(a)) { this.Oq = a = a.S(); var c = this.g; null !== c && c.AA(this); this.h("avoidableMargin", b, a) } }); U.prototype.getAvoidableRect = function (a) { a.set(this.Y); a.Ow(this.nH); return a }; U.prototype.findVisibleNode = function () { for (var a = this; null !== a && !a.isVisible();)a = a.Da; return a }; U.prototype.isVisible = function () { if (!T.prototype.isVisible.call(this)) return !1; var a = !0, b = ul, c = this.g; if (null !== c) { a = c.Oa; if (a.mf && (a = a.Qm.ja(this), null !== a && a.Yx)) return !0; a = c.Sd; b = c.AB } if (b === ul) { if (c = this.Ak(), null !== c && !c.tc) return !1 } else if (b === Ym) { if (c = a ? this.OE() : this.PE(), 0 < c.count && c.all(function (a) { return !a.tc })) return !1 } else if (b === Zm && (c = a ? this.OE() : this.PE(), 0 < c.count && c.any(function (a) { return !a.tc }))) return !1; c = this.Wb; return null !== c ? c.isVisible() : !0 }; U.prototype.yd = function (a) { T.prototype.yd.call(this, a); for (var b = this.ge; b.next();)b.value.yd(a) }; w.u(U, { ge: "linksConnected" }, function () { return this.pc.i }); U.prototype.findLinksConnected = U.prototype.ME = function (a) { void 0 === a && (a = null); if (null === a) return this.pc.i; var b = new ya(this.pc), c = this; b.iq = function (b) { return b.V === c && b.Og === a || b.Z === c && b.Ih === a }; return b }; U.prototype.findLinksOutOf = U.prototype.nx = function (a) { void 0 === a && (a = null); var b = new ya(this.pc), c = this; b.iq = function (b) { return b.V !== c ? !1 : null === a ? !0 : b.Og === a }; return b }; U.prototype.findLinksInto = U.prototype.Ng = function (a) { void 0 === a && (a = null); var b = new ya(this.pc), c = this; b.iq = function (b) { return b.Z !== c ? !1 : null === a ? !0 : b.Ih === a }; return b }; U.prototype.findNodesConnected = U.prototype.NE = function (a) { void 0 === a && (a = null); for (var b = null, c = null, d = this.pc.i; d.next();) { var e = d.value; if (e.V === this) { if (null === a || e.Og === a) e = e.Z, null !== b ? b.add(e) : null !== c && c !== e ? (b = new I(U), b.add(c), b.add(e)) : c = e } else e.Z !== this || null !== a && e.Ih !== a || (e = e.V, null !== b ? b.add(e) : null !== c && c !== e ? (b = new I(U), b.add(c), b.add(e)) : c = e) } return null !== b ? b.i : null !== c ? new wa(c) : va }; U.prototype.findNodesOutOf = U.prototype.PE = function (a) { void 0 === a && (a = null); for (var b = null, c = null, d = this.pc.i; d.next();) { var e = d.value; e.V !== this || null !== a && e.Og !== a || (e = e.Z, null !== b ? b.add(e) : null !== c && c !== e ? (b = new I(U), b.add(c), b.add(e)) : c = e) } return null !== b ? b.i : null !== c ? new wa(c) : va }; U.prototype.findNodesInto = U.prototype.OE = function (a) { void 0 === a && (a = null); for (var b = null, c = null, d = this.pc.i; d.next();) { var e = d.value; e.Z !== this || null !== a && e.Ih !== a || (e = e.V, null !== b ? b.add(e) : null !== c && c !== e ? (b = new I(U), b.add(c), b.add(e)) : c = e) } return null !== b ? b.i : null !== c ? new wa(c) : va }; U.prototype.findLinksBetween = function (a, b, c) { void 0 === b && (b = null); void 0 === c && (c = null); var d = new ya(this.pc), e = this; d.iq = function (d) { return (d.V !== e || d.Z !== a || null !== b && d.Og !== b || null !== c && d.Ih !== c) && (d.V !== a || d.Z !== e || null !== c && d.Og !== c || null !== b && d.Ih !== b) ? !1 : !0 }; return d }; U.prototype.findLinksTo = function (a, b, c) { void 0 === b && (b = null); void 0 === c && (c = null); var d = new ya(this.pc), e = this; d.iq = function (d) { return d.V !== e || d.Z !== a || null !== b && d.Og !== b || null !== c && d.Ih === c ? !1 : !0 }; return d }; w.defineProperty(U, { KI: "linkConnected" }, function () { return this.Wr }, function (a) { var b = this.Wr; b !== a && (null !== a && w.j(a, "function", U, "linkConnected"), this.Wr = a, this.h("linkConnected", b, a)) }); w.defineProperty(U, { LI: "linkDisconnected" }, function () { return this.Xr }, function (a) { var b = this.Xr; b !== a && (null !== a && w.j(a, "function", U, "linkDisconnected"), this.Xr = a, this.h("linkDisconnected", b, a)) }); w.defineProperty(U, { Kx: "linkValidation" }, function () { return this.pl }, function (a) { var b = this.pl; b !== a && (null !== a && w.j(a, "function", U, "linkValidation"), this.pl = a, this.h("linkValidation", b, a)) }); function vr(a, b, c) { ur(a, c); var d = a.pc.contains(b); d || a.pc.add(b); if (!d || b.V === b.Z) { var e = a.KI; if (null !== e) { var f = !0, h = a.g; null !== h && (f = h.Ta, h.Ta = !0); e(a, b, c); null !== h && (h.Ta = f) } } !d && b.Nc && (c = b.V, b = b.Z, null !== c && null !== b && c !== b && (d = !0, h = a.g, null !== h && (d = h.Sd), a = d ? b : c, e = d ? c : b, a.qk || (a.qk = e), !e.wj || null !== h && h.oa.ab || (d ? c === e && (e.wj = !1) : b === e && (e.wj = !1)))) } function wr(a, b, c) { ur(a, c); var d = a.pc.remove(b); if (d || b.Z === b.V) { var e = a.LI, f = a.g; if (null !== e) { var h = !0; null !== f && (h = f.Ta, f.Ta = !0); e(a, b, c); null !== f && (f.Ta = h) } } d && b.Nc && (c = !0, null !== f && (c = f.Sd), a = c ? b.Z : b.V, b = c ? b.V : b.Z, null !== a && (a.qk = !1), null === b || b.wj || (0 === b.pc.count ? (b.qk = null, null !== f && f.oa.ab || (b.wj = !0)) : Bn(b))) } function Bn(a) { a.qk = !1; if (0 !== a.pc.count) { var b = !0, c = a.g; if (null === c || !c.oa.ab) { null !== c && (b = c.Sd); for (c = a.pc.i; c.next();) { var d = c.value; if (d.Nc) if (b) { if (d.V === a) { a.wj = !1; return } } else if (d.Z === a) { a.wj = !1; return } } a.wj = !0 } } } U.prototype.updateRelationshipsFromData = function () { T.prototype.updateRelationshipsFromData.call(this); var a = this.data; if (null !== a) { var b = this.g; if (null !== b) { var c = b.ba; c instanceof ag && (a = c.Cn(a), a = b.Je(a), c = this.Ak(), a !== c && (c = this.yn(), null !== a ? null !== c ? b.Sd ? c.V = a : c.Z = a : dn(b, a, this) : null !== c && Tm(b, c, !1))) } } }; U.prototype.$t = function (a) { T.prototype.$t.call(this, a); a || (Bn(this), a = this.Uo, null !== a && xr(a, this)) }; U.prototype.au = function (a) { T.prototype.au.call(this, a); a || (a = this.Uo, null !== a && null !== a.rf && (a.rf.remove(this), a.H())) }; U.prototype.wn = function () { if (0 < this.pc.count) { var a = this.g; if (null !== a) for (var b = a.ob.GE, c = this.pc.copy().i; c.next();) { var d = c.value; b ? a.remove(d) : (d.V === this && (d.V = null), d.Z === this && (d.Z = null)) } } this.Wb = null; T.prototype.wn.call(this) }; w.u(U, { Af: "isLinkLabel" }, function () { return null !== this.Uo }); w.defineProperty(U, { Wb: "labeledLink" }, function () { return this.Uo }, function (a) { var b = this.Uo; if (b !== a) { var c = this.g, d = this.data; if (null !== b) { null !== b.rf && (b.rf.remove(this), b.H()); if (null !== c && null !== d && !c.oa.ab) { var e = b.data, f = c.ba; if (null !== e && f instanceof R) { var h = f.sb(d); void 0 !== h && f.oJ(e, h) } } this.Da = null } this.Uo = a; null !== a && (xr(a, this), null === c || null === d || c.oa.ab || (e = a.data, f = c.ba, null !== e && f instanceof R && (h = f.sb(d), void 0 !== h && f.jE(e, h))), this.Da = a.Da); Ro(this); this.h("labeledLink", b, a) } }); U.prototype.findPort = U.prototype.Ql = function (a) { if (null === this.ne) { if ("" === a && !1 === this.Ek) return this; Yo(this) } var b = this.ne.ja(a); return null !== b || "" !== a && (b = this.ne.ja(""), null !== b) ? b : this }; w.u(U, { port: "port" }, function () { return this.Ql("") }); w.u(U, { ports: "ports" }, function () { null === this.ne && Yo(this); return this.ne.yF }); function Yo(a) { null === a.ne ? a.ne = new la("string", G) : a.ne.clear(); $o(a, a, function (a, c) { var d = c.Td; null !== d && a.ne.add(d, c) }); 0 === a.ne.count && a.ne.add("", a) } function Xo(a, b, c) { var d = b.Td; if (null !== d && (null !== a.ne && a.ne.remove(d), b = a.g, null !== b && c)) { c = null; for (d = a.ME(d); d.next();)a = d.value, null === c && (c = w.cb()), c.push(a); if (null !== c) { for (d = 0; d < c.length; d++)a = c[d], b.remove(a); w.ua(c) } } } U.prototype.isInTreeOf = function (a) { if (null === a || a === this) return !1; var b = !0, c = this.g; null !== c && (b = c.Sd); c = this; if (b) for (; c !== a;) { for (var b = null, d = c.pc.i; d.next();) { var e = d.value; if (e.Nc && (b = e.V, b !== c && b !== this)) break } if (b === this || null === b || b === c) return !1; c = b } else for (; c !== a;) { b = null; for (d = c.pc.i; d.next() && (e = d.value, !e.Nc || (b = e.Z, b === c || b === this));); if (b === this || null === b || b === c) return !1; c = b } return !0 }; U.prototype.findTreeRoot = function () { var a = !0, b = this.g; null !== b && (a = b.Sd); b = this; if (a) for (; ;) { for (var a = null, c = b.pc.i; c.next();) { var d = c.value; if (d.Nc && (a = d.V, a !== b && a !== this)) break } if (a === this) return this; if (null === a || a === b) return b; b = a } else for (; ;) { a = null; for (c = b.pc.i; c.next() && (d = c.value, !d.Nc || (a = d.Z, a === b || a === this));); if (a === this) return this; if (null === a || a === b) return b; b = a } }; U.prototype.findCommonTreeParent = function (a) { if (null === a) return null; if (this === a) return this; for (var b = this; null !== b;)ir(b, !0), b = b.Ak(); for (var c = null, b = a; null !== b;) { if (0 !== (b.N & 1048576)) { c = b; break } b = b.Ak() } for (b = this; null !== b;)ir(b, !1), b = b.Ak(); return c }; U.prototype.findTreeParentLink = U.prototype.yn = function () { var a = !0, b = this.g; null !== b && (a = b.Sd); b = this.pc.i; if (a) for (; b.next();) { if (a = b.value, a.Nc && a.V !== this) return a } else for (; b.next();)if (a = b.value, a.Nc && a.Z !== this) return a; return null }; U.prototype.findTreeParentNode = U.prototype.Ak = function () { var a = this.qk; if (null === a) return null; if (a instanceof U) return a; var b = !0, a = this.g; null !== a && (b = a.Sd); a = this.pc.i; if (b) for (; a.next();) { if (b = a.value, b.Nc && (b = b.V, b !== this)) return this.qk = b } else for (; a.next();)if (b = a.value, b.Nc && (b = b.Z, b !== this)) return this.qk = b; return this.qk = null }; U.prototype.findTreeParentChain = function () { function a(b, d) { if (null !== b) { d.add(b); var e = b.yn(); null !== e && (d.add(e), a(b.Ak(), d)) } } var b = new I(T); a(this, b); return b }; U.prototype.findTreeLevel = function () { return yr(this, this) }; function yr(a, b) { var c = b.Ak(); return null === c ? 0 : 1 + yr(a, c) } U.prototype.findTreeChildrenLinks = U.prototype.px = function () { var a = !0, b = this.g; null !== b && (a = b.Sd); var b = new ya(this.pc), c = this; b.iq = a ? function (a) { return a.Nc && a.V === c ? !0 : !1 } : function (a) { return a.Nc && a.Z === c ? !0 : !1 }; return b }; U.prototype.findTreeChildrenNodes = U.prototype.RE = function () { var a = !0, b = this.g; null !== b && (a = b.Sd); var c = b = null, d = this.pc.i; if (a) for (; d.next();)a = d.value, a.Nc && a.V === this && (a = a.Z, null !== b ? b.add(a) : null !== c && c !== a ? (b = new H(U), b.add(c), b.add(a)) : c = a); else for (; d.next();)a = d.value, a.Nc && a.Z === this && (a = a.V, null !== b ? b.add(a) : null !== c && c !== a ? (b = new H(U), b.add(c), b.add(a)) : c = a); return null !== b ? b.i : null !== c ? new wa(c) : va }; U.prototype.findTreeParts = function (a) { void 0 === a && (a = Infinity); w.j(a, "number", U, "findTreeParts:level"); var b = new I(T); ih(b, this, !1, a, !0); return b }; U.prototype.collapseTree = U.prototype.collapseTree = function (a) { void 0 === a && (a = 1); w.vd(a, U, "collapseTree:level"); 1 > a && (a = 1); var b = this.g; if (null !== b && !b.yh) { b.yh = !0; var c = new I(U); c.add(this); zr(this, c, b.Sd, a, b.Oa, this, b.AB === ul); b.yh = !1 } }; function zr(a, b, c, d, e, f, h) { if (1 < d) for (var k = c ? a.nx() : a.Ng(); k.next();) { var l = k.value; l.Nc && (l = l.rA(a), null === l || l === a || b.contains(l) || (b.add(l), zr(l, b, c, d - 1, e, f, h))) } else Ar(a, b, c, e, f, h) } function Ar(a, b, c, d, e, f) { for (var h = e === a ? !0 : a.tc, k = c ? a.nx() : a.Ng(); k.next();) { var l = k.value; l.Nc && (l = l.rA(a), null === l || l === a || b.contains(l) || (b.add(l), h && (f && gl(d, l, e), l.Fk(), l.yd(!1)), l.tc && (l.zq = l.tc, Ar(l, b, c, d, e, f)))) } a.tc = !1 } U.prototype.expandTree = U.prototype.expandTree = function (a) { void 0 === a && (a = 2); w.vd(a, U, "expandTree:level"); 2 > a && (a = 2); var b = this.g; if (null !== b && !b.yh) { b.yh = !0; var c = new I(U); c.add(this); Br(this, c, b.Sd, a, b.Oa, this, b.AB === ul); b.yh = !1 } }; function Br(a, b, c, d, e, f, h) { for (var k = f === a ? !1 : a.tc, l = c ? a.nx() : a.Ng(); l.next();) { var m = l.value; m.Nc && (k || m.kg || m.$b(), m = m.rA(a), null !== m && m !== a && !b.contains(m) && (b.add(m), k || (m.yd(!0), m.Fk(), h && fl(e, m, f)), 2 < d || m.zq)) && (m.zq = !1, Br(m, b, c, d - 1, e, f, h)) } a.tc = !0 } w.defineProperty(U, { tc: "isTreeExpanded" }, function () { return 0 !== (this.ya & 1) }, function (a) { var b = 0 !== (this.ya & 1); if (b !== a) { this.ya ^= 1; var c = this.g; this.h("isTreeExpanded", b, a); b = this.UJ; if (null !== b) { var d = !0; null !== c && (d = c.Ta, c.Ta = !0); b(this); null !== c && (c.Ta = d) } null !== c && c.oa.ab ? this.yd(a) : a ? this.expandTree() : this.collapseTree() } }); w.defineProperty(U, { zq: "wasTreeExpanded" }, function () { return 0 !== (this.ya & 2) }, function (a) { var b = 0 !== (this.ya & 2); b !== a && (this.ya ^= 2, this.h("wasTreeExpanded", b, a)) }); w.defineProperty(U, { UJ: "treeExpandedChanged" }, function () { return this.pt }, function (a) { var b = this.pt; b !== a && (null !== a && w.j(a, "function", U, "treeExpandedChanged"), this.pt = a, this.h("treeExpandedChanged", b, a)) }); w.defineProperty(U, { wj: "isTreeLeaf" }, function () { return 0 !== (this.ya & 4) }, function (a) { var b = 0 !== (this.ya & 4); b !== a && (this.ya ^= 4, this.h("isTreeLeaf", b, a)) }); function W() { T.call(this, hj); this.Yb = 8; this.rg = null; this.Rh = ""; this.Hg = this.yr = null; this.li = ""; this.ot = null; this.Gq = kj; this.ar = 0; this.dr = kj; this.er = NaN; this.Vm = Cr; this.ct = .5; this.rf = null; this.dd = (new H(z)).freeze(); this.bh = this.vC = this.pC = this.wi = this.Ji = this.Ua = this.qw = this.kp = this.We = null; this.Jz = new z; this.W = this.OD = this.ND = null } w.Ka(W, T); w.ga("Link", W); W.prototype.cloneProtected = function (a) { T.prototype.cloneProtected.call(this, a); a.Yb = this.Yb & -113; a.Rh = this.Rh; a.yr = this.yr; a.li = this.li; a.ot = this.ot; a.Gq = this.Gq; a.ar = this.ar; a.dr = this.dr; a.er = this.er; a.Vm = this.Vm; a.ct = this.ct; null !== this.W && (a.W = this.W.copy()) }; W.prototype.oi = function (a) { T.prototype.oi.call(this, a); this.Rh = a.Rh; this.li = a.li; a.We = null; a.$b(); a.wi = this.wi }; W.prototype.ic = function (a) { a.Ee === W ? 2 === (a.value & 2) ? this.ey = a : a === Jj || a === jj || a === ij ? this.$e = a : a === Dr || a === Er || a === Fr ? this.yt = a : a !== Cr && a !== kj && w.k("Unknown Link enum value for a Link property: " + a) : T.prototype.ic.call(this, a) }; var Cr; W.Normal = Cr = w.p(W, "Normal", 1); W.Orthogonal = w.p(W, "Orthogonal", 2); W.AvoidsNodes = w.p(W, "AvoidsNodes", 6); var Gr; W.AvoidsNodesStraight = Gr = w.p(W, "AvoidsNodesStraight", 7); var kj; W.None = kj = w.p(W, "None", 0); var Jj; W.Bezier = Jj = w.p(W, "Bezier", 9); var jj; W.JumpGap = jj = w.p(W, "JumpGap", 10); var ij; W.JumpOver = ij = w.p(W, "JumpOver", 11); var Dr; W.End = Dr = w.p(W, "End", 17); var Er; W.Scale = Er = w.p(W, "Scale", 18); var Fr; W.Stretch = Fr = w.p(W, "Stretch", 19); var pq; W.OrientAlong = pq = w.p(W, "OrientAlong", 21); var Rp; W.OrientPlus90 = Rp = w.p(W, "OrientPlus90", 22); var Tp; W.OrientMinus90 = Tp = w.p(W, "OrientMinus90", 23); var Hr; W.OrientOpposite = Hr = w.p(W, "OrientOpposite", 24); var Ir; W.OrientUpright = Ir = w.p(W, "OrientUpright", 25); var Sp; W.OrientPlus90Upright = Sp = w.p(W, "OrientPlus90Upright", 26); var Up; W.OrientMinus90Upright = Up = w.p(W, "OrientMinus90Upright", 27); var Vp; W.OrientUpright45 = Vp = w.p(W, "OrientUpright45", 28); g = W.prototype; g.Od = function () { null === this.W && (this.W = new wo) }; g.$l = function () { var a = this.V; if (null !== a) { var b = a.findVisibleNode(); null !== b && (a = b); if (Dm(a) || Em(a)) return !1 } a = this.Z; return null !== a && (b = a.findVisibleNode(), null !== b && (a = b), Dm(a) || Em(a)) ? !1 : !0 }; g.lB = function () { return !1 }; g.mB = function () { }; g.ee = function () { return !1 }; W.prototype.computeAngle = function (a, b, c) { return W.computeAngle(b, c) }; W.computeAngle = function (a, b) { var c = 0; switch (a) { default: case kj: c = 0; break; case pq: c = b; break; case Rp: c = b + 90; break; case Tp: c = b - 90; break; case Hr: c = b + 180; break; case Ir: c = ye(b); 90 < c && 270 > c && (c -= 180); break; case Sp: c = ye(b + 90); 90 < c && 270 > c && (c -= 180); break; case Up: c = ye(b - 90); 90 < c && 270 > c && (c -= 180); break; case Vp: c = ye(b); if (45 < c && 135 > c || 225 < c && 315 > c) return 0; 90 < c && 270 > c && (c -= 180) }return ye(c) }; w.defineProperty(W, { V: "fromNode" }, function () { return this.rg }, function (a) { var b = this.rg; if (b !== a) { var c = this.Lc; null !== b && (this.Hg !== b && wr(b, this, c), Jr(this), this.J(Um)); this.rg = a; null !== a && this.yd(a.isVisible()); this.Ji = null; this.$b(); var d = this.g; if (null !== d) { var e = this.data, f = d.ba; if (null !== e) if (f instanceof R) { var h = null !== a ? a.data : null; f.hB(e, f.sb(h)) } else f instanceof ag && (h = null !== a ? a.data : null, d.Sd ? f.si(e, f.sb(h)) : (null !== b && f.si(b.data, void 0), f.si(h, f.sb(null !== this.Hg ? this.Hg.data : null)))) } e = this.Lc; f = this.UE; null !== f && (h = !0, null !== d && (h = d.Ta, d.Ta = !0), f(this, c, e), null !== d && (d.Ta = h)); null !== a && (this.Hg !== a && vr(a, this, e), Kr(this), this.J(Lm)); this.h("fromNode", b, a); pn(this) } }); w.defineProperty(W, { Og: "fromPortId" }, function () { return this.Rh }, function (a) { var b = this.Rh; if (b !== a) { var c = this.Lc; null !== c && ur(this.V, c); Jr(this); this.Rh = a; var d = this.Lc; null !== d && ur(this.V, d); var e = this.g; if (null !== e) { var f = this.data, h = e.ba; null !== f && h instanceof R && h.iB(f, a) } c !== d && (this.Ji = null, this.$b(), f = this.UE, null !== f && (h = !0, null !== e && (h = e.Ta, e.Ta = !0), f(this, c, d), null !== e && (e.Ta = h))); Kr(this); this.h("fromPortId", b, a) } }); w.u(W, { Lc: "fromPort" }, function () { var a = this.rg; return null === a ? null : a.Ql(this.Rh) }); w.defineProperty(W, { UE: "fromPortChanged" }, function () { return this.yr }, function (a) { var b = this.yr; b !== a && (null !== a && w.j(a, "function", W, "fromPortChanged"), this.yr = a, this.h("fromPortChanged", b, a)) }); w.defineProperty(W, { Z: "toNode" }, function () { return this.Hg }, function (a) { var b = this.Hg; if (b !== a) { var c = this.kd; null !== b && (this.rg !== b && wr(b, this, c), Jr(this), this.J(Um)); this.Hg = a; null !== a && this.yd(a.isVisible()); this.Ji = null; this.$b(); var d = this.g; if (null !== d) { var e = this.data, f = d.ba; if (null !== e) if (f instanceof R) { var h = null !== a ? a.data : null; f.nB(e, f.sb(h)) } else f instanceof ag && (h = null !== a ? a.data : null, d.Sd ? (null !== b && f.si(b.data, void 0), f.si(h, f.sb(null !== this.rg ? this.rg.data : null))) : f.si(e, f.sb(h))) } e = this.kd; f = this.uG; null !== f && (h = !0, null !== d && (h = d.Ta, d.Ta = !0), f(this, c, e), null !== d && (d.Ta = h)); null !== a && (this.rg !== a && vr(a, this, e), Kr(this), this.J(Lm)); this.h("toNode", b, a); pn(this) } }); w.defineProperty(W, { Ih: "toPortId" }, function () { return this.li }, function (a) { var b = this.li; if (b !== a) { var c = this.kd; null !== c && ur(this.Z, c); Jr(this); this.li = a; var d = this.kd; null !== d && ur(this.Z, d); var e = this.g; if (null !== e) { var f = this.data, h = e.ba; null !== f && h instanceof R && h.oB(f, a) } c !== d && (this.Ji = null, this.$b(), f = this.uG, null !== f && (h = !0, null !== e && (h = e.Ta, e.Ta = !0), f(this, c, d), null !== e && (e.Ta = h))); Kr(this); this.h("toPortId", b, a) } }); w.u(W, { kd: "toPort" }, function () { var a = this.Hg; return null === a ? null : a.Ql(this.li) }); w.defineProperty(W, { uG: "toPortChanged" }, function () { return this.ot }, function (a) { var b = this.ot; b !== a && (null !== a && w.j(a, "function", W, "toPortChanged"), this.ot = a, this.h("toPortChanged", b, a)) }); w.defineProperty(W, { Ab: "fromSpot" }, function () { return null !== this.W ? this.W.Sj : rc }, function (a) { this.Od(); var b = this.W.Sj; b.L(a) || (a = a.S(), this.W.Sj = a, this.h("fromSpot", b, a), this.$b()) }); w.defineProperty(W, { Sl: "fromEndSegmentLength" }, function () { return null !== this.W ? this.W.Qj : NaN }, function (a) { this.Od(); var b = this.W.Qj; b !== a && (0 > a && w.Fa(a, ">= 0", W, "fromEndSegmentLength"), this.W.Qj = a, this.h("fromEndSegmentLength", b, a), this.$b()) }); w.defineProperty(W, { Vt: "fromEndSegmentDirection" }, function () { return null !== this.W ? this.W.Pj : pr }, function (a) { this.Od(); var b = this.W.Pj; b !== a && (w.Ht("Link.fromEndSegmentDirection", "2.0"), this.W.Pj = a, this.h("fromEndSegmentDirection", b, a), this.$b()) }); w.defineProperty(W, { Wt: "fromShortLength" }, function () { return null !== this.W ? this.W.Rj : NaN }, function (a) { this.Od(); var b = this.W.Rj; b !== a && (this.W.Rj = a, this.h("fromShortLength", b, a), this.$b()) }); w.defineProperty(W, { Bb: "toSpot" }, function () { return null !== this.W ? this.W.pk : rc }, function (a) { this.Od(); var b = this.W.pk; b.L(a) || (a = a.S(), this.W.pk = a, this.h("toSpot", b, a), this.$b()) }); w.defineProperty(W, { km: "toEndSegmentLength" }, function () { return null !== this.W ? this.W.nk : NaN }, function (a) { this.Od(); var b = this.W.nk; b !== a && (0 > a && w.Fa(a, ">= 0", W, "toEndSegmentLength"), this.W.nk = a, this.h("toEndSegmentLength", b, a), this.$b()) }); w.defineProperty(W, { Ou: "toEndSegmentDirection" }, function () { return null !== this.W ? this.W.mk : pr }, function (a) { this.Od(); var b = this.W.mk; b !== a && (w.Ht("Link.toEndSegmentDirection", "2.0"), this.W.mk = a, this.h("toEndSegmentDirection", b, a), this.$b()) }); w.defineProperty(W, { Pu: "toShortLength" }, function () { return null !== this.W ? this.W.ok : NaN }, function (a) { this.Od(); var b = this.W.ok; b !== a && (this.W.ok = a, this.h("toShortLength", b, a), this.$b()) }); function pn(a) { var b = a.V, c = a.Z, d = null, b = d = null !== b ? null !== c ? b.SH(c) : b.Da : null !== c ? c.Da : null, c = a.$k; if (c !== b) { null !== c && jr(c, a); a.$k = b; null !== b && kr(b, a); var e = a.xE; if (null !== e) { var f = !0, h = a.g; null !== h && (f = h.Ta, h.Ta = !0); e(a, c, b); null !== h && (h.Ta = f) } !a.kg || a.ND !== c && a.OD !== c || a.$b() } if (a.xI) for (a = a.Df; a.next();)a.value.Da = d } W.prototype.Fk = function () { var a = this.Da; null !== a && this.V !== a && this.Z !== a && a.Yw && T.prototype.Fk.call(this) }; W.prototype.getOtherNode = W.prototype.rA = function (a) { var b = this.V; return a === b ? this.Z : b }; W.prototype.getOtherPort = function (a) { var b = this.Lc; return a === b ? this.kd : b }; w.u(W, { xI: "isLabeledLink" }, function () { return null === this.rf ? !1 : 0 < this.rf.count }); w.u(W, { Df: "labelNodes" }, function () { return null === this.rf ? va : this.rf.i }); function xr(a, b) { null === a.rf && (a.rf = new I(U)); a.rf.add(b); a.H() } W.prototype.$t = function (a) { T.prototype.$t.call(this, a); Lr(this) && lj(this, this.Y); if (!a) { a = this.rg; var b = null; null !== a && (b = this.Lc, vr(a, this, b)); var c = this.Hg, d = null; null !== c && (d = this.kd, c === a && d === b || vr(c, this, d)); Kr(this) } }; W.prototype.au = function (a) { T.prototype.au.call(this, a); Lr(this) && lj(this, this.Y); if (!a) { a = this.rg; var b = null; null !== a && (b = this.Lc, wr(a, this, b)); var c = this.Hg, d = null; null !== c && (d = this.kd, c === a && d === b || wr(c, this, d)); Jr(this) } }; W.prototype.wn = function () { this.kg = !0; if (null !== this.rf) { var a = this.g; if (null !== a) for (var b = this.rf.copy().i; b.next();)a.remove(b.value) } b = this.data; null !== b && (a = this.g, null !== a && (a = a.ba, a instanceof R ? a.$x(b) : a instanceof ag && a.si(b, void 0))) }; W.prototype.updateRelationshipsFromData = function () { var a = this.data; if (null !== a) { var b = this.g; if (null !== b) { var c = b.ba; if (c instanceof R) { var d = c.Ul(a); this.V = d = b.Je(d); d = c.Vl(a); this.Z = d = b.Je(d); a = c.Ck(a); if (0 < a.length || 0 < this.Df.count) { if (1 === a.length && 1 === this.Df.count) { var d = a[0], e = this.Df.first(); if (c.sb(e.data) === d) return } var d = (new I).Jc(a), f = new I; this.Df.each(function (a) { null !== a.data && (a = c.sb(a.data), void 0 !== a && f.add(a)) }); a = f.copy(); a.Zx(d); d = d.copy(); d.Zx(f); if (0 < a.count || 0 < d.count) { var h = this; a.each(function (a) { a = b.Je(a); null !== a && a.Wb === h && (a.Wb = null) }); d.each(function (a) { a = b.Je(a); null !== a && a.Wb !== h && (a.Wb = h) }) } } } } } }; W.prototype.move = function (a) { var b = this.position, c = b.x; isNaN(c) && (c = 0); b = b.y; isNaN(b) && (b = 0); c = a.x - c; b = a.y - b; T.prototype.move.call(this, a); this.Ik(c, b); for (a = this.Df; a.next();) { var d = a.value, e = d.position; d.moveTo(e.x + c, e.y + b) } }; w.defineProperty(W, { mJ: "relinkableFrom" }, function () { return 0 !== (this.Yb & 1) }, function (a) { var b = 0 !== (this.Yb & 1); b !== a && (this.Yb ^= 1, this.h("relinkableFrom", b, a), this.de()) }); w.defineProperty(W, { nJ: "relinkableTo" }, function () { return 0 !== (this.Yb & 2) }, function (a) { var b = 0 !== (this.Yb & 2); b !== a && (this.Yb ^= 2, this.h("relinkableTo", b, a), this.de()) }); W.prototype.canRelinkFrom = function () { if (!this.mJ) return !1; var a = this.layer; if (null === a) return !0; if (!a.jn) return !1; a = a.g; return null === a || a.jn ? !0 : !1 }; W.prototype.canRelinkTo = function () { if (!this.nJ) return !1; var a = this.layer; if (null === a) return !0; if (!a.jn) return !1; a = a.g; return null === a || a.jn ? !0 : !1 }; w.defineProperty(W, { Du: "resegmentable" }, function () { return 0 !== (this.Yb & 4) }, function (a) { var b = 0 !== (this.Yb & 4); b !== a && (this.Yb ^= 4, this.h("resegmentable", b, a), this.de()) }); w.defineProperty(W, { Nc: "isTreeLink" }, function () { return 0 !== (this.Yb & 8) }, function (a) { var b = 0 !== (this.Yb & 8); b !== a && (this.Yb ^= 8, this.h("isTreeLink", b, a), null !== this.V && Bn(this.V), null !== this.Z && Bn(this.Z)) }); w.u(W, { path: "path" }, function () { var a = this.Kd(); return a instanceof Y ? a : null }); w.u(W, { Wn: "routeBounds" }, function () { this.co(); var a = new B; var b = Infinity, c = Infinity, d = this.qa; if (0 === d) a.m(NaN, NaN, 0, 0); else { if (1 === d) d = this.l(0), b = Math.min(d.x, b), c = Math.min(d.y, c), a.m(d.x, d.y, 0, 0); else if (2 === d) { var e = this.l(0), f = this.l(1), b = Math.min(e.x, f.x), c = Math.min(e.y, f.y); a.m(e.x, e.y, 0, 0); a.ui(f) } else if (this.computeCurve() === Jj && 3 <= d && !this.ac) if (e = this.l(0), b = e.x, c = e.y, a.m(b, c, 0, 0), 3 === d) d = this.l(1), b = Math.min(d.x, b), c = Math.min(d.y, c), f = this.l(2), b = Math.min(f.x, b), c = Math.min(f.y, c), Yd(e.x, e.y, d.x, d.y, d.x, d.y, f.x, f.y, .5, a); else for (var h = 3; h < d; h += 3) { var k = this.l(h - 2); h + 3 >= d && (h = d - 1); var l = this.l(h - 1), f = this.l(h); Yd(e.x, e.y, k.x, k.y, l.x, l.y, f.x, f.y, .5, a); b = Math.min(f.x, b); c = Math.min(f.y, c); e = f } else for (e = this.l(0), f = this.l(1), b = Math.min(e.x, f.x), c = Math.min(e.y, f.y), a.m(e.x, e.y, 0, 0), a.ui(f), h = 2; h < d; h++)e = this.l(h), b = Math.min(e.x, b), c = Math.min(e.y, c), a.ui(e); this.Jz.m(b - a.x, c - a.y) } return this.qw = a }); w.u(W, { EF: "midPoint" }, function () { this.co(); return this.computeMidPoint(new z) }); W.prototype.computeMidPoint = function (a) { var b = this.qa; if (0 === b) return a.assign(Fd), a; if (1 === b) return a.assign(this.l(0)), a; if (2 === b) { var c = this.l(0), d = this.l(1); a.m((c.x + d.x) / 2, (c.y + d.y) / 2); return a } if (this.computeCurve() === Jj && 3 <= b && !this.ac) { if (3 === b) return this.l(1); var c = (b - 1) / 3 | 0, e = 3 * (c / 2 | 0); if (1 === c % 2) { var c = this.l(e), d = this.l(e + 1), f = this.l(e + 2), e = this.l(e + 3), b = d.x, h = d.y, d = f.x, k = f.y, f = (b + d) / 2, l = (h + k) / 2, h = ((c.y + h) / 2 + l) / 2, k = (l + (k + e.y) / 2) / 2; a.x = (((c.x + b) / 2 + f) / 2 + (f + (d + e.x) / 2) / 2) / 2; a.y = (h + k) / 2 } else a.assign(this.l(e)); return a } e = 0; f = w.cb(); for (h = 0; h < b - 1; h++)c = 0, c = this.l(h), d = this.l(h + 1), Va(c.x, d.x) ? (c = d.y - c.y, 0 > c && (c = -c)) : Va(c.y, d.y) ? (c = d.x - c.x, 0 > c && (c = -c)) : c = Math.sqrt(c.wf(d)), f.push(c), e += c; for (d = h = c = 0; c < e / 2 && h < b;) { d = f[h]; if (c + d > e / 2) break; c += d; h++ } w.ua(f); b = this.l(h); f = this.l(h + 1); b.x === f.x ? b.y > f.y ? a.m(b.x, b.y - (e / 2 - c)) : a.m(b.x, b.y + (e / 2 - c)) : b.y === f.y ? b.x > f.x ? a.m(b.x - (e / 2 - c), b.y) : a.m(b.x + (e / 2 - c), b.y) : (c = (e / 2 - c) / d, a.m(b.x + c * (f.x - b.x), b.y + c * (f.y - b.y))); return a }; w.u(W, { DF: "midAngle" }, function () { this.co(); return this.computeMidAngle() }); W.prototype.computeMidAngle = function () { var a = this.qa; if (2 > a) return NaN; if (this.computeCurve() === Jj && 4 <= a && !this.ac) { var b = (a - 1) / 3 | 0, c = 3 * (b / 2 | 0); if (1 === b % 2) { var c = Math.floor(c), b = this.l(c), d = this.l(c + 1), a = this.l(c + 2), c = this.l(c + 3), e = d.x, d = d.y, f = a.x, a = a.y, h = (e + f) / 2, k = (d + a) / 2; return Oa(((b.x + e) / 2 + h) / 2, ((b.y + d) / 2 + k) / 2, (h + (f + c.x) / 2) / 2, (k + (a + c.y) / 2) / 2) } if (0 < c && c + 1 < a) return b = this.l(c - 1), d = this.l(c + 1), b.Ob(d) } c = a / 2 | 0; if (0 === a % 2) return b = this.l(c - 1), d = this.l(c), 4 <= a && b.Kc(d) ? (b = this.l(c - 2), a = this.l(c + 1), c = b.wf(d), e = d.wf(a), c > e + 10 ? b.Ob(d) : e > c + 10 ? d.Ob(a) : b.Ob(a)) : null === this.Ua || this.ac ? b.Ob(d) : this.Ua.VE(.5); if (null !== this.Ua && !this.ac) return this.Ua.VE(.5); b = this.l(c - 1); d = this.l(c); a = this.l(c + 1); c = b.wf(d); e = d.wf(a); return c > e + 10 ? b.Ob(d) : e > c + 10 ? d.Ob(a) : b.Ob(a) }; w.defineProperty(W, { points: "points" }, function () { return this.dd }, function (a) { var b = this.dd; if (b !== a) { var c = null; if (Array.isArray(a)) { var d = 0 === a.length % 2; if (d) for (var e = 0; e < a.length; e++)if ("number" !== typeof a[e] || isNaN(a[e])) { d = !1; break } if (d) for (c = new H(z), d = 0; d < a.length / 2; d++)e = (new z(a[2 * d], a[2 * d + 1])).freeze(), c.add(e); else { e = !0; for (d = 0; d < a.length; d++) { var f = a[d]; if (!w.Pa(f) || "number" !== typeof f.x || isNaN(f.x) || "number" !== typeof f.y || isNaN(f.y)) { e = !1; break } } if (e) for (c = new H(z), d = 0; d < a.length; d++)e = a[d], c.add((new z(e.x, e.y)).freeze()); else w.k("Link.points array must contain only an even number of numbers or objects with x and y properties, not: " + a) } } else if (a instanceof H) for (c = a.copy(), a = c.i; a.next();)a.value.freeze(); else w.k("Link.points value is not an instance of List or Array: " + a); c.freeze(); this.dd = c; this.Le(); this.H(); Mr(this); a = this.g; null !== a && (a.Hn || a.oa.ab || a.Lx.add(this), a.Oa.qc && (this.kp = c)); this.h("points", b, c) } }); w.u(W, { qa: "pointsCount" }, function () { return this.dd.count }); W.prototype.getPoint = W.prototype.l = function (a) { return this.dd.n[a] }; W.prototype.setPoint = W.prototype.Xg = function (a, b) { null === this.We && w.k("Call Link.startRoute before modifying the points of the route."); this.dd.ig(a, b) }; W.prototype.setPointAt = W.prototype.ca = function (a, b, c) { null === this.We && w.k("Call Link.startRoute before modifying the points of the route."); this.dd.ig(a, new z(b, c)) }; W.prototype.insertPoint = function (a, b) { null === this.We && w.k("Call Link.startRoute before modifying the points of the route."); this.dd.Pd(a, b) }; W.prototype.insertPointAt = W.prototype.w = function (a, b, c) { null === this.We && w.k("Call Link.startRoute before modifying the points of the route."); this.dd.Pd(a, new z(b, c)) }; W.prototype.addPoint = W.prototype.mi = function (a) { null === this.We && w.k("Call Link.startRoute before modifying the points of the route."); this.dd.add(a) }; W.prototype.addPointAt = W.prototype.ij = function (a, b) { null === this.We && w.k("Call Link.startRoute before modifying the points of the route."); this.dd.add(new z(a, b)) }; W.prototype.removePoint = W.prototype.UF = function (a) { null === this.We && w.k("Call Link.startRoute before modifying the points of the route."); this.dd.$c(a) }; W.prototype.clearPoints = W.prototype.Gp = function () { null === this.We && w.k("Call Link.startRoute before modifying the points of the route."); this.dd.clear() }; W.prototype.movePoints = W.prototype.Ik = function (a, b) { for (var c = new H(z), d = this.dd.i; d.next();) { var e = d.value; c.add((new z(e.x + a, e.y + b)).freeze()) } c.freeze(); d = this.dd; this.dd = c; this.H(); Mr(this); e = this.g; null !== e && e.Oa.qc && (this.kp = c); this.h("points", d, c) }; W.prototype.startRoute = W.prototype.fm = function () { null === this.We && (this.We = this.dd, this.dd = this.dd.copy()) }; W.prototype.commitRoute = W.prototype.kj = function () { if (null !== this.We) { for (var a = this.We, b = this.dd, c = Infinity, d = Infinity, e = a.n, f = e.length, h = 0; h < f; h++)var k = e[h], c = Math.min(k.x, c), d = Math.min(k.y, d); for (var l = Infinity, m = Infinity, n = b.n, p = n.length, h = 0; h < p; h++)k = n[h], l = Math.min(k.x, l), m = Math.min(k.y, m), k.freeze(); b.freeze(); if (p === f) for (h = 0; h < p; h++) { if (f = e[h], k = n[h], f.x - c !== k.x - l || f.y - d !== k.y - m) { this.H(); this.Le(); break } } else this.H(), this.Le(); this.We = null; c = this.g; null !== c && c.Oa.qc && (this.kp = b); Mr(this); this.h("points", a, b) } }; W.prototype.rollbackRoute = W.prototype.tJ = function () { null !== this.We && (this.dd = this.We, this.We = null) }; function Mr(a) { 0 === a.dd.count ? a.kg = !1 : (a.kg = !0, a.Lp = a.l(0), a.Mp = a.l(a.qa - 1), Nr(a, !1)) } W.prototype.invalidateRoute = W.prototype.$b = function () { if (!this.gm) { var a = this.g; a && (a.Lx.contains(this) || a.oa.ab || a.Oa.DI && !a.Oa.mf) || (a = this.path, null !== a && (this.kg = !1, this.H(), a.H())) } }; w.defineProperty(W, { kg: null }, function () { return 0 !== (this.Yb & 16) }, function (a) { 0 !== (this.Yb & 16) !== a && (this.Yb ^= 16) }); w.defineProperty(W, { gm: "suspendsRouting" }, function () { return 0 !== (this.Yb & 32) }, function (a) { 0 !== (this.Yb & 32) !== a && (this.Yb ^= 32) }); w.defineProperty(W, { Zz: null }, function () { return 0 !== (this.Yb & 64) }, function (a) { 0 !== (this.Yb & 64) !== a && (this.Yb ^= 64) }); w.defineProperty(W, { Lp: "defaultFromPoint" }, function () { return this.pC }, function (a) { this.pC = a.copy() }); w.defineProperty(W, { Mp: "defaultToPoint" }, function () { return this.vC }, function (a) { this.vC = a.copy() }); W.prototype.updateRoute = W.prototype.co = function () { if (!this.kg && !this.Zz) { var a = !0; try { this.Zz = !0, this.fm(), a = this.computePoints() } finally { this.Zz = !1, a ? this.kj() : this.tJ() } } }; W.prototype.computePoints = function () { var a = this.g; if (null === a) return !1; var b = this.V, c = null; null === b ? (a.vl || (a.Ns = new Y, a.Ns.Ca = rd, a.Ns.lb = 0, a.vl = new U, a.vl.add(a.Ns), a.vl.af()), this.Lp && (a.vl.position = a.vl.location = this.Lp, a.vl.af(), b = a.vl, c = a.Ns)) : c = this.Lc; if (null !== c && !b.isVisible()) { var d = b.findVisibleNode(); null !== d && d !== b ? (b = d, c = d.Ql("")) : b = d } this.ND = b; if (null === b || !b.location.I()) return !1; for (; !(null === c || c.Y.I() && c.xj());)c = c.O; if (null === c) return !1; var e = this.Z, f = null; null === e ? (a.wl || (a.Os = new Y, a.Os.Ca = rd, a.Os.lb = 0, a.wl = new U, a.wl.add(a.Os), a.wl.af()), this.Mp && (a.wl.position = a.wl.location = this.Mp, a.wl.af(), e = a.wl, f = a.Os)) : f = this.kd; null === f || e.isVisible() || (a = e.findVisibleNode(), null !== a && a !== e ? (e = a, f = a.Ql("")) : e = a); this.OD = e; if (null === e || !e.location.I()) return !1; for (; !(null === f || f.Y.I() && f.xj());)f = f.O; if (null === f) return !1; var h = this.qa, d = Or(this, c), a = Pr(this, f), k = d === tb, l = a === tb, m = c === f && null !== c, n = this.ac, p = this.$e === Jj; this.Ji = m && !n ? p = !0 : !1; var q = this.yt === kj || m; if (!n && !m && k && l) { if (k = !1, !q && 3 <= h && (q = this.getLinkPoint(b, c, d, !0, !1, e, f), l = this.getLinkPoint(e, f, a, !1, !1, b, c), k = this.adjustPoints(0, q, h - 1, l)) && (q = this.getLinkPoint(b, c, d, !0, !1, e, f), l = this.getLinkPoint(e, f, a, !1, !1, b, c), this.adjustPoints(0, q, h - 1, l)), !k) if (this.Gp(), p) { var h = this.getLinkPoint(b, c, d, !0, !1, e, f), q = this.getLinkPoint(e, f, a, !1, !1, b, c), k = q.x - h.x, l = q.y - h.y, m = this.computeCurviness(), p = n = 0, r = h.x + k / 3, s = h.y + l / 3, u = r, t = s; J(l, 0) ? t = 0 < k ? t - m : t + m : (n = -k / l, p = Math.sqrt(m * m / (n * n + 1)), 0 > m && (p = -p), u = (0 > l ? -1 : 1) * p + r, t = n * (u - r) + s); var r = h.x + 2 * k / 3, s = h.y + 2 * l / 3, x = r, v = s; J(l, 0) ? v = 0 < k ? v - m : v + m : (x = (0 > l ? -1 : 1) * p + r, v = n * (x - r) + s); this.Gp(); this.mi(h); this.ij(u, t); this.ij(x, v); this.mi(q); this.Xg(0, this.getLinkPoint(b, c, d, !0, !1, e, f)); this.Xg(3, this.getLinkPoint(e, f, a, !1, !1, b, c)) } else d = this.getLinkPoint(b, c, d, !0, !1, e, f), a = this.getLinkPoint(e, f, a, !1, !1, b, c), this.hasCurviness() ? (q = a.x - d.x, e = a.y - d.y, f = this.computeCurviness(), b = d.x + q / 2, c = d.y + e / 2, h = b, k = c, J(e, 0) ? k = 0 < q ? k - f : k + f : (q = -q / e, h = Math.sqrt(f * f / (q * q + 1)), 0 > f && (h = -h), h = (0 > e ? -1 : 1) * h + b, k = q * (h - b) + c), this.mi(d), this.ij(h, k)) : this.mi(d), this.mi(a) } else { p = this.Xl; q && (n && p || m) && this.Gp(); var A = m ? this.computeCurviness() : 0, p = this.getLinkPoint(b, c, d, !0, n, e, f), r = u = s = 0; if (n || !k || m) if (t = this.computeEndSegmentLength(b, c, d, !0), r = this.getLinkDirection(b, c, p, d, !0, n, e, f), m && (k || d.L(a) || !n && 1 === d.x + a.x && 1 === d.y + a.y) && (r -= n ? 90 : 30, 0 > A && (r -= 180)), 0 > r ? r += 360 : 360 <= r && (r -= 360), m && (t += Math.abs(A) * (n ? 1 : 2)), 0 === r ? s = t : 90 === r ? u = t : 180 === r ? s = -t : 270 === r ? u = -t : (s = t * Math.cos(r * Math.PI / 180), u = t * Math.sin(r * Math.PI / 180)), d.Rd() && m) { var y = c.Wa(Hb, w.K()), K = w.xb(y.x + 1E3 * s, y.y + 1E3 * u); this.getLinkPointFromPoint(b, c, y, K, !0, p); w.v(y); w.v(K) } var t = this.getLinkPoint(e, f, a, !1, n, b, c), E = v = x = 0; if (n || !l || m) y = this.computeEndSegmentLength(e, f, a, !1), E = this.getLinkDirection(e, f, t, a, !1, n, b, c), m && (l || d.L(a) || !n && 1 === d.x + a.x && 1 === d.y + a.y) && (E += n ? 0 : 30, 0 > A && (E += 180)), 0 > E ? E += 360 : 360 <= E && (E -= 360), m && (y += Math.abs(A) * (n ? 1 : 2)), 0 === E ? x = y : 90 === E ? v = y : 180 === E ? x = -y : 270 === E ? v = -y : (x = y * Math.cos(E * Math.PI / 180), v = y * Math.sin(E * Math.PI / 180)), a.Rd() && m && (y = f.Wa(Hb, w.K()), K = w.xb(y.x + 1E3 * x, y.y + 1E3 * v), this.getLinkPointFromPoint(e, f, y, K, !1, t), w.v(y), w.v(K)); a = p; if (n || !k || m) a = new z(p.x + s, p.y + u); d = t; if (n || !l || m) d = new z(t.x + x, t.y + v); !q && !n && k && 3 < h && this.adjustPoints(0, p, h - 2, d) ? this.Xg(h - 1, t) : !q && !n && l && 3 < h && this.adjustPoints(1, a, h - 1, t) ? this.Xg(0, p) : !q && (n ? 6 <= h : 4 < h) && this.adjustPoints(1, a, h - 2, d) ? (this.Xg(0, p), this.Xg(h - 1, t)) : (this.Gp(), this.mi(p), (n || !k || m) && this.mi(a), n && this.addOrthoPoints(a, r, d, E, b, e), (n || !l || m) && this.mi(d), this.mi(t)) } return !0 }; function Qr(a, b) { Math.abs(b.x - a.x) > Math.abs(b.y - a.y) ? (b.x = b.x >= a.x ? a.x + 9E9 : a.x - 9E9, b.y = a.y) : (b.y = b.y >= a.y ? a.y + 9E9 : a.y - 9E9, b.x = a.x); return b } W.prototype.getLinkPointFromPoint = function (a, b, c, d, e, f) { void 0 === f && (f = new z); if (null === a || null === b) return f.assign(c), f; a.isVisible() || (e = a.findVisibleNode(), null !== e && e !== a && (b = e.port)); var h = e = 0, k = 0, l = 0; a = null; e = b.O; null === e || e.ah() || (e = e.O); if (null === e) e = d.x, h = d.y, k = c.x, l = c.y; else { a = e.rh; e = 1 / (a.m11 * a.m22 - a.m12 * a.m21); var k = a.m22 * e, l = -a.m12 * e, m = -a.m21 * e, n = a.m11 * e, p = e * (a.m21 * a.dy - a.m22 * a.dx), q = e * (a.m12 * a.dx - a.m11 * a.dy); e = d.x * k + d.y * m + p; h = d.x * l + d.y * n + q; k = c.x * k + c.y * m + p; l = c.x * l + c.y * n + q } b.Bn(e, h, k, l, f); null !== a && f.transform(a); return f }; function Rr(a, b) { var c = b.Ds; null === c && (c = new Sr, c.port = b, c.Pc = b.U, b.Ds = c); return Tr(c, a) } W.prototype.getLinkPoint = function (a, b, c, d, e, f, h, k) { void 0 === k && (k = new z); if (c.Xc()) return b.Wa(c, k), k; if (c.uj()) { var l = Rr(this, b); if (null !== l) { k.assign(l.dq); if (e && this.ey === Gr) { var m = Rr(this, h); if (null !== m && l.un < m.un) { var l = w.K(), m = w.K(), n = new B(b.Wa(xb, l), b.Wa(Nb, m)), p = this.computeSpot(!d); a = this.getLinkPoint(f, h, p, !d, e, a, b, m); (c.sj(Xb) || c.sj(Yb)) && a.y >= n.y && a.y <= n.y + n.height ? k.y = a.y : (c.sj(Wb) || c.sj(Zb)) && a.x >= n.x && a.x <= n.x + n.width && (k.x = a.x); w.v(l); w.v(m) } } return k } } c = b.Wa(Hb, w.K()); l = f = null; this.qa > (e ? 6 : 2) ? (l = d ? this.l(1) : this.l(this.qa - 2), e && (l = Qr(c, l.copy()))) : (f = w.K(), l = h.Wa(Hb, f), e && (l = Qr(c, l)), w.v(f)); this.getLinkPointFromPoint(a, b, c, l, d, k); w.v(c); return k }; W.prototype.getLinkDirection = function (a, b, c, d, e, f, h, k) { a: if (d.Xc()) c = d.x > d.y ? d.x > 1 - d.y ? 0 : d.x < 1 - d.y ? 270 : 315 : d.x < d.y ? d.x > 1 - d.y ? 90 : d.x < 1 - d.y ? 180 : 135 : .5 > d.x ? 225 : .5 < d.x ? 45 : 0; else { if (d.uj()) { var l = Rr(this, b); if (null !== l) switch (l.ye) { case w.ld: c = 270; break a; case w.Sc: c = 180; break a; default: case w.bd: c = 0; break a; case w.ad: c = 90; break a } } var l = b.Wa(Hb, w.K()), m = null, n = null; this.qa > (f ? 6 : 2) ? (n = e ? this.l(1) : this.l(this.qa - 2), n = f ? Qr(l, n.copy()) : c) : (m = w.K(), n = k.Wa(Hb, m), w.v(m)); c = 0; c = Math.abs(n.x - l.x) > Math.abs(n.y - l.y) ? n.x >= l.x ? 0 : 180 : n.y >= l.y ? 90 : 270; w.v(l) } d.Rd() && h.qi(a) && (c += 180, 360 <= c && (c -= 360)); a = pr; a = e ? this.Vt : this.Ou; a === pr && (a = e ? b.Vt : b.Ou); switch (a) { case qr: b = b.Tl(); c += b; 360 <= c && (c -= 360); break; case pr: case xo: if (d.AI()) break; b = b.Tl(); if (0 === b) break; 45 <= b && 135 > b ? c += 90 : 135 <= b && 225 > b ? c += 180 : 225 <= b && 315 > b && (c += 270); 360 <= c && (c -= 360) }return c }; W.prototype.computeEndSegmentLength = function (a, b, c, d) { if (null !== b && c.uj() && (a = Rr(this, b), null !== a)) return a.jx; a = NaN; a = d ? this.Sl : this.km; null !== b && isNaN(a) && (a = d ? b.Sl : b.km); isNaN(a) && (a = 10); return a }; W.prototype.computeSpot = function (a) { return a ? Or(this, this.Lc) : Pr(this, this.kd) }; function Or(a, b) { if (null === b) return Hb; var c = a.Ab; c.Wc() && null !== b && (c = b.Ab); return c === rc ? tb : c } function Pr(a, b) { if (null === b) return Hb; var c = a.Bb; c.Wc() && null !== b && (c = b.Bb); return c === rc ? tb : c } W.prototype.computeOtherPoint = function (a, b) { var c = b.Wa(Hb), d; d = b.Ds; d = null !== d ? Tr(d, this) : null; null !== d && (c = d.dq); return c }; W.prototype.computeShortLength = function (a) { if (a) { if (a = this.Wt, isNaN(a)) { var b = this.Lc; null !== b && (a = b.Wt) } } else a = this.Pu, isNaN(a) && (b = this.kd, null !== b && (a = b.Pu)); return isNaN(a) ? 0 : a }; W.prototype.zk = function (a, b, c, d, e, f) { if (!1 === this.Wg) return !1; void 0 === b && (b = null); void 0 === c && (c = null); var h = f; void 0 === f && (h = w.Jf(), h.reset()); h.multiply(this.transform); if (this.rn(a, h)) return aq(this, b, c, e), void 0 === f && w.we(h), !0; if (this.Wf(a, h)) { var k = !1; if (!this.Gn) for (var l = this.xa.n, m = l.length; m--;) { var n = l[m]; if (n.visible || n === this.$f) { var p = n.Y, q = this.Ja; if (!(p.x > q.width || p.y > q.height || 0 > p.x + p.width || 0 > p.y + p.height)) { p = w.Jf(); p.set(h); if (n instanceof C) k = n.zk(a, b, c, d, e, p); else if (this.path === n) { if (n instanceof Y) { var k = n, r = a, s = d, q = p; if (!1 === k.Wg) k = !1; else if (q.multiply(k.transform), s) b: { var u = r, t = q; if (k.rn(u, t)) k = !0; else { if (void 0 === t && (t = k.transform, u.wk(k.Y))) { k = !0; break b } var q = u.left, r = u.right, s = u.top, u = u.bottom, x = w.K(), v = w.K(), A = w.K(), y = w.Jf(); y.set(t); y.GF(k.transform); y.vx(); v.x = r; v.y = s; v.transform(y); x.x = q; x.y = s; x.transform(y); t = !1; mq(k, x, v, A) ? t = !0 : (x.x = r, x.y = u, x.transform(y), mq(k, x, v, A) ? t = !0 : (v.x = q, v.y = u, v.transform(y), mq(k, x, v, A) ? t = !0 : (x.x = q, x.y = s, x.transform(y), mq(k, x, v, A) && (t = !0)))); w.we(y); w.v(x); w.v(v); w.v(A); k = t } } else k = k.rn(r, q) } } else k = Do(n, a, d, p); k && (null !== b && (n = b(n)), n && (null === c || c(n)) && (e instanceof I && e.add(n), e instanceof H && e.add(n))); w.we(p) } } } void 0 === f && w.we(h); return k || null !== this.background || null !== this.kn } void 0 === f && w.we(h); return !1 }; w.u(W, { ac: "isOrthogonal" }, function () { return 2 === (this.Vm.value & 2) }); w.u(W, { Xl: "isAvoiding" }, function () { return 4 === (this.Vm.value & 4) }); W.prototype.computeCurve = function () { if (null === this.Ji) { var a = this.Lc, b = this.ac; this.Ji = null !== a && a === this.kd && !b } return this.Ji ? Jj : this.$e }; W.prototype.computeCorner = function () { if (this.$e === Jj) return 0; var a = this.eA; if (isNaN(a) || 0 > a) a = 10; return a }; W.prototype.findMidLabel = function () { for (var a = this.path, b = this.xa.n, c = b.length, d = 0; d < c; d++) { var e = b[d]; if (e !== a && !e.Yf && (-Infinity === e.Ne || isNaN(e.Ne))) return e } for (a = this.Df; a.next();)if (b = a.value, -Infinity === b.Ne || isNaN(b.Ne)) return b; return null }; W.prototype.computeSpacing = function () { if (!this.isVisible()) return 0; var a; a = Math.max(14, this.computeThickness()); var b = this.Lc, c = this.kd; if (null !== b && null !== c) { var d = this.findMidLabel(); if (null !== d) { var e = d.Ja, f = d.margin, h = isNaN(e.width) ? 30 : e.width * d.scale + f.left + f.right, e = isNaN(e.height) ? 14 : e.height * d.scale + f.top + f.bottom, d = d.qq; d === pq || d === Ir || d === Hr ? a = Math.max(a, e) : d === Tp || d === Up || d === Rp || d === Sp ? a = Math.max(a, h) : (b = b.Wa(Hb).Ob(c.Wa(Hb)) / 180 * Math.PI, a = Math.max(a, Math.abs(Math.sin(b) * h) + Math.abs(Math.cos(b) * e) + 1)); this.$e === Jj && (a *= 1.333) } } return a }; W.prototype.arrangeBundledLinks = function (a, b) { if (b) for (var c = 0; c < a.length; c++)a[c].$b() }; W.prototype.computeCurviness = function () { var a = this.bx; if (isNaN(a)) { var a = 16, b = this.wi; if (null !== b) { for (var c = w.cb(), d = 0, e = b.links, f = 0; f < e.length; f++) { var h = e[f], h = h.computeSpacing(); c.push(h); d += h } d = -d / 2; for (f = 0; f < e.length; f++) { h = e[f]; if (h === this) { a = d + c[f] / 2; break } d += c[f] } b.gq === this.V && (a = -a); w.ua(c) } } return a }; W.prototype.computeThickness = function () { if (!this.isVisible()) return 0; var a = this.path; return null !== a ? Math.max(a.lb, 1) : 1 }; W.prototype.hasCurviness = function () { return !isNaN(this.bx) || null !== this.wi }; W.prototype.adjustPoints = function (a, b, c, d) { var e = this.yt; if (this.ac) { if (e === Er) return !1; e === Fr && (e = Dr) } switch (e) { case Er: var f = this.l(a), h = this.l(c); if (!f.Kc(b) || !h.Kc(d)) { var e = f.x, f = f.y, k = h.x - e, l = h.y - f, m = Math.sqrt(k * k + l * l); if (!Va(m, 0)) { var n = 0; Va(k, 0) ? n = 0 > l ? -Math.PI / 2 : Math.PI / 2 : (n = Math.atan(l / Math.abs(k)), 0 > k && (n = Math.PI - n)); var h = b.x, p = b.y, l = d.x - h, q = d.y - p, r = Math.sqrt(l * l + q * q), k = 0; Va(l, 0) ? k = 0 > q ? -Math.PI / 2 : Math.PI / 2 : (k = Math.atan(q / Math.abs(l)), 0 > l && (k = Math.PI - k)); m = r / m; n = k - n; this.Xg(a, b); for (a += 1; a < c; a++)b = this.l(a), k = b.x - e, l = b.y - f, b = Math.sqrt(k * k + l * l), Va(b, 0) || (q = 0, Va(k, 0) ? q = 0 > l ? -Math.PI / 2 : Math.PI / 2 : (q = Math.atan(l / Math.abs(k)), 0 > k && (q = Math.PI - q)), k = q + n, b *= m, this.ca(a, h + b * Math.cos(k), p + b * Math.sin(k))); this.Xg(c, d) } } return !0; case Fr: f = this.l(a); p = this.l(c); if (!f.Kc(b) || !p.Kc(d)) { var e = f.x, f = f.y, h = p.x, p = p.y, m = (h - e) * (h - e) + (p - f) * (p - f), k = b.x, n = b.y, l = d.x, q = d.y, r = 0, s = 1; 0 !== l - k ? (r = (q - n) / (l - k), s = Math.sqrt(1 + 1 / (r * r))) : r = 9E9; this.Xg(a, b); for (a += 1; a < c; a++) { b = this.l(a); var u = b.x, t = b.y, x = .5; 0 !== m && (x = ((e - u) * (e - h) + (f - t) * (f - p)) / m); var v = e + x * (h - e), A = f + x * (p - f); b = Math.sqrt((u - v) * (u - v) + (t - A) * (t - A)); t < r * (u - v) + A && (b = -b); 0 < r && (b = -b); u = k + x * (l - k); x = n + x * (q - n); 0 !== r ? (b = u + b / s, this.ca(a, b, x - (b - u) / r)) : this.ca(a, u, x + b) } this.Xg(c, d) } return !0; case Dr: a: { if (this.ac && (e = this.l(a), f = this.l(a + 1), h = this.l(a + 2), k = f.x, n = f.y, p = k, m = n, J(e.y, f.y) ? J(f.x, h.x) ? n = b.y : J(f.y, h.y) && (k = b.x) : J(e.x, f.x) && (J(f.y, h.y) ? k = b.x : J(f.x, h.x) && (n = b.y)), this.ca(a + 1, k, n), e = this.l(c), f = this.l(c - 1), h = this.l(c - 2), k = f.x, n = f.y, l = k, q = n, J(e.y, f.y) ? J(f.x, h.x) ? n = d.y : J(f.y, h.y) && (k = d.x) : J(e.x, f.x) && (J(f.y, h.y) ? k = d.x : J(f.x, h.x) && (n = d.y)), this.ca(c - 1, k, n), Bi(this))) { this.ca(a + 1, p, m); this.ca(c - 1, l, q); c = !1; break a } this.Xg(a, b); this.Xg(c, d); c = !0 } return c; default: return !1 } }; W.prototype.addOrthoPoints = function (a, b, c, d, e, f) { b = -45 <= b && 45 > b ? 0 : 45 <= b && 135 > b ? 90 : 135 <= b && 225 > b ? 180 : 270; d = -45 <= d && 45 > d ? 0 : 45 <= d && 135 > d ? 90 : 135 <= d && 225 > d ? 180 : 270; var h = e.Y.copy(), k = f.Y.copy(); if (h.I() && k.I()) { h.zf(8, 8); k.zf(8, 8); h.ui(a); k.ui(c); var l, m; if (0 === b) if (c.x > a.x || 270 === d && c.y < a.y && k.right > a.x || 90 === d && c.y > a.y && k.right > a.x) l = new z(c.x, a.y), m = new z(c.x, (a.y + c.y) / 2), 180 === d ? (l.x = this.computeMidOrthoPosition(a.x, c.x, !1), m.x = l.x, m.y = c.y) : 270 === d && c.y < a.y || 90 === d && c.y > a.y ? (l.x = a.x < k.left ? this.computeMidOrthoPosition(a.x, k.left, !1) : a.x < k.right && (270 === d && a.y < k.top || 90 === d && a.y > k.bottom) ? this.computeMidOrthoPosition(a.x, c.x, !1) : k.right, m.x = l.x, m.y = c.y) : 0 === d && a.x < k.left && a.y > k.top && a.y < k.bottom && (l.x = a.x, l.y = a.y < c.y ? Math.min(c.y, k.top) : Math.max(c.y, k.bottom), m.y = l.y); else { l = new z(a.x, c.y); m = new z((a.x + c.x) / 2, c.y); if (180 === d || 90 === d && c.y < h.top || 270 === d && c.y > h.bottom) 180 === d && (k.Ia(a) || h.Ia(c)) ? l.y = this.computeMidOrthoPosition(a.y, c.y, !0) : c.y < a.y && (180 === d || 90 === d) ? l.y = this.computeMidOrthoPosition(h.top, Math.max(c.y, k.bottom), !0) : c.y > a.y && (180 === d || 270 === d) && (l.y = this.computeMidOrthoPosition(h.bottom, Math.min(c.y, k.top), !0)), m.x = c.x, m.y = l.y; if (l.y > h.top && l.y < h.bottom) if (c.x >= h.left && c.x <= a.x || a.x <= k.right && a.x >= c.x) { if (90 === d || 270 === d) l = new z(Math.max((a.x + c.x) / 2, a.x), a.y), m = new z(l.x, c.y) } else l.y = 270 === d || (0 === d || 180 === d) && c.y < a.y ? Math.min(c.y, 0 === d ? h.top : Math.min(h.top, k.top)) : Math.max(c.y, 0 === d ? h.bottom : Math.max(h.bottom, k.bottom)), m.x = c.x, m.y = l.y } else if (180 === b) if (c.x < a.x || 270 === d && c.y < a.y && k.left < a.x || 90 === d && c.y > a.y && k.left < a.x) l = new z(c.x, a.y), m = new z(c.x, (a.y + c.y) / 2), 0 === d ? (l.x = this.computeMidOrthoPosition(a.x, c.x, !1), m.x = l.x, m.y = c.y) : 270 === d && c.y < a.y || 90 === d && c.y > a.y ? (l.x = a.x > k.right ? this.computeMidOrthoPosition(a.x, k.right, !1) : a.x > k.left && (270 === d && a.y < k.top || 90 === d && a.y > k.bottom) ? this.computeMidOrthoPosition(a.x, c.x, !1) : k.left, m.x = l.x, m.y = c.y) : 180 === d && a.x > k.right && a.y > k.top && a.y < k.bottom && (l.x = a.x, l.y = a.y < c.y ? Math.min(c.y, k.top) : Math.max(c.y, k.bottom), m.y = l.y); else { l = new z(a.x, c.y); m = new z((a.x + c.x) / 2, c.y); if (0 === d || 90 === d && c.y < h.top || 270 === d && c.y > h.bottom) 0 === d && (k.Ia(a) || h.Ia(c)) ? l.y = this.computeMidOrthoPosition(a.y, c.y, !0) : c.y < a.y && (0 === d || 90 === d) ? l.y = this.computeMidOrthoPosition(h.top, Math.max(c.y, k.bottom), !0) : c.y > a.y && (0 === d || 270 === d) && (l.y = this.computeMidOrthoPosition(h.bottom, Math.min(c.y, k.top), !0)), m.x = c.x, m.y = l.y; if (l.y > h.top && l.y < h.bottom) if (c.x <= h.right && c.x >= a.x || a.x >= k.left && a.x <= c.x) { if (90 === d || 270 === d) l = new z(Math.min((a.x + c.x) / 2, a.x), a.y), m = new z(l.x, c.y) } else l.y = 270 === d || (0 === d || 180 === d) && c.y < a.y ? Math.min(c.y, 180 === d ? h.top : Math.min(h.top, k.top)) : Math.max(c.y, 180 === d ? h.bottom : Math.max(h.bottom, k.bottom)), m.x = c.x, m.y = l.y } else if (90 === b) if (c.y > a.y || 180 === d && c.x < a.x && k.bottom > a.y || 0 === d && c.x > a.x && k.bottom > a.y) l = new z(a.x, c.y), m = new z((a.x + c.x) / 2, c.y), 270 === d ? (l.y = this.computeMidOrthoPosition(a.y, c.y, !0), m.x = c.x, m.y = l.y) : 180 === d && c.x < a.x || 0 === d && c.x > a.x ? (l.y = a.y < k.top ? this.computeMidOrthoPosition(a.y, k.top, !0) : a.y < k.bottom && (180 === d && a.x < k.left || 0 === d && a.x > k.right) ? this.computeMidOrthoPosition(a.y, c.y, !0) : k.bottom, m.x = c.x, m.y = l.y) : 90 === d && a.y < k.top && a.x > k.left && a.x < k.right && (l.x = a.x < c.x ? Math.min(c.x, k.left) : Math.max(c.x, k.right), l.y = a.y, m.x = l.x); else { l = new z(c.x, a.y); m = new z(c.x, (a.y + c.y) / 2); if (270 === d || 0 === d && c.x < h.left || 180 === d && c.x > h.right) 270 === d && (k.Ia(a) || h.Ia(c)) ? l.x = this.computeMidOrthoPosition(a.x, c.x, !1) : c.x < a.x && (270 === d || 0 === d) ? l.x = this.computeMidOrthoPosition(h.left, Math.max(c.x, k.right), !1) : c.x > a.x && (270 === d || 180 === d) && (l.x = this.computeMidOrthoPosition(h.right, Math.min(c.x, k.left), !1)), m.x = l.x, m.y = c.y; if (l.x > h.left && l.x < h.right) if (c.y >= h.top && c.y <= a.y || a.y <= k.bottom && a.y >= c.y) { if (0 === d || 180 === d) l = new z(a.x, Math.max((a.y + c.y) / 2, a.y)), m = new z(c.x, l.y) } else l.x = 180 === d || (90 === d || 270 === d) && c.x < a.x ? Math.min(c.x, 90 === d ? h.left : Math.min(h.left, k.left)) : Math.max(c.x, 90 === d ? h.right : Math.max(h.right, k.right)), m.x = l.x, m.y = c.y } else if (c.y < a.y || 180 === d && c.x < a.x && k.top < a.y || 0 === d && c.x > a.x && k.top < a.y) l = new z(a.x, c.y), m = new z((a.x + c.x) / 2, c.y), 90 === d ? (l.y = this.computeMidOrthoPosition(a.y, c.y, !0), m.x = c.x, m.y = l.y) : 180 === d && c.x < a.x || 0 === d && c.x >= a.x ? (l.y = a.y > k.bottom ? this.computeMidOrthoPosition(a.y, k.bottom, !0) : a.y > k.top && (180 === d && a.x < k.left || 0 === d && a.x > k.right) ? this.computeMidOrthoPosition(a.y, c.y, !0) : k.top, m.x = c.x, m.y = l.y) : 270 === d && a.y > k.bottom && a.x > k.left && a.x < k.right && (l.x = a.x < c.x ? Math.min(c.x, k.left) : Math.max(c.x, k.right), l.y = a.y, m.x = l.x); else { l = new z(c.x, a.y); m = new z(c.x, (a.y + c.y) / 2); if (90 === d || 0 === d && c.x < h.left || 180 === d && c.x > h.right) 90 === d && (k.Ia(a) || h.Ia(c)) ? l.x = this.computeMidOrthoPosition(a.x, c.x, !1) : c.x < a.x && (90 === d || 0 === d) ? l.x = this.computeMidOrthoPosition(h.left, Math.max(c.x, k.right), !1) : c.x > a.x && (90 === d || 180 === d) && (l.x = this.computeMidOrthoPosition(h.right, Math.min(c.x, k.left), !1)), m.x = l.x, m.y = c.y; if (l.x > h.left && l.x < h.right) if (c.y <= h.bottom && c.y >= a.y || a.y >= k.top && a.y <= c.y) { if (0 === d || 180 === d) l = new z(a.x, Math.min((a.y + c.y) / 2, a.y)), m = new z(c.x, l.y) } else l.x = 180 === d || (90 === d || 270 === d) && c.x < a.x ? Math.min(c.x, 270 === d ? h.left : Math.min(h.left, k.left)) : Math.max(c.x, 270 === d ? h.right : Math.max(h.right, k.right)), m.x = l.x, m.y = c.y } var n = l, p = m; if (this.Xl) { var q = this.g, r; (r = null === q) || (q.Oa.mf ? r = !1 : (r = q.$a, r = r instanceof nh ? !r.Ew || r.tI : !0), r = !r); if (r || h.Ia(c) && !f.qi(e) || k.Ia(a) && !e.qi(f) || e === f || this.layer.Mc) b = !1; else { var s = Dn(q, !0, this.Da, null); if (s.bq(Math.min(a.x, n.x), Math.min(a.y, n.y), Math.abs(a.x - n.x), Math.abs(a.y - n.y)) && s.bq(Math.min(n.x, p.x), Math.min(n.y, p.y), Math.abs(n.x - p.x), Math.abs(n.y - p.y)) && s.bq(Math.min(p.x, c.x), Math.min(p.y, c.y), Math.abs(p.x - c.x), Math.abs(p.y - c.y))) b = !1; else { e = a; f = c; var u = r = null; if (q.EA) { q = s.gb.copy(); q.zf(-s.nn, -s.mn); var t = w.K(); Ur(s, a.x, a.y) || (me(q.x, q.y, q.x + q.width, q.y + q.height, a.x, a.y, n.x, n.y, t) ? (r = a = t.copy(), b = t.Ob(n)) : me(q.x, q.y, q.x + q.width, q.y + q.height, n.x, n.y, p.x, p.y, t) ? (r = a = t.copy(), b = t.Ob(p)) : me(q.x, q.y, q.x + q.width, q.y + q.height, p.x, p.y, c.x, c.y, t) && (r = a = t.copy(), b = t.Ob(c))); Ur(s, c.x, c.y) || (me(q.x, q.y, q.x + q.width, q.y + q.height, c.x, c.y, p.x, p.y, t) ? (u = c = t.copy(), d = p.Ob(t)) : me(q.x, q.y, q.x + q.width, q.y + q.height, p.x, p.y, n.x, n.y, t) ? (u = c = t.copy(), d = n.Ob(t)) : me(q.x, q.y, q.x + q.width, q.y + q.height, n.x, n.y, a.x, a.y, t) && (u = c = t.copy(), d = a.Ob(t))); w.v(t) } h = h.copy().Kh(k); h.zf(2 * s.nn, 2 * s.mn); Vr(s, a, b, c, d, h); k = Wr(s, c.x, c.y); !s.abort && 999999 <= k && (Gn(s), k = s.mG, h.zf(s.nn * k, s.mn * k), Vr(s, a, b, c, d, h), k = Wr(s, c.x, c.y)); !s.abort && 999999 <= k && (Gn(s), k = s.zF, h.zf(s.nn * k, s.mn * k), Vr(s, a, b, c, d, h), k = Wr(s, c.x, c.y)); !s.abort && 999999 <= k && s.DG && (Gn(s), Vr(s, a, b, c, d, s.gb), k = Wr(s, c.x, c.y)); if (!s.abort && 999999 > k && 0 !== Wr(s, c.x, c.y)) { Xr(this, s, c.x, c.y, d, !0); h = this.l(2); if (4 > this.qa) 0 === b || 180 === b ? (h.x = a.x, h.y = c.y) : (h.x = c.x, h.y = a.y), this.ca(2, h.x, h.y), this.w(3, h.x, h.y); else if (c = this.l(3), 0 === b || 180 === b) J(h.x, c.x) ? (h = 0 === b ? Math.max(h.x, a.x) : Math.min(h.x, a.x), this.ca(2, h, a.y), this.ca(3, h, c.y)) : J(h.y, c.y) ? (Math.abs(a.y - h.y) <= s.mn / 2 && (this.ca(2, h.x, a.y), this.ca(3, c.x, a.y)), this.w(2, h.x, a.y)) : this.ca(2, a.x, h.y); else if (90 === b || 270 === b) J(h.y, c.y) ? (h = 90 === b ? Math.max(h.y, a.y) : Math.min(h.y, a.y), this.ca(2, a.x, h), this.ca(3, c.x, h)) : J(h.x, c.x) ? (Math.abs(a.x - h.x) <= s.nn / 2 && (this.ca(2, a.x, h.y), this.ca(3, a.x, c.y)), this.w(2, a.x, h.y)) : this.ca(2, h.x, a.y); null !== r && (a = this.l(1), c = this.l(2), a.x !== c.x && a.y !== c.y ? 0 === b || 180 === b ? this.w(2, a.x, c.y) : this.w(2, c.x, a.y) : 0 === b || 180 === b ? this.w(2, e.x, r.y) : this.w(2, r.x, e.y)); null !== u && (0 === d || 180 === d ? this.ij(f.x, u.y) : this.ij(u.x, f.y)); b = !0 } else b = !1 } } } else b = !1; b || (this.mi(l), this.mi(m)) } }; W.prototype.computeMidOrthoPosition = function (a, b) { if (this.hasCurviness()) { var c = this.computeCurviness(); return (a + b) / 2 + c } return (a + b) / 2 }; function Bi(a) { if (null === a.g || !a.Xl) return !1; var b = a.points.n, c = b.length; if (4 > c) return !1; a = Dn(a.g, !0, a.Da, null); for (var d = 1; d < c - 2; d++) { var e = b[d], f = b[d + 1]; if (!a.bq(Math.min(e.x, f.x), Math.min(e.y, f.y), Math.abs(e.x - f.x), Math.abs(e.y - f.y))) return !0 } return !1 } function Xr(a, b, c, d, e, f) { var h = b.nn, k = b.mn, l = Wr(b, c, d), m = c, n = d; for (0 === e ? m += h : 90 === e ? n += k : 180 === e ? m -= h : n -= k; 1 < l && Wr(b, m, n) === l - 1;)c = m, d = n, 0 === e ? m += h : 90 === e ? n += k : 180 === e ? m -= h : n -= k, l -= 1; if (f) { if (1 < l) if (180 === e || 0 === e) c = Math.floor(c / h) * h + h / 2; else if (90 === e || 270 === e) d = Math.floor(d / k) * k + k / 2 } else c = Math.floor(c / h) * h + h / 2, d = Math.floor(d / k) * k + k / 2; 1 < l && (f = e, m = c, n = d, 0 === e ? (f = 90, n += k) : 90 === e ? (f = 180, m -= h) : 180 === e ? (f = 270, n -= k) : 270 === e && (f = 0, m += h), Wr(b, m, n) === l - 1 ? Xr(a, b, m, n, f, !1) : (m = c, n = d, 0 === e ? (f = 270, n -= k) : 90 === e ? (f = 0, m += h) : 180 === e ? (f = 90, n += k) : 270 === e && (f = 180, m -= h), Wr(b, m, n) === l - 1 && Xr(a, b, m, n, f, !1))); a.ij(c, d) } W.prototype.findClosestSegment = function (a) { var b = a.x; a = a.y; for (var c = this.l(0), d = this.l(1), e = Ma(b, a, c.x, c.y, d.x, d.y), f = 0, h = 1; h < this.qa - 1; h++) { var c = this.l(h + 1), k = Ma(b, a, d.x, d.y, c.x, c.y), d = c; k < e && (f = h, e = k) } return f }; W.prototype.Le = function () { this.Ua = null }; w.u(W, { jf: "geometry" }, function () { null === this.Ua && (this.co(), this.Ua = this.makeGeometry()); return this.Ua }); W.prototype.pu = function (a) { if (!a) { if (!1 === this.kg) return; a = this.Kd(); if (null !== this.Ua && (null === a || null !== a.jf)) return } this.Ua = this.makeGeometry(); a = this.path; if (null !== a) { a.Ua = this.Ua; for (var b = this.xa.n, c = b.length, d = 0; d < c; d++) { var e = b[d]; e !== a && e.Yf && e instanceof Y && (e.Ua = this.Ua) } } }; W.prototype.makeGeometry = function () { var a = this.qa; if (2 > a) return new Ce(Ge); var b = !1, c = this.g; null !== c && Lr(this) && c.bl.contains(this) && null !== this.qw && (b = !0); var d = c = 0, e = this.l(0).copy(), f = e.copy(), c = this.dd.n, h = this.computeCurve(); if (h === Jj && 3 <= a && !Va(this.vq, 0)) if (3 === a) var k = this.l(1), c = Math.min(e.x, k.x), d = Math.min(e.y, k.y), k = this.l(2), c = Math.min(c, k.x), d = Math.min(d, k.y); else { if (this.ac) for (k = 0; k < a; k++)d = c[k], f.x = Math.min(d.x, f.x), f.y = Math.min(d.y, f.y); else for (k = 3; k < a; k += 3)k + 3 >= a && (k = a - 1), c = this.l(k), f.x = Math.min(c.x, f.x), f.y = Math.min(c.y, f.y); c = f.x; d = f.y } else { for (k = 0; k < a; k++)d = c[k], f.x = Math.min(d.x, f.x), f.y = Math.min(d.y, f.y); c = f.x; d = f.y } c -= this.Jz.x; d -= this.Jz.y; e.x -= c; e.y -= d; if (2 !== a || Lr(this)) { var l = w.s(); 0 !== this.computeShortLength(!0) && (e = Yr(this, e, !0, f)); M(l, e.x, e.y, !1, !1); if (h === Jj && 3 <= a && !Va(this.vq, 0)) if (3 === a) k = this.l(1), a = k.x - c, b = k.y - d, k = this.l(2).copy(), k.x -= c, k.y -= d, 0 !== this.computeShortLength(!1) && (k = Yr(this, k, !1, f)), N(l, a, b, a, b, k.x, k.y); else if (this.ac) { for (var f = new z(c, d), e = this.l(1).copy(), h = new z(c, d), a = new z(c, d), b = this.l(0), m = null, n = this.vq / 3, k = 1; k < this.qa - 1; k++) { var m = this.l(k), p = b, q = m, r = this.l(Zr(this, m, k, !1)); if (!Va(p.x, q.x) || !Va(q.x, r.x)) if (!Va(p.y, q.y) || !Va(q.y, r.y)) { var s = n, u = h, t = a; isNaN(s) && (s = this.vq / 3); var x = p.x, p = p.y, v = q.x, q = q.y, A = r.x, r = r.y, y = s * $r(x, p, v, q), s = s * $r(v, q, A, r); Va(p, q) && Va(v, A) && (v > x ? r > q ? (u.x = v - y, u.y = q - y, t.x = v + s, t.y = q + s) : (u.x = v - y, u.y = q + y, t.x = v + s, t.y = q - s) : r > q ? (u.x = v + y, u.y = q - y, t.x = v - s, t.y = q + s) : (u.x = v + y, u.y = q + y, t.x = v - s, t.y = q - s)); Va(x, v) && Va(q, r) && (q > p ? (A > v ? (u.x = v - y, u.y = q - y, t.x = v + s) : (u.x = v + y, u.y = q - y, t.x = v - s), t.y = q + s) : (A > v ? (u.x = v - y, u.y = q + y, t.x = v + s) : (u.x = v + y, u.y = q + y, t.x = v - s), t.y = q - s)); if (Va(x, v) && Va(v, A) || Va(p, q) && Va(q, r)) x = .5 * (x + A), p = .5 * (p + r), u.x = x, u.y = p, t.x = x, t.y = p; 1 === k ? (e.x = .5 * (b.x + m.x), e.y = .5 * (b.y + m.y)) : 2 === k && Va(b.x, this.l(0).x) && Va(b.y, this.l(0).y) && (e.x = .5 * (b.x + m.x), e.y = .5 * (b.y + m.y)); N(l, e.x - c, e.y - d, h.x - c, h.y - d, m.x - c, m.y - d); f.set(h); e.set(a); b = m } } k = b.x; b = b.y; f = this.l(this.qa - 1); 0 !== this.computeShortLength(!1) && (f = Yr(this, f.copy(), !1, ed)); k = .5 * (k + f.x); b = .5 * (b + f.y); N(l, a.x - c, a.y - d, k - c, b - d, f.x - c, f.y - d) } else for (k = 3; k < a; k += 3)b = this.l(k - 2), k + 3 >= a && (k = a - 1), f = this.l(k - 1), e = this.l(k), k === a - 1 && 0 !== this.computeShortLength(!1) && (e = Yr(this, e.copy(), !1, ed)), N(l, b.x - c, b.y - d, f.x - c, f.y - d, e.x - c, e.y - d); else { f = w.K(); f.assign(this.l(0)); k = 1; for (e = 0; k < a;) { k = Zr(this, f, k, 1 < k); u = this.l(k); if (k >= a - 1) { if (!f.L(u)) 0 !== this.computeShortLength(!1) && (u = Yr(this, u.copy(), !1, ed)), as(this, l, -c, -d, f, u, b); else if (0 === e) for (k = 1; k < a;)u = this.l(k++), as(this, l, -c, -d, f, u, b), f.assign(u); break } e = Zr(this, u, k + 1, k < a - 3); k = l; h = -c; m = -d; n = f; t = this.l(e); x = f; p = b; J(n.y, u.y) && J(u.x, t.x) ? (s = this.computeCorner(), s = Math.min(s, Math.abs(u.x - n.x) / 2), s = v = Math.min(s, Math.abs(t.y - u.y) / 2), J(s, 0) ? (as(this, k, h, m, n, u, p), x.assign(u)) : (q = u.x, A = u.y, r = q, y = A, q = u.x > n.x ? u.x - s : u.x + s, y = t.y > u.y ? u.y + v : u.y - v, as(this, k, h, m, n, new z(q, A), p), Ue(k, u.x + h, u.y + m, r + h, y + m), x.m(r, y))) : J(n.x, u.x) && J(u.y, t.y) ? (s = this.computeCorner(), v = Math.min(s, Math.abs(u.y - n.y) / 2), v = s = Math.min(v, Math.abs(t.x - u.x) / 2), J(s, 0) ? (as(this, k, h, m, n, u, p), x.assign(u)) : (q = u.x, y = A = u.y, A = u.y > n.y ? u.y - v : u.y + v, r = t.x > u.x ? u.x + s : u.x - s, as(this, k, h, m, n, new z(q, A), p), Ue(k, u.x + h, u.y + m, r + h, y + m), x.m(r, y))) : (as(this, k, h, m, n, u, p), x.assign(u)); k = e } w.v(f) } c = l.o; w.q(l) } else l = this.l(1).copy(), l.x -= c, l.y -= d, 0 !== this.computeShortLength(!0) && (e = Yr(this, e, !0, f)), 0 !== this.computeShortLength(!1) && (l = Yr(this, l, !1, f)), c = new Ce(Ge), c.ha = e.x, c.fa = e.y, c.C = l.x, c.D = l.y; return c }; function $r(a, b, c, d) { a = c - a; if (isNaN(a) || Infinity === a || -Infinity === a) return NaN; 0 > a && (a = -a); b = d - b; if (isNaN(b) || Infinity === b || -Infinity === b) return NaN; 0 > b && (b = -b); return Va(a, 0) ? b : Va(b, 0) ? a : Math.sqrt(a * a + b * b) } function Yr(a, b, c, d) { var e = a.qa; if (2 > e) return b; if (c) { var f = a.l(1); c = f.x - d.x; d = f.y - d.y; f = $r(b.x, b.y, c, d); if (0 === f) return b; e = 2 === e ? .5 * f : f; a = a.computeShortLength(!0); a > e && (a = e); c = a * (c - b.x) / f; a = a * (d - b.y) / f; b.x += c; b.y += a } else { f = a.l(e - 2); c = f.x - d.x; d = f.y - d.y; f = $r(b.x, b.y, c, d); if (0 === f) return b; e = 2 === e ? .5 * f : f; a = a.computeShortLength(!1); a > e && (a = e); c = a * (b.x - c) / f; a = a * (b.y - d) / f; b.x -= c; b.y -= a } return b } function Zr(a, b, c, d) { for (var e = a.qa, f = b; Va(b.x, f.x) && Va(b.y, f.y);) { if (c >= e) return e - 1; f = a.l(c++) } if (!Va(b.x, f.x) && !Va(b.y, f.y)) return c - 1; for (var h = f; Va(b.x, f.x) && Va(f.x, h.x) && (!d || (b.y >= f.y ? f.y >= h.y : f.y <= h.y)) || Va(b.y, f.y) && Va(f.y, h.y) && (!d || (b.x >= f.x ? f.x >= h.x : f.x <= h.x));) { if (c >= e) return e - 1; h = a.l(c++) } return c - 2 } function as(a, b, c, d, e, f, h) { if (!h && Lr(a)) { h = []; var k = 0; a.isVisible() && (k = bs(a, e, f, h)); var l = e.x, l = e.y; if (0 < k) if (J(e.y, f.y)) if (e.x < f.x) for (var m = 0; m < k;) { var n = Math.max(e.x, Math.min(h[m++] - 5, f.x - 10)); b.lineTo(n + c, f.y + d); for (var l = n + c, p = Math.min(n + 10, f.x); m < k;) { var q = h[m]; if (q < p + 10) m++ , p = Math.min(q + 5, f.x); else break } q = (n + p) / 2 + c; q = f.y - 10 + d; n = p + c; p = f.y + d; a.$e === jj ? M(b, n, p, !1, !1) : N(b, l, q, n, q, n, p) } else for (m = k - 1; 0 <= m;) { n = Math.min(e.x, Math.max(h[m--] + 5, f.x + 10)); b.lineTo(n + c, f.y + d); l = n + c; for (p = Math.max(n - 10, f.x); 0 <= m;)if (q = h[m], q > p - 10) m-- , p = Math.max(q - 5, f.x); else break; q = f.y - 10 + d; n = p + c; p = f.y + d; a.$e === jj ? M(b, n, p, !1, !1) : N(b, l, q, n, q, n, p) } else if (J(e.x, f.x)) if (e.y < f.y) for (m = 0; m < k;) { n = Math.max(e.y, Math.min(h[m++] - 5, f.y - 10)); b.lineTo(f.x + c, n + d); l = n + d; for (p = Math.min(n + 10, f.y); m < k;)if (q = h[m], q < p + 10) m++ , p = Math.min(q + 5, f.y); else break; q = f.x - 10 + c; n = f.x + c; p += d; a.$e === jj ? M(b, n, p, !1, !1) : N(b, q, l, q, p, n, p) } else for (m = k - 1; 0 <= m;) { n = Math.min(e.y, Math.max(h[m--] + 5, f.y + 10)); b.lineTo(f.x + c, n + d); l = n + d; for (p = Math.max(n - 10, f.y); 0 <= m;)if (q = h[m], q > p - 10) m-- , p = Math.max(q - 5, f.y); else break; q = f.x - 10 + c; n = f.x + c; p += d; a.$e === jj ? M(b, n, p, !1, !1) : N(b, q, l, q, p, n, p) } } b.lineTo(f.x + c, f.y + d) } function bs(a, b, c, d) { var e = a.g; if (null === e || b.L(c)) return 0; for (e = e.Ix; e.next();) { var f = e.value; if (null !== f && f.visible) for (var f = f.zb.n, h = f.length, k = 0; k < h; k++) { var l = f[k]; if (l instanceof W) { if (l === a) return 0 < d.length && d.sort(function (a, b) { return a - b }), d.length; if (l.isVisible() && Lr(l)) { var m = l.Wn; m.I() && a.Wn.Wf(m) && !a.usesSamePort(l) && (m = l.path, null !== m && m.xj() && cs(b, c, d, l)) } } } } 0 < d.length && d.sort(function (a, b) { return a - b }); return d.length } function cs(a, b, c, d) { for (var e = J(a.y, b.y), f = d.qa, h = d.l(0), k = w.K(), l = 1; l < f; l++) { var m = d.l(l); if (l < f - 1) { var n = d.l(l + 1); if (h.y === m.y && m.y === n.y) { if (m.x > h.x && n.x > m.x || m.x < h.x && n.x < m.x) m = n, l++ } else h.x === m.x && m.x === n.x && (m.y > h.y && n.y > m.y || m.y < h.y && n.y < m.y) && (m = n, l++) } a: { var n = k, p = a.x, q = a.y, r = b.x, s = b.y, u = h.x, h = h.y, t = m.x, x = m.y; if (!J(p, r)) { if (J(q, s) && J(u, t) && Math.min(p, r) < u && Math.max(p, r) > u && Math.min(h, x) < q && Math.max(h, x) > q && !J(h, x)) { n.x = u; n.y = q; n = !0; break a } } else if (!J(q, s) && J(h, x) && Math.min(q, s) < h && Math.max(q, s) > h && Math.min(u, t) < p && Math.max(u, t) > p && !J(u, t)) { n.x = p; n.y = h; n = !0; break a } n.x = 0; n.y = 0; n = !1 } n && (e ? c.push(k.x) : c.push(k.y)); h = m } w.v(k) } w.u(W, { Pt: "firstPickIndex" }, function () { var a; 2 >= this.qa ? a = 0 : ((a = this.ac) || (a = this.computeSpot(!0) !== tb), a = a ? 1 : 0); return a }); w.u(W, { Gx: "lastPickIndex" }, function () { var a = this.qa; if (0 === a) a = 0; else if (2 >= a) a -= 1; else { var b; (b = this.ac) || (b = this.computeSpot(!1) !== tb); a = b ? a - 2 : a - 1 } return a }); function Lr(a) { a = a.$e; return a === ij || a === jj } function Nr(a, b) { if (b || Lr(a)) { var c = a.g; null === c || c.bl.contains(a) || null === a.qw || c.bl.add(a, a.qw) } } function lj(a, b) { var c = a.layer; if (null !== c && c.visible && !c.Mc) { var d = c.g; if (null !== d) for (var e = !1, d = d.Ix; d.next();) { var f = d.value; if (f.visible) if (f === c) for (var e = !0, h = !1, f = f.zb.n, k = f.length, l = 0; l < k; l++) { var m = f[l]; m instanceof W && (m === a ? h = !0 : h && ds(a, m, b)) } else if (e) for (f = f.zb.n, k = f.length, l = 0; l < k; l++)m = f[l], m instanceof W && ds(a, m, b) } } } function ds(a, b, c) { if (null !== b && null !== b.Ua && Lr(b)) { var d = b.Wn; d.I() && (a.Wn.Wf(d) || c.Wf(d)) && (a.usesSamePort(b) || b.Le()) } } W.prototype.usesSamePort = function (a) { var b = this.qa, c = a.qa; if (0 < b && 0 < c) { var d = this.l(0), e = a.l(0); if (d.Kc(e)) return !0; b = this.l(b - 1); a = a.l(c - 1); if (b.Kc(a) || d.Kc(a) || b.Kc(e)) return !0 } else if (this.V === a.V || this.Z === a.Z || this.V === a.Z || this.Z === a.V) return !0; return !1 }; W.prototype.isVisible = function () { if (!T.prototype.isVisible.call(this)) return !1; var a = this.Da, b = !0, c = this.g; null !== c && (b = c.Sd); var d = this.V; if (null !== d) { if (this.Nc && b && !d.tc) return !1; if (d === a) return !0; for (c = d; null !== c;) { if (c.Wb === this) return !0; c = c.Da } c = d.findVisibleNode(); if (null === c || c === a) return !1 } d = this.Z; if (null !== d) { if (this.Nc && !b && !d.tc) return !1; if (d === a) return !0; for (c = d; null !== c;) { if (c.Wb === this) return !0; c = c.Da } b = d.findVisibleNode(); if (null === b || b === a) return !1 } return !0 }; W.prototype.yd = function (a) { T.prototype.yd.call(this, a); null !== this.wi && this.wi.Yp(); if (null !== this.rf) for (var b = this.rf.i; b.next();)b.value.yd(a) }; w.defineProperty(W, { yt: "adjusting" }, function () { return this.Gq }, function (a) { var b = this.Gq; b !== a && (this.Gq = a, this.h("adjusting", b, a)) }); w.defineProperty(W, { eA: "corner" }, function () { return this.ar }, function (a) { var b = this.ar; b !== a && (this.ar = a, this.Le(), this.h("corner", b, a)) }); w.defineProperty(W, { $e: "curve" }, function () { return this.dr }, function (a) { var b = this.dr; b !== a && (this.dr = a, this.$b(), this.Le(), Nr(this, b === jj || b === ij || a === jj || a === ij), this.h("curve", b, a)) }); w.defineProperty(W, { bx: "curviness" }, function () { return this.er }, function (a) { var b = this.er; b !== a && (this.er = a, this.$b(), this.Le(), this.h("curviness", b, a)) }); w.defineProperty(W, { ey: "routing" }, function () { return this.Vm }, function (a) { var b = this.Vm; b !== a && (this.Vm = a, this.Ji = null, this.$b(), Nr(this, 2 === (b.value & 2) || 2 === (a.value & 2)), this.h("routing", b, a)) }); w.defineProperty(W, { vq: "smoothness" }, function () { return this.ct }, function (a) { var b = this.ct; b !== a && (this.ct = a, this.Le(), this.h("smoothness", b, a)) }); function Kr(a) { var b = a.rg; if (null !== b) { var c = a.Hg; if (null !== c) { var d = a.Rh; a = a.li; for (var e = null, f = null, h = b.pc.n, k = h.length, l = 0; l < k; l++) { var m = h[l]; if (m.rg === b && m.Rh === d && m.Hg === c && m.li === a || m.rg === c && m.Rh === a && m.Hg === b && m.li === d) null === f ? f = m : (null === e && (e = [], e.push(f)), e.push(m)) } if (null !== e) { f = tr(b, c, d, a); null === f && (f = new yl, f.gq = b, f.Sx = d, f.uu = c, f.Tx = a, sr(b, f), sr(c, f)); f.links = e; for (l = 0; l < e.length; l++)m = e[l], m.wi = f; f.Yp() } } } } function Jr(a) { var b = a.wi; null !== b && (a.wi = null, a = b.links.indexOf(a), 0 <= a && (w.Kg(b.links, a), b.Yp())) } function yl() { w.nc(this); this.Nf = this.Mv = !1; this.Tx = this.uu = this.Sx = this.gq = null; this.links = [] } yl.prototype.Yp = function () { if (!this.Mv) { var a = this.links; 0 < a.length && (a = a[0].g, null !== a && (a.LC.add(this), this.Nf = a.oa.ab)) } this.Mv = !0 }; yl.prototype.CB = function () { if (this.Mv) { this.Mv = !1; var a = this.links; if (0 < a.length) { var b = a[0], c = b.g, c = null === c || c.Hn && !this.Nf; this.Nf = !1; b.arrangeBundledLinks(a, c); 1 === a.length && (b.wi = null, a.length = 0) } 0 === a.length && (a = this.gq, null !== this && null !== a.Lh && a.Lh.remove(this), a = this.uu, null !== this && null !== a.Lh && a.Lh.remove(this)) } }; w.ce(yl, { gq: !0, Sx: !0, uu: !0, Tx: !0, links: !0, spacing: !0 }); function En() { w.nc(this); this.qB = this.group = null; this.bu = !0; this.abort = !1; this.Bg = this.Ag = 1; this.cs = this.bs = -1; this.Be = this.Ae = 8; this.nd = null; this.DG = !1; this.mG = 22; this.zF = 111 } w.ce(En, { group: !0, qB: !0, bu: !0, abort: !0, DG: !0, mG: !0, zF: !0 }); En.prototype.initialize = function (a) { if (!(0 >= a.width || 0 >= a.height)) { var b = a.y, c = a.x + a.width, d = a.y + a.height; this.Ag = Math.floor((a.x - this.Ae) / this.Ae) * this.Ae; this.Bg = Math.floor((b - this.Be) / this.Be) * this.Be; this.bs = Math.ceil((c + 2 * this.Ae) / this.Ae) * this.Ae; this.cs = Math.ceil((d + 2 * this.Be) / this.Be) * this.Be; a = 1 + (Math.ceil((this.bs - this.Ag) / this.Ae) | 0); b = 1 + (Math.ceil((this.cs - this.Bg) / this.Be) | 0); if (null === this.nd || this.zp < a - 1 || this.Ap < b - 1) { c = []; for (d = 0; d <= a; d++)c[d] = []; this.nd = c; this.zp = a - 1; this.Ap = b - 1 } if (null !== this.nd) for (a = 0; a <= this.zp; a++)for (b = 0; b <= this.Ap; b++)this.nd[a][b] = 1E6 } }; w.u(En, { gb: null }, function () { return new B(this.Ag, this.Bg, this.bs - this.Ag, this.cs - this.Bg) }); w.defineProperty(En, { nn: null }, function () { return this.Ae }, function (a) { 0 < a && a !== this.Ae && (this.Ae = a, this.initialize(this.gb)) }); w.defineProperty(En, { mn: null }, function () { return this.Be }, function (a) { 0 < a && a !== this.Be && (this.Be = a, this.initialize(this.gb)) }); function Ur(a, b, c) { return a.Ag <= b && b <= a.bs && a.Bg <= c && c <= a.cs } function Wr(a, b, c) { if (!Ur(a, b, c)) return 1E6; b -= a.Ag; b /= a.Ae; c -= a.Bg; c /= a.Be; return a.nd[b | 0][c | 0] } function Hn(a, b, c) { Ur(a, b, c) && (b -= a.Ag, b /= a.Ae, c -= a.Bg, c /= a.Be, a.nd[b | 0][c | 0] = 0) } function Gn(a) { if (null !== a.nd) for (var b = 0; b <= a.zp; b++)for (var c = 0; c <= a.Ap; c++)1 <= a.nd[b][c] && (a.nd[b][c] = 1E6) } En.prototype.bq = function (a, b, c, d) { if (a > this.bs || a + c < this.Ag || b > this.cs || b + d < this.Bg) return !0; a = (a - this.Ag) / this.Ae | 0; b = (b - this.Bg) / this.Be | 0; c = Math.max(0, c) / this.Ae + 1 | 0; var e = Math.max(0, d) / this.Be + 1 | 0; 0 > a && (c += a, a = 0); 0 > b && (e += b, b = 0); if (0 > c || 0 > e) return !0; d = Math.min(a + c - 1, this.zp) | 0; for (c = Math.min(b + e - 1, this.Ap) | 0; a <= d; a++)for (e = b; e <= c; e++)if (0 === this.nd[a][e]) return !1; return !0 }; function es(a, b, c, d, e, f, h, k, l) { if (!(b < f || b > h || c < k || c > l)) { var m, n; m = b | 0; n = c | 0; var p = a.nd[m][n]; if (1 <= p && 999999 > p) for (e ? n += d : m += d, p += 1; f <= m && m <= h && k <= n && n <= l && !(p >= a.nd[m][n]);)a.nd[m][n] = p, p += 1, e ? n += d : m += d; m = e ? n : m; if (e) if (0 < d) for (c += d; c < m; c += d)es(a, b, c, 1, !e, f, h, k, l), es(a, b, c, -1, !e, f, h, k, l); else for (c += d; c > m; c += d)es(a, b, c, 1, !e, f, h, k, l), es(a, b, c, -1, !e, f, h, k, l); else if (0 < d) for (b += d; b < m; b += d)es(a, b, c, 1, !e, f, h, k, l), es(a, b, c, -1, !e, f, h, k, l); else for (b += d; b > m; b += d)es(a, b, c, 1, !e, f, h, k, l), es(a, b, c, -1, !e, f, h, k, l) } } function fs(a, b, c, d, e, f, h, k, l) { b |= 0; c |= 0; var m = 0, n = 1; for (a.nd[b][c] = n; 0 === m && b > f && b < h && c > k && c < l;)n += 1, a.nd[b][c] = n, e ? c += d : b += d, m = a.nd[b][c] } function gs(a, b, c, d, e, f, h, k, l) { b |= 0; c |= 0; var m = 0; for (a.nd[b][c] = 999999; 0 === m && b > f && b < h && c > k && c < l;)a.nd[b][c] = 999999, e ? c += d : b += d, m = a.nd[b][c] } function Vr(a, b, c, d, e, f) { if (null !== a.nd) { a.abort = !1; var h = b.x, k = b.y; if (Ur(a, h, k) && (h -= a.Ag, h /= a.Ae, k -= a.Bg, k /= a.Be, b = d.x, d = d.y, Ur(a, b, d))) if (b -= a.Ag, b /= a.Ae, d -= a.Bg, d /= a.Be, 1 >= Math.abs(h - b) && 1 >= Math.abs(k - d)) a.abort = !0; else { var l = f.x, m = f.y, n = f.x + f.width, p = f.y + f.height, l = l - a.Ag, l = l / a.Ae, m = m - a.Bg, m = m / a.Be, n = n - a.Ag, n = n / a.Ae, p = p - a.Bg, p = p / a.Be; f = Math.max(0, Math.min(a.zp, l | 0)); n = Math.min(a.zp, Math.max(0, n | 0)); m = Math.max(0, Math.min(a.Ap, m | 0)); p = Math.min(a.Ap, Math.max(0, p | 0)); h |= 0; k |= 0; b |= 0; d |= 0; l = 0 === c || 90 === c ? 1 : -1; c = 90 === c || 270 === c; 0 === a.nd[h][k] ? (fs(a, h, k, l, c, f, n, m, p), fs(a, h, k, 1, !c, f, n, m, p), fs(a, h, k, -1, !c, f, n, m, p)) : fs(a, h, k, l, c, h, k, h, k); 0 === a.nd[b][d] ? (gs(a, b, d, 0 === e || 90 === e ? 1 : -1, 90 === e || 270 === e, f, n, m, p), gs(a, b, d, 1, !(90 === e || 270 === e), f, n, m, p), gs(a, b, d, -1, !(90 === e || 270 === e), f, n, m, p)) : gs(a, b, d, l, c, b, d, b, d); a.abort || (es(a, h, k, 1, !1, f, n, m, p), es(a, h, k, -1, !1, f, n, m, p), es(a, h, k, 1, !0, f, n, m, p), es(a, h, k, -1, !0, f, n, m, p)) } } } function Sr() { w.nc(this); this.port = this.Pc = null; this.dg = []; this.fq = !1 } w.ce(Sr, { Pc: !0, port: !0, dg: !0, fq: !0 }); Sr.prototype.toString = function () { for (var a = this.dg, b = this.Pc.toString() + " " + a.length.toString() + ":", c = 0; c < a.length; c++) { var d = a[c]; null !== d && (b += "\n " + d.toString()) } return b }; function hs(a, b, c, d) { b = b.offsetY; switch (b) { case w.ad: return 90; case w.Sc: return 180; case w.ld: return 270; case w.bd: return 0 }switch (b) { case w.ad | w.ld: return 180 < c ? 270 : 90; case w.Sc | w.bd: return 90 < c && 270 >= c ? 180 : 0 }a = 180 * Math.atan2(a.height, a.width) / Math.PI; switch (b) { case w.Sc | w.ld: return c > a && c <= 180 + a ? 180 : 270; case w.ld | w.bd: return c > 180 - a && c <= 360 - a ? 270 : 0; case w.bd | w.ad: return c > a && c <= 180 + a ? 90 : 0; case w.ad | w.Sc: return c > 180 - a && c <= 360 - a ? 180 : 90; case w.Sc | w.ld | w.bd: return 90 < c && c <= 180 + a ? 180 : c > 180 + a && c <= 360 - a ? 270 : 0; case w.ld | w.bd | w.ad: return 180 < c && c <= 360 - a ? 270 : c > a && 180 >= c ? 90 : 0; case w.bd | w.ad | w.Sc: return c > a && c <= 180 - a ? 90 : c > 180 - a && 270 >= c ? 180 : 0; case w.ad | w.Sc | w.ld: return c > 180 - a && c <= 180 + a ? 180 : c > 180 + a ? 270 : 90 }d && b !== (w.Sc | w.ld | w.bd | w.ad) && (c -= 15, 0 > c && (c += 360)); return c > a && c < 180 - a ? 90 : c >= 180 - a && c <= 180 + a ? 180 : c > 180 + a && c < 360 - a ? 270 : 0 } Sr.prototype.Yp = function () { this.dg.length = 0 }; function Tr(a, b) { var c = a.dg; if (0 === c.length) { a: if (!a.fq) { c = a.fq; a.fq = !0; var d, e = null, f = a.Pc, f = f instanceof V ? f : null; if (null === f || f.hd) d = a.Pc.ME(a.port.Td); else { if (!f.Y.I()) { a.fq = c; break a } e = f; d = e.LE() } var h = a.dg.length = 0, k = a.port.Wa(xb, w.K()), l = a.port.Wa(Nb, w.K()), f = w.jg(k.x, k.y, 0, 0); f.ui(l); w.v(k); w.v(l); k = w.xb(f.x + f.width / 2, f.y + f.height / 2); l = a.port.Tl(); for (d = d.i; d.next();) { var m = d.value; if (m.isVisible()) { var n = m.Lc === a.port || m.V.qi(e), p = m.computeSpot(n); if (p.uj() && (n = n ? m.kd : m.Lc, null !== n)) { var q = n.U; if (null !== q) { n = m.computeOtherPoint(q, n); q = k.Ob(n); q -= l; 0 > q && (q += 360); var p = hs(f, p, q, m.ac), r = 0; 0 === p ? (r = w.bd, 180 < q && (q -= 360)) : r = 90 === p ? w.ad : 180 === p ? w.Sc : w.ld; p = a.dg[h]; void 0 === p ? (p = new is(m, q, r), a.dg[h] = p) : (p.link = m, p.angle = q, p.ye = r); p.Qx.set(n); h++ } } } } w.v(k); a.dg.sort(Sr.prototype.eJ); e = a.dg.length; k = -1; for (h = l = 0; h < e; h++)p = a.dg[h], void 0 !== p && (p.ye !== k && (k = p.ye, l = 0), p.Wp = l, l++); k = -1; l = 0; for (h = e - 1; 0 <= h; h--)p = a.dg[h], void 0 !== p && (p.ye !== k && (k = p.ye, l = p.Wp + 1), p.un = l); h = a.dg; p = a.port; e = a.Pc.jJ; k = w.K(); l = w.K(); d = w.K(); m = w.K(); p.Wa(xb, k); p.Wa(Db, l); p.Wa(Nb, d); p.Wa(Lb, m); r = q = n = p = 0; if (e === rr) for (var s = 0; s < h.length; s++) { var u = h[s]; if (null !== u) { var t = u.link.computeThickness(); switch (u.ye) { case w.ad: q += t; break; case w.Sc: r += t; break; case w.ld: p += t; break; default: case w.bd: n += t } } } for (var x = 0, v = 0, A = 1, s = 0; s < h.length; s++)if (u = h[s], null !== u) { var y, K; if (x !== u.ye) { x = u.ye; switch (x) { case w.ad: y = d; K = m; break; case w.Sc: y = m; K = k; break; case w.ld: y = k; K = l; break; default: case w.bd: y = l, K = d }var E = K.x - y.x; K = K.y - y.y; switch (x) { case w.ad: q > Math.abs(E) ? (A = Math.abs(E) / q, q = Math.abs(E)) : A = 1; break; case w.Sc: r > Math.abs(K) ? (A = Math.abs(K) / r, r = Math.abs(K)) : A = 1; break; case w.ld: p > Math.abs(E) ? (A = Math.abs(E) / p, p = Math.abs(E)) : A = 1; break; default: case w.bd: n > Math.abs(K) ? (A = Math.abs(K) / n, n = Math.abs(K)) : A = 1 }v = 0 } var Q = u.dq; if (e === rr) { t = u.link.computeThickness(); t *= A; Q.set(y); switch (x) { case w.ad: Q.x = y.x + E / 2 + q / 2 - v - t / 2; break; case w.Sc: Q.y = y.y + K / 2 + r / 2 - v - t / 2; break; case w.ld: Q.x = y.x + E / 2 - p / 2 + v + t / 2; break; default: case w.bd: Q.y = y.y + K / 2 - n / 2 + v + t / 2 }v += t } else t = .5, e === or && (t = (u.Wp + 1) / (u.un + 1)), Q.x = y.x + E * t, Q.y = y.y + K * t } w.v(k); w.v(l); w.v(d); w.v(m); y = a.dg; for (E = 0; E < y.length; E++)K = y[E], null !== K && (K.jx = a.computeEndSegmentLength(K)); a.fq = c; w.Db(f) } c = a.dg } for (f = 0; f < c.length; f++)if (y = c[f], null !== y && y.link === b) return y; return null } Sr.prototype.eJ = function (a, b) { return a === b ? 0 : null === a ? -1 : null === b ? 1 : a.ye < b.ye ? -1 : a.ye > b.ye ? 1 : a.angle < b.angle ? -1 : a.angle > b.angle ? 1 : 0 }; Sr.prototype.computeEndSegmentLength = function (a) { var b = a.link, c = b.computeEndSegmentLength(this.Pc, this.port, tb, b.Lc === this.port), d = a.Wp; if (0 > d) return c; var e = a.un; if (1 >= e || !b.ac) return c; var b = a.Qx, f = a.dq; if (a.ye === w.Sc || a.ye === w.ad) d = e - 1 - d; return ((a = a.ye === w.Sc || a.ye === w.bd) ? b.y < f.y : b.x < f.x) ? c + 8 * d : (a ? b.y === f.y : b.x === f.x) ? c : c + 8 * (e - 1 - d) }; function is(a, b, c) { this.link = a; this.angle = b; this.ye = c; this.Qx = new z; this.un = this.Wp = 0; this.dq = new z; this.jx = 0 } w.ce(is, { link: !0, angle: !0, ye: !0, Qx: !0, Wp: !0, un: !0, dq: !0, jx: !0 }); is.prototype.toString = function () { return this.link.toString() + " " + this.angle.toString() + " " + this.ye.toString() + ":" + this.Wp.toString() + "/" + this.un.toString() + " " + this.dq.toString() + " " + this.jx.toString() + " " + this.Qx.toString() }; function wo() { this.pk = this.Sj = rc; this.nk = this.Qj = NaN; this.mk = this.Pj = pr; this.ok = this.Rj = NaN; this.mt = this.wr = null; this.nt = this.xr = Infinity } wo.prototype.copy = function () { var a = new wo; a.Sj = this.Sj.S(); a.pk = this.pk.S(); a.Qj = this.Qj; a.nk = this.nk; a.Pj = this.Pj; a.mk = this.mk; a.Rj = this.Rj; a.ok = this.ok; a.wr = this.wr; a.mt = this.mt; a.xr = this.xr; a.nt = this.nt; return a }; function V(a) { U.call(this, a); this.ya |= 4608; this.es = new I(T); this.bp = new I(V); this.Kb = this.gt = this.rl = this.fs = this.ds = null; this.ke = new sg; this.ke.group = this } w.Ka(V, U); w.ga("Group", V); V.prototype.cloneProtected = function (a) { U.prototype.cloneProtected.call(this, a); this.ya &= -32769; a.ds = this.ds; a.fs = this.fs; a.rl = this.rl; a.gt = this.gt; var b = a.Lt(function (a) { return a instanceof Nj }); a.Kb = b instanceof Nj ? b : null; null !== this.ke ? (a.ke = this.ke.copy(), a.ke.group = a) : (null !== a.ke && (a.ke.group = null), a.ke = null) }; V.prototype.oi = function (a) { U.prototype.oi.call(this, a); var b = a.Sp(); for (a = a.Oc; a.next();) { var c = a.value; c.H(); c.J(8); c.Dt(); if (c instanceof U) c.Xf(b); else if (c instanceof W) for (c = c.Df; c.next();)c.value.Xf(b) } }; V.prototype.Vn = function (a, b, c, d, e, f, h) { if (a === Qf && "elements" === b) if (e instanceof Nj) { var k = e; null === this.Kb ? this.Kb = k : this.Kb !== k && w.k("Cannot insert a second Placeholder into the visual tree of a Group.") } else e instanceof C && (k = e.Lt(function (a) { return a instanceof Nj }), k instanceof Nj && (null === this.Kb ? this.Kb = k : this.Kb !== k && w.k("Cannot insert a second Placeholder into the visual tree of a Group."))); else a === Rf && "elements" === b && null !== this.Kb && (d === this.Kb ? this.Kb = null : d instanceof C && this.Kb.Zl(d) && (this.Kb = null)); U.prototype.Vn.call(this, a, b, c, d, e, f, h) }; V.prototype.jj = function (a, b, c, d) { this.ql = this.Kb; C.prototype.jj.call(this, a, b, c, d) }; V.prototype.$l = function () { if (!U.prototype.$l.call(this)) return !1; for (var a = this.Oc; a.next();) { var b = a.value; if (b instanceof U) { if (b.isVisible() && Dm(b)) return !1 } else if (b instanceof W && b.isVisible() && Dm(b) && b.V !== this && b.Z !== this) return !1 } return !0 }; w.u(V, { placeholder: "placeholder" }, function () { return this.Kb }); w.defineProperty(V, { yH: "computesBoundsAfterDrag" }, function () { return 0 !== (this.ya & 2048) }, function (a) { var b = 0 !== (this.ya & 2048); b !== a && (w.j(a, "boolean", V, "computesBoundsAfterDrag"), this.ya ^= 2048, this.h("computesBoundsAfterDrag", b, a)) }); w.defineProperty(V, { Yw: "computesBoundsIncludingLinks" }, function () { return 0 !== (this.ya & 4096) }, function (a) { w.j(a, "boolean", V, "computesBoundsIncludingLinks"); var b = 0 !== (this.ya & 4096); b !== a && (this.ya ^= 4096, this.h("computesBoundsIncludingLinks", b, a)) }); w.defineProperty(V, { zH: "computesBoundsIncludingLocation" }, function () { return 0 !== (this.ya & 8192) }, function (a) { w.j(a, "boolean", V, "computesBoundsIncludingLocation"); var b = 0 !== (this.ya & 8192); b !== a && (this.ya ^= 8192, this.h("computesBoundsIncludingLocation", b, a)) }); w.defineProperty(V, { jI: "handlesDragDropForMembers" }, function () { return 0 !== (this.ya & 16384) }, function (a) { w.j(a, "boolean", V, "handlesDragDropForMembers"); var b = 0 !== (this.ya & 16384); b !== a && (this.ya ^= 16384, this.h("handlesDragDropForMembers", b, a)) }); w.u(V, { Oc: "memberParts" }, function () { return this.es.i }); function kr(a, b) { if (a.es.add(b)) { b instanceof V && a.bp.add(b); var c = a.WI; if (null !== c) { var d = !0, e = a.g; null !== e && (d = e.Ta, e.Ta = !0); c(a, b); null !== e && (e.Ta = d) } a.isVisible() && a.hd || b.yd(!1) } b instanceof W && !a.Yw || (c = a.Kb, null === c && (c = a), c.H()) } function jr(a, b) { if (a.es.remove(b)) { b instanceof V && a.bp.remove(b); var c = a.XI; if (null !== c) { var d = !0, e = a.g; null !== e && (d = e.Ta, e.Ta = !0); c(a, b); null !== e && (e.Ta = d) } a.isVisible() && a.hd || b.yd(!0) } b instanceof W && !a.Yw || (c = a.Kb, null === c && (c = a), c.H()) } V.prototype.wn = function () { if (0 < this.es.count) { var a = this.g; if (null !== a) for (var b = this.es.copy().i; b.next();)a.remove(b.value) } U.prototype.wn.call(this) }; w.defineProperty(V, { Tb: "layout" }, function () { return this.ke }, function (a) { var b = this.ke; b !== a && (null !== a && w.G(a, sg, V, "layout"), null !== b && (b.g = null, b.group = null), this.ke = a, null !== a && (a.g = this.g, a.group = this), this.h("layout", b, a)) }); w.defineProperty(V, { WI: "memberAdded" }, function () { return this.ds }, function (a) { var b = this.ds; b !== a && (null !== a && w.j(a, "function", V, "memberAdded"), this.ds = a, this.h("memberAdded", b, a)) }); w.defineProperty(V, { XI: "memberRemoved" }, function () { return this.fs }, function (a) { var b = this.fs; b !== a && (null !== a && w.j(a, "function", V, "memberRemoved"), this.fs = a, this.h("memberRemoved", b, a)) }); w.defineProperty(V, { MA: "memberValidation" }, function () { return this.rl }, function (a) { var b = this.rl; b !== a && (null !== a && w.j(a, "function", V, "memberValidation"), this.rl = a, this.h("memberValidation", b, a)) }); V.prototype.canAddMembers = function (a) { var b = this.g; if (null === b) return !1; b = b.ob; for (a = Gh(a).i; a.next();)if (!b.isValidMember(this, a.value)) return !1; return !0 }; V.prototype.addMembers = function (a, b) { var c = this.g; if (null === c) return !1; for (var c = c.ob, d = !0, e = Gh(a).i; e.next();) { var f = e.value; !b || c.isValidMember(this, f) ? f.Da = this : d = !1 } return d }; w.defineProperty(V, { WJ: "ungroupable" }, function () { return 0 !== (this.ya & 256) }, function (a) { var b = 0 !== (this.ya & 256); b !== a && (w.j(a, "boolean", V, "ungroupable"), this.ya ^= 256, this.h("ungroupable", b, a)) }); V.prototype.canUngroup = function () { if (!this.WJ) return !1; var a = this.layer; if (null !== a && !a.Uw) return !1; a = a.g; return null === a || a.Uw ? !0 : !1 }; V.prototype.Xf = function (a) { void 0 === a && (a = null); var b = 0 !== (this.ya & 65536); U.prototype.Xf.call(this, a); if (!b) for (0 !== (this.ya & 65536) !== !0 && (this.ya ^= 65536), b = this.LE(); b.next();) { var c = b.value; if (null === a || !a.contains(c)) { var d = c.V; null !== d && d !== this && d.qi(this) && !d.isVisible() ? c.$b() : (d = c.Z, null !== d && d !== this && d.qi(this) && !d.isVisible() && c.$b()) } } }; V.prototype.findExternalLinksConnected = V.prototype.LE = function () { var a = this.Sp(); a.add(this); for (var b = new I(W), c = a.i; c.next();) { var d = c.value; if (d instanceof U) for (d = d.ge; d.next();) { var e = d.value; a.contains(e) || b.add(e) } } return b.i }; V.prototype.findExternalNodesConnected = function () { var a = this.Sp(); a.add(this); for (var b = new I(U), c = a.i; c.next();) { var d = c.value; if (d instanceof U) for (d = d.ge; d.next();) { var e = d.value, f = e.V; a.contains(f) && f !== this || b.add(f); e = e.Z; a.contains(e) && e !== this || b.add(e) } } return b.i }; V.prototype.findContainingGroupChain = function () { function a(b, d) { null !== b && (d.add(b), a(b.Da, d)) } var b = new I(V); a(this, b); return b }; V.prototype.findSubGraphParts = V.prototype.Sp = function () { var a = new I(T); ih(a, this, !0, 0, !0); a.remove(this); return a }; V.prototype.yd = function (a) { U.prototype.yd.call(this, a); for (var b = this.Oc; b.next();)b.value.yd(a) }; V.prototype.collapseSubGraph = V.prototype.collapseSubGraph = function () { var a = this.g; if (null !== a && !a.yh) { a.yh = !0; var b = this.Sp(); js(this, b, a.Oa, this); a.yh = !1 } }; function js(a, b, c, d) { for (var e = a.Oc; e.next();) { var f = e.value; f.yd(!1); if (f instanceof V) { var h = f; h.hd && (h.ty = h.hd, js(h, b, c, d)) } if (f instanceof U) f.Xf(b), gl(c, f, d); else if (f instanceof W) for (f = f.Df; f.next();)f.value.Xf(b) } a.hd = !1 } V.prototype.expandSubGraph = V.prototype.expandSubGraph = function () { var a = this.g; if (null !== a && !a.yh) { a.yh = !0; var b = this.Sp(); ks(this, b, a.Oa, this); a.yh = !1 } }; function ks(a, b, c, d) { for (var e = a.Oc; e.next();) { var f = e.value; f.yd(!0); if (f instanceof V) { var h = f; h.ty && (h.ty = !1, ks(h, b, c, d)) } if (f instanceof U) f.Xf(b), fl(c, f, d); else if (f instanceof W) for (f = f.Df; f.next();)f.value.Xf(b) } a.hd = !0 } w.defineProperty(V, { hd: "isSubGraphExpanded" }, function () { return 0 !== (this.ya & 512) }, function (a) { var b = 0 !== (this.ya & 512); if (b !== a) { w.j(a, "boolean", V, "isSubGraphExpanded"); this.ya ^= 512; var c = this.g; this.h("isSubGraphExpanded", b, a); b = this.LJ; if (null !== b) { var d = !0; null !== c && (d = c.Ta, c.Ta = !0); b(this); null !== c && (c.Ta = d) } null !== c && c.oa.ab ? null !== this.Kb && this.Kb.H() : a ? this.expandSubGraph() : this.collapseSubGraph() } }); w.defineProperty(V, { ty: "wasSubGraphExpanded" }, function () { return 0 !== (this.ya & 1024) }, function (a) { var b = 0 !== (this.ya & 1024); b !== a && (w.j(a, "boolean", V, "wasSubGraphExpanded"), this.ya ^= 1024, this.h("wasSubGraphExpanded", b, a)) }); w.defineProperty(V, { LJ: "subGraphExpandedChanged" }, function () { return this.gt }, function (a) { var b = this.gt; b !== a && (null !== a && w.j(a, "function", V, "subGraphExpandedChanged"), this.gt = a, this.h("subGraphExpandedChanged", b, a)) }); V.prototype.move = function (a) { var b = this.position, c = b.x; isNaN(c) && (c = 0); b = b.y; isNaN(b) && (b = 0); var c = a.x - c, b = a.y - b, d = w.xb(c, b); U.prototype.move.call(this, a); for (a = this.Sp().i; a.next();) { var e = a.value; if (!(e instanceof W || e instanceof U && e.Af)) { var f = e.position, h = e.location; f.I() ? (d.x = f.x + c, d.y = f.y + b, e.position = d) : h.I() && (d.x = h.x + c, d.y = h.y + b, e.location = d) } } for (a.reset(); a.next();)e = a.value, e instanceof W && (e.kg || e.V !== this && e.Z !== this) && (f = e.position, d.x = f.x + c, d.y = f.y + b, e.move(d)); w.v(d) }; w.defineProperty(V, { Sn: null }, function () { return 0 !== (this.ya & 32768) }, function (a) { 0 !== (this.ya & 32768) !== a && (this.ya ^= 32768) }); function Nj() { G.call(this); this.gf = gd; this.Rs = new B(NaN, NaN, NaN, NaN) } w.Ka(Nj, G); w.ga("Placeholder", Nj); Nj.prototype.cloneProtected = function (a) { G.prototype.cloneProtected.call(this, a); a.gf = this.gf.S(); a.Rs = this.Rs.copy() }; Nj.prototype.vk = function (a) { if (null === this.background && null === this.kn) return !1; var b = this.Ja; return cb(0, 0, b.width, b.height, a.x, a.y) }; Nj.prototype.Nn = function () { var a = this.U; null !== a && (a instanceof V || a instanceof jh) || w.k("Placeholder is not inside a Group or Adornment."); if (a instanceof V) { var b = this.computeBorder(this.Rs), c = this.Uc; Pa(c, b.width || 0, b.height || 0); Bo(this, 0, 0, c.width, c.height); for (var c = a.Oc, d = !1; c.next();)if (c.value.isVisible()) { d = !0; break } !d || isNaN(b.x) || isNaN(b.y) || (c = new z, c.Xn(b, a.Ef), a.location = new z(c.x, c.y)) } else { var b = this.Ca, c = this.Uc, d = this.padding, e = d.left + d.right, f = d.top + d.bottom; if (b.I()) Pa(c, b.width + e || 0, b.height + f || 0), Bo(this, -d.left, -d.top, c.width, c.height); else { var h = a.rb, k = h.Wa(xb, w.K()), b = w.jg(k.x, k.y, 0, 0); b.ui(h.Wa(Nb, k)); b.ui(h.Wa(Db, k)); b.ui(h.Wa(Lb, k)); a.Si.m(b.x, b.y); Pa(c, b.width + e || 0, b.height + f || 0); Bo(this, -d.left, -d.top, c.width, c.height); w.v(k); w.Db(b) } } }; Nj.prototype.jj = function (a, b, c, d) { var e = this.Y; e.x = a; e.y = b; e.width = c; e.height = d }; Nj.prototype.computeBorder = function (a) { var b = this.U; if (b instanceof V) { var c = b; if (c.yH && this.Rs.I()) { var d = c.g; if (null !== d && (d = d.$a, d instanceof nh && !d.qr && null !== d.Zb && !d.Zb.contains(c))) return a.assign(this.Rs), a } } var c = w.If(), d = this.computeMemberBounds(c), e = this.padding; a.m(d.x - e.left, d.y - e.top, Math.max(d.width + e.left + e.right, 0), Math.max(d.height + e.top + e.bottom, 0)); w.Db(c); b instanceof V && (c = b, c.zH && c.location.I() && a.ui(c.location)); return a }; Nj.prototype.computeMemberBounds = function (a) { if (!(this.U instanceof V)) return a.m(0, 0, 0, 0), a; for (var b = this.U, c = Infinity, d = Infinity, e = -Infinity, f = -Infinity, h = b.Oc; h.next();) { var k = h.value; if (k.isVisible()) { if (k instanceof W) { var l = k; if (!b.Yw) continue; if (Cm(l)) continue; if (l.V === b || l.Z === b) continue } k = k.Y; k.left < c && (c = k.left); k.top < d && (d = k.top); k.right > e && (e = k.right); k.bottom > f && (f = k.bottom) } } isFinite(c) && isFinite(d) ? a.m(c, d, e - c, f - d) : (b = b.location, c = this.padding, a.m(b.x + c.left, b.y + c.top, 0, 0)); return a }; w.defineProperty(Nj, { padding: "padding" }, function () { return this.gf }, function (a) { "number" === typeof a ? a = new db(a) : w.G(a, db, Nj, "padding"); var b = this.gf; b.L(a) || (this.gf = a = a.S(), this.h("padding", b, a)) }); function sg() { 0 < arguments.length && w.jd(sg); w.nc(this); this.iz = this.$ = null; this.Xj = this.Lr = !0; this.Rr = !1; this.Kq = (new z(0, 0)).freeze(); this.Nr = this.Pr = !0; this.yC = ""; this.So = !1; this.wz = null } w.ga("Layout", sg); sg.prototype.cloneProtected = function (a) { a.Lr = this.Lr; a.Xj = this.Xj; a.Rr = this.Rr; a.Kq.assign(this.Kq); a.Pr = this.Pr; a.Nr = this.Nr; a.yC = this.yC; this.Xj || (a.So = !0) }; sg.prototype.copy = function () { var a = new this.constructor; this.cloneProtected(a); return a }; sg.prototype.ic = function (a) { w.Ej(this, a) }; sg.prototype.toString = function () { var a = w.kf(Object.getPrototypeOf(this)), a = a + "("; null !== this.group && (a += " in " + this.group); null !== this.g && (a += " for " + this.g); return a + ")" }; w.defineProperty(sg, { g: "diagram" }, function () { return this.$ }, function (a) { null !== a && w.G(a, D, sg, "diagram"); this.$ = a }); w.defineProperty(sg, { group: "group" }, function () { return this.iz }, function (a) { this.iz !== a && (null !== a && w.G(a, V, sg, "group"), this.iz = a, null !== a && (this.$ = a.g)) }); w.defineProperty(sg, { BI: "isOngoing" }, function () { return this.Lr }, function (a) { this.Lr !== a && (w.j(a, "boolean", sg, "isOngoing"), this.Lr = a) }); w.defineProperty(sg, { sF: "isInitial" }, function () { return this.Xj }, function (a) { w.j(a, "boolean", sg, "isInitial"); this.Xj = a; a || (this.So = !0) }); w.defineProperty(sg, { Ex: "isViewportSized" }, function () { return this.Rr }, function (a) { this.Rr !== a && (w.j(a, "boolean", sg, "isViewportSized"), (this.Rr = a) && this.J()) }); w.defineProperty(sg, { iu: "isRouting" }, function () { return this.Pr }, function (a) { this.Pr !== a && (w.j(a, "boolean", sg, "isRouting"), this.Pr = a) }); w.defineProperty(sg, { vF: "isRealtime" }, function () { return this.Nr }, function (a) { this.Nr !== a && (w.j(a, "boolean", sg, "isRealtime"), this.Nr = a) }); w.defineProperty(sg, { Cf: "isValidLayout" }, function () { return this.So }, function (a) { this.So !== a && (w.j(a, "boolean", sg, "isValidLayout"), this.So = a, a || (a = this.g, null !== a && (a.dv = !0))) }); sg.prototype.invalidateLayout = sg.prototype.J = function () { if (this.So) { var a = this.g; if (null !== a && !a.oa.ab) { var b = a.Oa; !b.Ro && (b.mf && b.Hh(), this.BI && a.Hn || this.sF && !a.Hn) && (this.Cf = !1, a.Me()) } } }; w.defineProperty(sg, { network: "network" }, function () { return this.wz }, function (a) { var b = this.wz; b !== a && (null !== a && w.G(a, tg, sg, "network"), null !== b && (b.Tb = null), this.wz = a, null !== a && (a.Tb = this)) }); sg.prototype.createNetwork = function () { return new tg }; sg.prototype.makeNetwork = function (a) { var b = this.createNetwork(); b.Tb = this; a instanceof D ? (b.sk(a.gg, !0), b.sk(a.links, !0)) : a instanceof V ? b.sk(a.Oc) : b.sk(a.i); return b }; sg.prototype.updateParts = function () { var a = this.g; if (null === a && null !== this.network) for (var b = this.network.vertexes.i; b.next();) { var c = b.value.Pc; if (null !== c && (a = c.g, null !== a)) break } this.Cf = !0; try { null !== a && a.Pb("Layout"), this.commitLayout() } finally { null !== a && a.wd("Layout") } }; sg.prototype.commitLayout = function () { for (var a = this.network.vertexes.i; a.next();)a.value.commit(); if (this.iu) for (a = this.network.edges.i; a.next();)a.value.commit() }; sg.prototype.doLayout = function (a) { null === a && w.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts"); var b = new I(T); a instanceof D ? (ls(this, b, a.gg, !0, this.Sn, !0, !1, !0), ls(this, b, a.Kk, !0, this.Sn, !0, !1, !0)) : a instanceof V ? ls(this, b, a.Oc, !1, this.Sn, !0, !1, !0) : b.Jc(a.i); var c = b.count; if (0 < c) { a = this.g; null !== a && a.Pb("Layout"); for (var c = Math.ceil(Math.sqrt(c)), d = this.qe.x, e = d, f = this.qe.y, h = 0, k = 0, b = b.i; b.next();) { var l = b.value; l.af(); var m = l.za, n = m.width, m = m.height; l.moveTo(e, f); l instanceof V && (l.Sn = !1); e += Math.max(n, 50) + 20; k = Math.max(k, Math.max(m, 50)); h >= c - 1 ? (h = 0, e = d, f += k + 20, k = 0) : h++ } null !== a && a.wd("Layout") } this.Cf = !0 }; sg.prototype.Sn = function (a) { return !a.location.I() || a instanceof V && a.Sn ? !0 : !1 }; function ls(a, b, c, d, e, f, h, k) { for (c = c.i; c.next();) { var l = c.value; d && !l.$p || null !== e && !e(l) || !l.canLayout() || (f && l instanceof U ? l.Af || (l instanceof V ? null === l.Tb ? ls(a, b, l.Oc, !1, e, f, h, k) : (ms(l), b.add(l)) : (ms(l), b.add(l))) : h && l instanceof W ? b.add(l) : !k || !l.ee() || l instanceof U || (ms(l), b.add(l))) } } function ms(a) { var b = a.Y; (0 === b.width || 0 === b.height || isNaN(b.width) || isNaN(b.height)) && a.af() } sg.prototype.collectParts = sg.prototype.sH = function (a) { var b = new I(T); a instanceof D ? (ls(this, b, a.gg, !0, null, !0, !0, !0), ls(this, b, a.links, !0, null, !0, !0, !0), ls(this, b, a.Kk, !0, null, !0, !0, !0)) : a instanceof V ? ls(this, b, a.Oc, !1, null, !0, !0, !0) : ls(this, b, a.i, !1, null, !0, !0, !0); return b }; w.defineProperty(sg, { qe: "arrangementOrigin" }, function () { return this.Kq }, function (a) { w.G(a, z, sg, "arrangementOrigin"); this.Kq.L(a) || (this.Kq.assign(a), this.J()) }); sg.prototype.initialOrigin = function (a) { var b = this.group; if (null !== b) { var c = b.position.copy(); (isNaN(c.x) || isNaN(c.y)) && c.set(a); b = b.placeholder; null !== b && (c = b.Wa(xb), (isNaN(c.x) || isNaN(c.y)) && c.set(a), c.x += b.padding.left, c.y += b.padding.top); return c } return a }; function tg() { w.nc(this); this.ke = null; if (this.vertexes) for (var a = this.vertexes.i; a.next();) { var b = a.value; b.clear(); b.network = null } if (this.edges) for (a = this.edges.i; a.next();)b = a.value, b.clear(), b.network = null; this.vertexes = new I(ns); this.edges = new I(os); this.Nx = new la(U, ns); this.Jx = new la(W, os) } w.ga("LayoutNetwork", tg); tg.prototype.clear = function () { if (this.vertexes) for (var a = this.vertexes.i; a.next();) { var b = a.value; b.clear(); b.network = null } if (this.edges) for (a = this.edges.i; a.next();)b = a.value, b.clear(), b.network = null; this.vertexes = new I(ns); this.edges = new I(os); this.Nx = new la(U, ns); this.Jx = new la(W, os) }; tg.prototype.toString = function (a) { void 0 === a && (a = 0); var b = "LayoutNetwork" + (null !== this.Tb ? "(" + this.Tb.toString() + ")" : ""); if (0 >= a) return b; b += " vertexes: " + this.vertexes.count + " edges: " + this.edges.count; if (1 < a) { for (var c = this.vertexes.i; c.next();)b += "\n " + c.value.toString(a - 1); for (c = this.edges.i; c.next();)b += "\n " + c.value.toString(a - 1) } return b }; w.defineProperty(tg, { Tb: "layout" }, function () { return this.ke }, function (a) { this.ke = a }); tg.prototype.createVertex = function () { return new ns }; tg.prototype.createEdge = function () { return new os }; tg.prototype.addParts = tg.prototype.sk = function (a, b, c) { if (null !== a) { void 0 === b && (b = !1); w.j(b, "boolean", tg, "addParts:toplevelonly"); void 0 === c && (c = null); null === c && (c = function (a) { if (a instanceof U) return !a.Af; if (a instanceof W) { var b = a.V; if (null === b || b.Af) return !1; a = a.Z; return null === a || a.Af ? !1 : !0 } return !1 }); for (a = a.i; a.next();) { var d = a.value; if (d instanceof U && (!b || d.$p) && d.canLayout() && c(d)) if (d instanceof V && null === d.Tb) this.sk(d.Oc, !1); else if (null === this.zn(d)) { var e = this.createVertex(); e.Pc = d; this.El(e) } } for (a.reset(); a.next();)if (d = a.value, d instanceof W && (!b || d.$p) && d.canLayout() && c(d) && null === this.lx(d)) { var f = d.V, e = d.Z; null !== f && null !== e && f !== e && (f = this.findGroupVertex(f), e = this.findGroupVertex(e), null !== f && null !== e && this.eq(f, e, d)) } } }; tg.prototype.findGroupVertex = function (a) { if (null === a) return null; var b = a.findVisibleNode(); if (null === b) return null; a = this.zn(b); if (null !== a) return a; for (b = b.Da; null !== b;) { a = this.zn(b); if (null !== a) return a; b = b.Da } return null }; tg.prototype.addVertex = tg.prototype.El = function (a) { if (null !== a) { this.vertexes.add(a); var b = a.Pc; null !== b && this.Nx.add(b, a); a.network = this } }; tg.prototype.addNode = tg.prototype.xt = function (a) { if (null === a) return null; var b = this.zn(a); null === b && (b = this.createVertex(), b.Pc = a, this.El(b)); return b }; tg.prototype.deleteVertex = tg.prototype.FE = function (a) { if (null !== a && ps(this, a)) { for (var b = a.Pe, c = b.count - 1; 0 <= c; c--) { var d = b.ea(c); this.Np(d) } b = a.Ie; for (c = b.count - 1; 0 <= c; c--)d = b.ea(c), this.Np(d) } }; function ps(a, b) { if (null === b) return !1; var c = a.vertexes.remove(b); c && (a.Nx.remove(b.Pc), b.network = null); return c } tg.prototype.deleteNode = function (a) { null !== a && (a = this.zn(a), null !== a && this.FE(a)) }; tg.prototype.findVertex = tg.prototype.zn = function (a) { return null === a ? null : this.Nx.ja(a) }; tg.prototype.addEdge = tg.prototype.Cp = function (a) { if (null !== a) { this.edges.add(a); var b = a.link; null !== b && null === this.lx(b) && this.Jx.add(b, a); b = a.toVertex; null !== b && b.kE(a); b = a.fromVertex; null !== b && b.iE(a); a.network = this } }; tg.prototype.addLink = function (a) { if (null === a) return null; var b = a.V, c = a.Z, d = this.lx(a); null === d ? (d = this.createEdge(), d.link = a, null !== b && (d.fromVertex = this.xt(b)), null !== c && (d.toVertex = this.xt(c)), this.Cp(d)) : (d.fromVertex = null !== b ? this.xt(b) : null, d.toVertex = null !== c ? this.xt(c) : null); return d }; tg.prototype.deleteEdge = tg.prototype.Np = function (a) { if (null !== a) { var b = a.toVertex; null !== b && b.EE(a); b = a.fromVertex; null !== b && b.DE(a); qs(this, a) } }; function qs(a, b) { null !== b && a.edges.remove(b) && (a.Jx.remove(b.link), b.network = null) } tg.prototype.deleteLink = function (a) { null !== a && (a = this.lx(a), null !== a && this.Np(a)) }; tg.prototype.findEdge = tg.prototype.lx = function (a) { return null === a ? null : this.Jx.ja(a) }; tg.prototype.linkVertexes = tg.prototype.eq = function (a, b, c) { if (null === a || null === b) return null; if (a.network === this && b.network === this) { var d = this.createEdge(); d.link = c; d.fromVertex = a; d.toVertex = b; this.Cp(d); return d } return null }; tg.prototype.reverseEdge = tg.prototype.by = function (a) { if (null !== a) { var b = a.fromVertex, c = a.toVertex; null !== b && null !== c && (b.DE(a), c.EE(a), a.by(), b.kE(a), c.iE(a)) } }; tg.prototype.deleteSelfEdges = tg.prototype.gx = function () { for (var a = w.cb(), b = this.edges.i; b.next();) { var c = b.value; c.fromVertex === c.toVertex && a.push(c) } b = a.length; for (c = 0; c < b; c++)this.Np(a[c]); w.ua(a) }; tg.prototype.deleteArtificialVertexes = function () { for (var a = w.cb(), b = this.vertexes.i; b.next();) { var c = b.value; null === c.Pc && a.push(c) } for (var c = a.length, d = 0; d < c; d++)this.FE(a[d]); b = w.cb(); for (c = this.edges.i; c.next();)d = c.value, null === d.link && b.push(d); c = b.length; for (d = 0; d < c; d++)this.Np(b[d]); w.ua(a); w.ua(b) }; function rs(a) { for (var b = w.cb(), c = a.edges.i; c.next();) { var d = c.value; null !== d.fromVertex && null !== d.toVertex || b.push(d) } c = b.length; for (d = 0; d < c; d++)a.Np(b[d]); w.ua(b) } tg.prototype.splitIntoSubNetworks = tg.prototype.KJ = function () { this.deleteArtificialVertexes(); rs(this); this.gx(); for (var a = new H(tg), b = !0; b;)for (var b = !1, c = this.vertexes.i; c.next();) { var d = c.value; if (0 < d.Pe.count || 0 < d.Ie.count) { b = this.Tb.createNetwork(); a.add(b); ss(this, b, d); b = !0; break } } a.sort(function (a, b) { return null === a || null === b || a === b ? 0 : b.vertexes.count - a.vertexes.count }); return a }; function ss(a, b, c) { if (null !== c && c.network !== b) { ps(a, c); b.El(c); for (var d = c.mc; d.next();) { var e = d.value; e.network !== b && (qs(a, e), b.Cp(e), ss(a, b, e.fromVertex)) } for (d = c.kc; d.next();)c = d.value, c.network !== b && (qs(a, c), b.Cp(c), ss(a, b, c.toVertex)) } } tg.prototype.findAllParts = function () { for (var a = new I(T), b = this.vertexes.i; b.next();)a.add(b.value.Pc); for (b = this.edges.i; b.next();)a.add(b.value.link); return a }; function ns() { w.nc(this); this.network = null; this.M = (new B(0, 0, 10, 10)).freeze(); this.T = (new z(5, 5)).freeze(); this.sd = this.Yd = null; this.Pe = new H(os); this.Ie = new H(os) } w.ga("LayoutVertex", ns); ns.prototype.clear = function () { this.sd = this.Yd = null; this.Pe = new H(os); this.Ie = new H(os) }; ns.prototype.toString = function (a) { void 0 === a && (a = 0); var b = "LayoutVertex#" + w.Nd(this); if (0 < a && (b += null !== this.Pc ? "(" + this.Pc.toString() + ")" : "", 1 < a)) { a = ""; for (var c = !0, d = this.Pe.i; d.next();) { var e = d.value; c ? c = !1 : a += ","; a += e.toString(0) } e = ""; c = !0; for (d = this.Ie.i; d.next();) { var f = d.value; c ? c = !1 : e += ","; e += f.toString(0) } b += " sources: " + a + " destinations: " + e } return b }; w.defineProperty(ns, { data: "data" }, function () { return this.Yd }, function (a) { this.Yd = a; if (null !== a) { var b = a.bounds; a = b.x; var c = b.y, d = b.width, b = b.height; this.T.m(d / 2, b / 2); this.M.m(a, c, d, b) } }); w.defineProperty(ns, { Pc: "node" }, function () { return this.sd }, function (a) { if (this.sd !== a) { this.sd = a; a.af(); var b = a.Y, c = b.x, d = b.y, e = b.width, b = b.height; isNaN(c) && (c = 0); isNaN(d) && (d = 0); this.M.m(c, d, e, b); if (!(a instanceof V) && (a = a.$f.Wa(Hb), a.I())) { this.T.m(a.x - c, a.y - d); return } this.T.m(e / 2, b / 2) } }); w.defineProperty(ns, { gb: "bounds" }, function () { return this.M }, function (a) { this.M.L(a) || this.M.assign(a) }); w.defineProperty(ns, { focus: "focus" }, function () { return this.T }, function (a) { this.T.L(a) || this.T.assign(a) }); w.defineProperty(ns, { ka: "centerX" }, function () { return this.M.x + this.T.x }, function (a) { var b = this.M; b.x + this.T.x !== a && (b.Qa(), b.x = a - this.T.x, b.freeze()) }); w.defineProperty(ns, { ra: "centerY" }, function () { return this.M.y + this.T.y }, function (a) { var b = this.M; b.y + this.T.y !== a && (b.Qa(), b.y = a - this.T.y, b.freeze()) }); w.defineProperty(ns, { Tt: "focusX" }, function () { return this.T.x }, function (a) { var b = this.T; b.x !== a && (b.Qa(), b.x = a, b.freeze()) }); w.defineProperty(ns, { Ut: "focusY" }, function () { return this.T.y }, function (a) { var b = this.T; b.y !== a && (b.Qa(), b.y = a, b.freeze()) }); w.defineProperty(ns, { x: "x" }, function () { return this.M.x }, function (a) { var b = this.M; b.x !== a && (b.Qa(), b.x = a, b.freeze()) }); w.defineProperty(ns, { y: "y" }, function () { return this.M.y }, function (a) { var b = this.M; b.y !== a && (b.Qa(), b.y = a, b.freeze()) }); w.defineProperty(ns, { width: "width" }, function () { return this.M.width }, function (a) { var b = this.M; b.width !== a && (b.Qa(), b.width = a, b.freeze()) }); w.defineProperty(ns, { height: "height" }, function () { return this.M.height }, function (a) { var b = this.M; b.height !== a && (b.Qa(), b.height = a, b.freeze()) }); ns.prototype.commit = function () { var a = this.Yd; if (null !== a) { var b = this.gb, c = a.bounds; w.Pa(c) ? (c.x = b.x, c.y = b.y, c.width = b.width, c.height = b.height) : a.bounds = b.copy() } else if (a = this.Pc, null !== a) { b = this.gb; if (!(a instanceof V)) { var c = a.Y, d = a.$f.Wa(Hb); if (c.I() && d.I()) { a.moveTo(b.x + this.Tt - (d.x - c.x), b.y + this.Ut - (d.y - c.y)); return } } a.moveTo(b.x, b.y) } }; ns.prototype.addSourceEdge = ns.prototype.kE = function (a) { null !== a && (this.Pe.contains(a) || this.Pe.add(a)) }; ns.prototype.deleteSourceEdge = ns.prototype.EE = function (a) { null !== a && this.Pe.remove(a) }; ns.prototype.addDestinationEdge = ns.prototype.iE = function (a) { null !== a && (this.Ie.contains(a) || this.Ie.add(a)) }; ns.prototype.deleteDestinationEdge = ns.prototype.DE = function (a) { null !== a && this.Ie.remove(a) }; w.u(ns, { JJ: "sourceVertexes" }, function () { for (var a = new I(ns), b = this.mc; b.next();)a.add(b.value.fromVertex); return a.i }); w.u(ns, { MH: "destinationVertexes" }, function () { for (var a = new I(ns), b = this.kc; b.next();)a.add(b.value.toVertex); return a.i }); w.u(ns, { vertexes: "vertexes" }, function () { for (var a = new I(ns), b = this.mc; b.next();)a.add(b.value.fromVertex); for (b = this.kc; b.next();)a.add(b.value.toVertex); return a.i }); w.u(ns, { mc: "sourceEdges" }, function () { return this.Pe.i }); w.u(ns, { kc: "destinationEdges" }, function () { return this.Ie.i }); w.u(ns, { edges: "edges" }, function () { for (var a = new H(os), b = this.mc; b.next();)a.add(b.value); for (b = this.kc; b.next();)a.add(b.value); return a.i }); w.u(ns, { RH: "edgesCount" }, function () { return this.Pe.count + this.Ie.count }); var ts; ns.standardComparer = ts = function (a, b) { var c = a.sd, d = b.sd; return c ? d ? (c = c.text, d = d.text, c < d ? -1 : c > d ? 1 : 0) : 1 : null !== d ? -1 : 0 }; ns.smartComparer = function (a, b) { if (null !== a) { if (null !== b) { var c = a.sd, d = b.sd; if (null !== c) { if (null !== d) { for (var c = c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), d = d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), e = 0; e < c.length; e++)if ("" !== d[e] && void 0 !== d[e]) { var f = parseFloat(c[e]), h = parseFloat(d[e]); if (isNaN(f)) { if (!isNaN(h)) return 1; if (0 !== c[e].localeCompare(d[e])) return c[e].localeCompare(d[e]) } else { if (isNaN(h)) return -1; if (0 !== f - h) return f - h } } else if ("" !== c[e]) return 1; return "" !== d[e] && void 0 !== d[e] ? -1 : 0 } return 1 } return null !== d ? -1 : 0 } return 1 } return null !== b ? -1 : 0 }; function os() { w.nc(this); this.toVertex = this.fromVertex = this.link = this.data = this.network = null } w.ga("LayoutEdge", os); os.prototype.clear = function () { this.toVertex = this.fromVertex = this.link = this.data = null }; os.prototype.toString = function (a) { void 0 === a && (a = 0); var b = "LayoutEdge#" + w.Nd(this); 0 < a && (b += null !== this.link ? "(" + this.link.toString() + ")" : "", 1 < a && (b += " " + (this.fromVertex ? this.fromVertex.toString() : "null") + " --\x3e " + (this.toVertex ? this.toVertex.toString() : "null"))); return b }; os.prototype.by = function () { var a = this.fromVertex; this.fromVertex = this.toVertex; this.toVertex = a }; os.prototype.commit = function () { }; os.prototype.getOtherVertex = os.prototype.aI = function (a) { return this.toVertex === a ? this.fromVertex : this.fromVertex === a ? this.toVertex : null }; function On() { 0 < arguments.length && w.jd(On); sg.call(this); this.Ex = !0; this.st = this.tt = NaN; this.Jj = (new ia(NaN, NaN)).freeze(); this.ei = (new ia(10, 10)).freeze(); this.ie = us; this.md = vs; this.di = ws; this.Nh = xs } w.Ka(On, sg); w.ga("GridLayout", On); On.prototype.cloneProtected = function (a) { sg.prototype.cloneProtected.call(this, a); a.tt = this.tt; a.st = this.st; a.Jj.assign(this.Jj); a.ei.assign(this.ei); a.ie = this.ie; a.md = this.md; a.di = this.di; a.Nh = this.Nh }; On.prototype.ic = function (a) { a.Ee === On ? a === ws || a === ys || a === zs || a === As ? this.sorting = a : a === vs || a === Bs ? this.Tf = a : a === us || a === Cs ? this.alignment = a : w.k("Unknown enum value: " + a) : sg.prototype.ic.call(this, a) }; On.prototype.doLayout = function (a) { null === a && w.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts"); this.qe = this.initialOrigin(this.qe); var b = this.g; a = this.sH(a); for (var c = a.copy().i; c.next();) { var d = c.value; if (d instanceof W) { var e = d; if (null !== e.V || null !== e.Z) { a.remove(e); continue } } d.af(); if (d instanceof V) for (d = d.Oc; d.next();)a.remove(d.value) } e = a.gc(); if (0 !== e.length) { switch (this.sorting) { case As: e.reverse(); break; case ws: e.sort(this.comparer); break; case ys: e.sort(this.comparer), e.reverse() }var f = this.$J; isNaN(f) && (f = 0); var h = this.FG, h = isNaN(h) && null !== b ? Math.max(b.pb.width - b.padding.left - b.padding.right, 0) : Math.max(this.FG, 0); 0 >= f && 0 >= h && (f = 1); a = this.spacing.width; isFinite(a) || (a = 0); c = this.spacing.height; isFinite(c) || (c = 0); null !== b && b.Pb("Layout"); d = []; switch (this.alignment) { case Cs: var k = a, l = c, m = Math.max(this.Fp.width, 1); if (!isFinite(m)) for (var n = m = 0; n < e.length; n++)var p = e[n], q = p.za, m = Math.max(m, q.width); var m = Math.max(m + k, 1), r = Math.max(this.Fp.height, 1); if (!isFinite(r)) for (n = r = 0; n < e.length; n++)p = e[n], q = p.za, r = Math.max(r, q.height); for (var r = Math.max(r + l, 1), s = this.Tf, u = this.qe.x, t = u, x = this.qe.y, v = 0, A = 0, n = 0; n < e.length; n++) { var p = e[n], q = p.za, y = Math.ceil((q.width + k) / m) * m, K = Math.ceil((q.height + l) / r) * r, E = 0; switch (s) { case Bs: E = Math.abs(t - q.width); break; default: E = t + q.width }if (0 < f && v > f - 1 || 0 < h && 0 < v && E > h) d.push(new B(0, x, h + k, A)), v = 0, t = u, x += A, A = 0; A = Math.max(A, K); K = 0; switch (s) { case Bs: K = -q.width; break; default: K = 0 }p.moveTo(t + K, x); switch (s) { case Bs: t -= y; break; default: t += y }v++ } d.push(new B(0, x, h + k, A)); break; case us: k = f; l = a; m = c; n = Math.max(this.Fp.width, 1); p = x = y = 0; q = w.K(); for (f = 0; f < e.length; f++)r = e[f], s = r.za, u = cr(r, r.$f, r.Ef, q), y = Math.max(y, u.x), x = Math.max(x, s.width - u.x), p = Math.max(p, u.y); t = this.Tf; switch (t) { case Bs: y += l; break; default: x += l }var n = isFinite(n) ? Math.max(n + l, 1) : Math.max(y + x, 1), Q = x = this.qe.x, v = this.qe.y, A = 0; h >= y && (h -= y); for (var y = K = 0, E = Math.max(this.Fp.height, 1), X = p = 0, O = !0, aa = w.K(), f = 0; f < e.length; f++) { r = e[f]; s = r.za; u = cr(r, r.$f, r.Ef, q); if (0 < A) switch (t) { case Bs: Q = (Q - x - (s.width - u.x)) / n; Q = Va(Math.round(Q), Q) ? Math.round(Q) : Math.floor(Q); Q = Q * n + x; break; default: Q = (Q - x + u.x) / n, Q = Va(Math.round(Q), Q) ? Math.round(Q) : Math.ceil(Q), Q = Q * n + x } else switch (t) { case Bs: K = Q + u.x + s.width; break; default: K = Q - u.x }var da = 0; switch (t) { case Bs: da = -(Q + u.x) + K; break; default: da = Q + s.width - u.x - K }if (0 < k && A > k - 1 || 0 < h && 0 < A && da > h) { d.push(new B(0, O ? v - p : v, h + l, X + p + m)); for (Q = 0; Q < A && f !== A; Q++) { var da = e[f - A + Q], S = cr(da, da.$f, da.Ef, aa); da.moveTo(da.position.x, da.position.y + p - S.y) } X += m; v = O ? v + X : v + (X + p); A = X = p = 0; Q = x; O = !1 } Q === x && (y = t === Bs ? Math.max(y, s.width - u.x) : Math.min(y, -u.x)); p = Math.max(p, u.y); X = Math.max(X, s.height - u.y); isFinite(E) && (X = Math.max(X, Math.max(s.height, E) - u.y)); O ? r.moveTo(Q - u.x, v - u.y) : r.moveTo(Q - u.x, v); switch (t) { case Bs: Q -= u.x + l; break; default: Q += s.width - u.x + l }A++ } d.push(new B(0, v, h + l, (O ? X : X + p) + m)); for (Q = 0; Q < A && f !== A; Q++)da = e[f - A + Q], S = cr(da, da.$f, da.Ef, q), da.moveTo(da.position.x, da.position.y + p - S.y); w.v(q); w.v(aa); if (t === Bs) for (f = 0; f < d.length; f++)e = d[f], e.width += y, e.x -= y; else for (f = 0; f < d.length; f++)e = d[f], e.x > y && (e.width += e.x - y, e.x = y) }for (k = f = h = e = 0; k < d.length; k++)l = d[k], e = Math.min(e, l.x), h = Math.min(h, l.y), f = Math.max(f, l.x + l.width); this.Tf === Bs ? this.commitLayers(d, new z(e + a / 2 - (f + e), h - c / 2)) : this.commitLayers(d, new z(e - a / 2, h - c / 2)); null !== b && b.wd("Layout"); this.Cf = !0 } }; On.prototype.commitLayers = function () { }; w.defineProperty(On, { FG: "wrappingWidth" }, function () { return this.tt }, function (a) { this.tt !== a && (w.j(a, "number", On, "wrappingWidth"), 0 < a || isNaN(a)) && (this.tt = a, this.Ex = isNaN(a), this.J()) }); w.defineProperty(On, { $J: "wrappingColumn" }, function () { return this.st }, function (a) { this.st !== a && (w.j(a, "number", On, "wrappingColumn"), 0 < a || isNaN(a)) && (this.st = a, this.J()) }); w.defineProperty(On, { Fp: "cellSize" }, function () { return this.Jj }, function (a) { w.G(a, ia, On, "cellSize"); this.Jj.L(a) || (this.Jj.assign(a), this.J()) }); w.defineProperty(On, { spacing: "spacing" }, function () { return this.ei }, function (a) { w.G(a, ia, On, "spacing"); this.ei.L(a) || (this.ei.assign(a), this.J()) }); w.defineProperty(On, { alignment: "alignment" }, function () { return this.ie }, function (a) { this.ie !== a && (w.mb(a, On, On, "alignment"), a === us || a === Cs) && (this.ie = a, this.J()) }); w.defineProperty(On, { Tf: "arrangement" }, function () { return this.md }, function (a) { this.md !== a && (w.mb(a, On, On, "arrangement"), a === vs || a === Bs) && (this.md = a, this.J()) }); w.defineProperty(On, { sorting: "sorting" }, function () { return this.di }, function (a) { this.di !== a && (w.mb(a, On, On, "sorting"), a === zs || a === As || a === ws || a === ys) && (this.di = a, this.J()) }); w.defineProperty(On, { comparer: "comparer" }, function () { return this.Nh }, function (a) { this.Nh !== a && (w.j(a, "function", On, "comparer"), this.Nh = a, this.J()) }); var xs; On.standardComparer = xs = function (a, b) { var c = a.text, d = b.text; return c < d ? -1 : c > d ? 1 : 0 }; On.smartComparer = function (a, b) { if (null !== a) { if (null !== b) { for (var c = a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), d = b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), e = 0; e < c.length; e++)if ("" !== d[e] && void 0 !== d[e]) { var f = parseFloat(c[e]), h = parseFloat(d[e]); if (isNaN(f)) { if (!isNaN(h)) return 1; if (0 !== c[e].localeCompare(d[e])) return c[e].localeCompare(d[e]) } else { if (isNaN(h)) return -1; if (0 !== f - h) return f - h } } else if ("" !== c[e]) return 1; return "" !== d[e] && void 0 !== d[e] ? -1 : 0 } return 1 } return null !== b ? -1 : 0 }; var Cs; On.Position = Cs = w.p(On, "Position", 0); var us; On.Location = us = w.p(On, "Location", 1); var vs; On.LeftToRight = vs = w.p(On, "LeftToRight", 2); var Bs; On.RightToLeft = Bs = w.p(On, "RightToLeft", 3); var zs; On.Forward = zs = w.p(On, "Forward", 4); var As; On.Reverse = As = w.p(On, "Reverse", 5); var ws; On.Ascending = ws = w.p(On, "Ascending", 6); var ys; On.Descending = ys = w.p(On, "Descending", 7); function Ds() { 0 < arguments.length && w.jd(Ds); sg.call(this); this.$y = this.Do = this.Zd = 0; this.rr = 360; this.Zy = Es; this.cl = 0; this.EC = Es; this.kv = this.Jg = this.WD = 0; this.Kw = new Fs; this.lv = this.Rm = 0; this.TG = 600; this.Fs = NaN; this.Mq = 1; this.ft = 0; this.ht = 360; this.md = Es; this.aa = Gs; this.di = Hs; this.Nh = ts; this.ei = 6; this.ts = Is } w.Ka(Ds, sg); w.ga("CircularLayout", Ds); Ds.prototype.cloneProtected = function (a) { sg.prototype.cloneProtected.call(this, a); a.Fs = this.Fs; a.Mq = this.Mq; a.ft = this.ft; a.ht = this.ht; a.md = this.md; a.aa = this.aa; a.di = this.di; a.Nh = this.Nh; a.ei = this.ei; a.ts = this.ts }; Ds.prototype.ic = function (a) { if (a.Ee === Ds) if (a === Js || a === Ks || a === Ls || a === Ms || a === Hs) this.sorting = a; else if (a === Ns || a === Os || a === Gs || a === Ps) this.direction = a; else if (a === Qs || a === Rs || a === Es || a === Ss) this.Tf = a; else { if (a === Ts || a === Is) this.Mx = a } else sg.prototype.ic.call(this, a) }; Ds.prototype.createNetwork = function () { return new Us }; Ds.prototype.doLayout = function (a) { null === a && w.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts"); null === this.network && (this.network = this.makeNetwork(a)); a = this.network.vertexes; if (1 >= a.count) 1 === a.count && (a = a.first(), a.ka = 0, a.ra = 0); else { var b = new H(Vs); b.Jc(a.i); a = new H(Vs); var c = new H(Vs), d; d = this.sort(b); var e = this.Zy, f = this.EC, h = this.Zd, k = this.Do, l = this.$y, m = this.rr, b = this.cl, n = this.WD, p = this.Jg, q = this.kv, e = this.Tf, f = this.Mx, h = this.kJ; if (!isFinite(h) || 0 >= h) h = NaN; k = this.mH; if (!isFinite(k) || 0 >= k) k = 1; l = this.ze; isFinite(l) || (l = 0); m = this.of; if (!isFinite(m) || 360 < m || 1 > m) m = 360; b = this.spacing; isFinite(b) || (b = NaN); e === Ss && f === Ts ? e = Es : e === Ss && f !== Ts && (f = Ts, e = this.Tf); if ((this.direction === Ns || this.direction === Os) && this.sorting !== Hs) { for (var r = 0; !(r >= d.length); r += 2) { a.add(d.ea(r)); if (r + 1 >= d.length) break; c.add(d.ea(r + 1)) } this.direction === Ns ? (this.Tf === Ss && a.reverse(), d = new H(Vs), d.Jc(a), d.Jc(c)) : (this.Tf === Ss && c.reverse(), d = new H(Vs), d.Jc(c), d.Jc(a)) } for (var s = d.length, u = n = 0, r = 0; r < d.length; r++) { var p = l + m * u * (this.direction === Gs ? 1 : -1) / s, t = d.ea(r).diameter; isNaN(t) && (t = Ws(d.ea(r), p)); 360 > m && (0 === r || r === d.length - 1) && (t /= 2); n += t; u++ } if (isNaN(h) || e === Ss) { isNaN(b) && (b = 6); if (e !== Es && e !== Ss) { t = -Infinity; for (r = 0; r < s; r++) { var q = d.ea(r), x = d.ea(r === s - 1 ? 0 : r + 1); isNaN(q.diameter) && Ws(q, 0); isNaN(x.diameter) && Ws(x, 0); t = Math.max(t, (q.diameter + x.diameter) / 2) } q = t + b; e === Qs ? (p = 2 * Math.PI / s, h = (t + b) / p) : h = Xs(this, q * (360 <= m ? s : s - 1), k, l * Math.PI / 180, m * Math.PI / 180) } else h = Xs(this, n + (360 <= m ? s : s - 1) * (e !== Ss ? b : 1.6 * b), k, l * Math.PI / 180, m * Math.PI / 180); p = h * k } else if (p = h * k, u = Ys(this, h, p, l * Math.PI / 180, m * Math.PI / 180), isNaN(b)) { if (e === Es || e === Ss) b = (u - n) / (360 <= m ? s : s - 1) } else if (e === Es || e === Ss) r = (u - n) / (360 <= m ? s : s - 1), r < b ? (h = Xs(this, n + b * (360 <= m ? s : s - 1), k, l * Math.PI / 180, m * Math.PI / 180), p = h * k) : b = r; else { t = -Infinity; for (r = 0; r < s; r++)q = d.ea(r), x = d.ea(r === s - 1 ? 0 : r + 1), isNaN(q.diameter) && Ws(q, 0), isNaN(x.diameter) && Ws(x, 0), t = Math.max(t, (q.diameter + x.diameter) / 2); q = t + b; r = Xs(this, q * (360 <= m ? s : s - 1), k, l * Math.PI / 180, m * Math.PI / 180); r > h ? (h = r, p = h * k) : q = u / (360 <= m ? s : s - 1) } this.Zy = e; this.EC = f; this.Zd = h; this.Do = k; this.$y = l; this.rr = m; this.cl = b; this.WD = n; this.Jg = p; this.kv = q; b = d; d = this.Zy; e = this.Zd; f = this.$y; k = this.rr; l = this.cl; m = this.Jg; n = this.kv; if (this.direction !== Ns && this.direction !== Os || d !== Ss) if (this.direction === Ns || this.direction === Os) { h = 0; switch (d) { case Rs: h = 180 * Zs(this, e, m, f, n) / Math.PI; break; case Es: n = b = 0; h = a.first(); null !== h && (b = Ws(h, Math.PI / 2)); h = c.first(); null !== h && (n = Ws(h, Math.PI / 2)); h = 180 * Zs(this, e, m, f, l + (b + n) / 2) / Math.PI; break; case Qs: h = k / b.length }if (this.direction === Ns) { switch (d) { case Rs: $s(this, a, f, Ps); break; case Es: at(this, a, f, Ps); break; case Qs: bt(this, a, k / 2, f, Ps) }switch (d) { case Rs: $s(this, c, f + h, Gs); break; case Es: at(this, c, f + h, Gs); break; case Qs: bt(this, c, k / 2, f + h, Gs) } } else { switch (d) { case Rs: $s(this, c, f, Ps); break; case Es: at(this, c, f, Ps); break; case Qs: bt(this, c, k / 2, f, Ps) }switch (d) { case Rs: $s(this, a, f + h, Gs); break; case Es: at(this, a, f + h, Gs); break; case Qs: bt(this, a, k / 2, f + h, Gs) } } } else switch (d) { case Rs: $s(this, b, f, this.direction); break; case Es: at(this, b, f, this.direction); break; case Qs: bt(this, b, k, f, this.direction); break; case Ss: ct(this, b, k, f, this.direction) } else ct(this, b, k, f - k / 2, Gs) } this.updateParts(); this.network = null; this.Cf = !0 }; function bt(a, b, c, d, e) { var f = a.rr, h = a.Zd; a = a.Jg; d = d * Math.PI / 180; c = c * Math.PI / 180; for (var k = b.length, l = 0; l < k; l++) { var m = d + (e === Gs ? l * c / (360 <= f ? k : k - 1) : -(l * c) / k), n = b.ea(l), p = h * Math.tan(m) / a, p = Math.sqrt((h * h + a * a * p * p) / (1 + p * p)); n.ka = p * Math.cos(m); n.ra = p * Math.sin(m); n.actualAngle = 180 * m / Math.PI } } function at(a, b, c, d) { var e = a.Zd, f = a.Jg, h = a.cl; c = c * Math.PI / 180; for (var k = b.length, l = 0; l < k; l++) { var m = b.ea(l), n = b.ea(l === k - 1 ? 0 : l + 1), p = f * Math.sin(c); m.ka = e * Math.cos(c); m.ra = p; m.actualAngle = 180 * c / Math.PI; isNaN(m.diameter) && Ws(m, 0); isNaN(n.diameter) && Ws(n, 0); m = Zs(a, e, f, d === Gs ? c : -c, (m.diameter + n.diameter) / 2 + h); c += d === Gs ? m : -m } } function $s(a, b, c, d) { var e = a.Zd, f = a.Jg, h = a.kv; c = c * Math.PI / 180; for (var k = b.length, l = 0; l < k; l++) { var m = b.ea(l); m.ka = e * Math.cos(c); m.ra = f * Math.sin(c); m.actualAngle = 180 * c / Math.PI; m = Zs(a, e, f, d === Gs ? c : -c, h); c += d === Gs ? m : -m } } function ct(a, b, c, d, e) { var f = a.lv, f = a.rr; a.Rm = 0; a.Kw = new Fs; if (360 > c) { for (f = d + (e === Gs ? f : -f); 0 > f;)f += 360; f %= 360; 180 < f && (f -= 360); f *= Math.PI / 180; a.lv = f; dt(a, b, c, d, e) } else et(a, b, c, d, e); a.Kw.commit(b) } function et(a, b, c, d, e) { var f = a.Zd, h = a.cl, k = a.Do, l = f * Math.cos(d * Math.PI / 180), m = a.Jg * Math.sin(d * Math.PI / 180), n = b.gc(); if (3 === n.length) n[0].ka = f, n[0].ra = 0, n[1].ka = n[0].ka - n[0].width / 2 - n[1].width / 2 - h, n[1].y = n[0].y, n[2].ka = (n[0].ka + n[1].ka) / 2, n[2].y = n[0].y - n[2].height - h; else if (4 === n.length) n[0].ka = f, n[0].ra = 0, n[2].ka = -n[0].ka, n[2].ra = n[0].ra, n[1].ka = 0, n[1].y = Math.min(n[0].y, n[2].y) - n[1].height - h, n[3].ka = 0, n[3].y = Math.max(n[0].y + n[0].height + h, n[2].y + n[2].height + h); else { for (var f = w.K(), p = 0; p < n.length; p++) { n[p].ka = l; n[p].ra = m; if (p >= n.length - 1) break; ft(a, l, m, n, p, e, f) || gt(a, l, m, n, p, e, f); l = f.x; m = f.y } w.v(f); a.Rm++; if (!(23 < a.Rm)) { var l = n[0].ka, m = n[0].ra, f = n[n.length - 1].ka, p = n[n.length - 1].ra, q = Math.abs(l - f) - ((n[0].width + n[n.length - 1].width) / 2 + h), r = Math.abs(m - p) - ((n[0].height + n[n.length - 1].height) / 2 + h), h = 0; 1 > Math.abs(r) ? Math.abs(l - f) < (n[0].width + n[n.length - 1].width) / 2 && (h = 0) : h = 0 < r ? r : 1 > Math.abs(q) ? 0 : q; q = !1; q = Math.abs(f) > Math.abs(p) ? 0 < f !== m > p : 0 < p !== l < f; if (q = e === Gs ? q : !q) h = -Math.abs(h), h = Math.min(h, -n[n.length - 1].width), h = Math.min(h, -n[n.length - 1].height); a.Kw.compare(h, n); 1 < Math.abs(h) && (a.Zd = 8 > a.Rm ? a.Zd - h / (2 * Math.PI) : 5 > n.length && 10 < h ? a.Zd / 2 : a.Zd - (0 < h ? 1.7 : -2.3), a.Jg = a.Zd * k, et(a, b, c, d, e)) } } } function dt(a, b, c, d, e) { for (var f = a.Zd, h = a.Jg, k = a.Do, l = f * Math.cos(d * Math.PI / 180), m = h * Math.sin(d * Math.PI / 180), n = w.K(), p = b.gc(), q = 0; q < p.length; q++) { p[q].ka = l; p[q].ra = m; if (q >= p.length - 1) break; ft(a, l, m, p, q, e, n) || gt(a, l, m, p, q, e, n); l = n.x; m = n.y } w.v(n); a.Rm++; if (!(23 < a.Rm)) { l = Math.atan2(m, l); l = e === Gs ? a.lv - l : l - a.lv; l = Math.abs(l) < Math.abs(l - 2 * Math.PI) ? l : l - 2 * Math.PI; f = l * (f + h) / 2; h = a.Kw; if (Math.abs(f) < Math.abs(h.Tp)) for (h.Tp = f, h.fo = [], h.Aq = [], l = 0; l < p.length; l++)h.fo[l] = p[l].gb.x, h.Aq[l] = p[l].gb.y; 1 < Math.abs(f) && (a.Zd = 8 > a.Rm ? a.Zd - f / (2 * Math.PI) : a.Zd - (0 < f ? 1.7 : -2.3), a.Jg = a.Zd * k, dt(a, b, c, d, e)) } } function ft(a, b, c, d, e, f, h) { var k = a.Zd, l = a.Jg, m = 0, n = 0; a = (d[e].width + d[e + 1].width) / 2 + a.cl; var p = !1; if (0 <= c !== (f === Gs)) { if (m = b + a, m > k) { m = b - a; if (m < -k) return h.x = m, h.y = n, !1; p = !0 } } else if (m = b - a, m < -k) { m = b + a; if (m > k) return h.x = m, h.y = n, !1; p = !0 } n = Math.sqrt(1 - Math.min(1, m * m / (k * k))) * l; 0 > c !== p && (n = -n); if (Math.abs(c - n) > (d[e].height + d[e + 1].height) / 2) return h.x = m, h.y = n, !1; h.x = m; h.y = n; return !0 } function gt(a, b, c, d, e, f, h) { var k = a.Zd, l = a.Jg, m = 0, n = 0; a = (d[e].height + d[e + 1].height) / 2 + a.cl; d = !1; if (0 <= b !== (f === Gs)) { if (n = c - a, n < -l) { n = c + a; if (n > l) { h.x = m; h.y = n; return } d = !0 } } else if (n = c + a, n > l) { n = c - a; if (n < -l) { h.x = m; h.y = n; return } d = !0 } m = Math.sqrt(1 - Math.min(1, n * n / (l * l))) * k; 0 > b !== d && (m = -m); h.x = m; h.y = n } Ds.prototype.commitLayout = function () { this.commitNodes(); this.iu && this.commitLinks() }; Ds.prototype.commitNodes = function () { for (var a = this.bH, b = this.network.vertexes.i; b.next();) { var c = b.value; c.x += a.x; c.y += a.y; c.commit() } }; Ds.prototype.commitLinks = function () { for (var a = this.network.edges.i; a.next();)a.value.commit() }; function Ys(a, b, c, d, e) { var f = a.TG; if (.001 > Math.abs(a.Do - 1)) return void 0 !== d && void 0 !== e ? e * b : 2 * Math.PI * b; a = b > c ? Math.sqrt(b * b - c * c) / b : Math.sqrt(c * c - b * b) / c; for (var h = 0, k = 0, k = void 0 !== d && void 0 !== e ? e / (f + 1) : Math.PI / (2 * (f + 1)), l = 0, m = 0; m <= f; m++)l = void 0 !== d && void 0 !== e ? d + m * e / f : m * Math.PI / (2 * f), l = Math.sin(l), h += Math.sqrt(1 - a * a * l * l) * k; return void 0 !== d && void 0 !== e ? (b > c ? b : c) * h : 4 * (b > c ? b : c) * h } function Xs(a, b, c, d, e) { var f = 0, f = void 0 !== d && void 0 !== e ? Ys(a, 1, c, d, e) : Ys(a, 1, c); return b / f } function Zs(a, b, c, d, e) { if (.001 > Math.abs(a.Do - 1)) return e / b; var f = b > c ? Math.sqrt(b * b - c * c) / b : Math.sqrt(c * c - b * b) / c, h = 0; a = 2 * Math.PI / (700 * a.network.vertexes.count); b > c && (d += Math.PI / 2); for (var k = 0; ; k++) { var l = Math.sin(d + k * a), h = h + (b > c ? b : c) * Math.sqrt(1 - f * f * l * l) * a; if (h >= e) return k * a } } Ds.prototype.sort = function (a) { switch (this.sorting) { case Ls: break; case Ms: a.reverse(); break; case Js: a.sort(this.comparer); break; case Ks: a.sort(this.comparer); a.reverse(); break; case Hs: for (var b = [], c = 0; c < a.length; c++)b.push(0); for (var d = new H(Vs), c = 0; c < a.length; c++) { var e = -1, f = -1; if (0 === c) for (var h = 0; h < a.length; h++) { var k = a.ea(h).RH; k > e && (e = k, f = h) } else for (h = 0; h < a.length; h++)k = b[h], k > e && (e = k, f = h); d.add(a.ea(f)); b[f] = -1; f = a.ea(f); e = 0; for (h = f.mc; h.next();)e = a.indexOf(h.value.fromVertex), 0 > e || 0 <= b[e] && b[e]++; for (f = f.kc; f.next();)e = a.indexOf(f.value.toVertex), 0 > e || 0 <= b[e] && b[e]++ } a = []; for (f = 0; f < d.length; f++) { b = d.ea(f); a[f] = []; for (var l = 0, c = b.kc; c.next();)l = d.indexOf(c.value.toVertex), l !== f && 0 > a[f].indexOf(l) && a[f].push(l); for (b = b.mc; b.next();)l = d.indexOf(b.value.fromVertex), l !== f && 0 > a[f].indexOf(l) && a[f].push(l) } h = []; for (f = 0; f < a.length; f++)h[f] = 0; for (var b = [], k = [], m = [], c = [], e = new H(Vs), n = 0, f = 0; f < a.length; f++) { var p = a[f].length; if (1 === p) c.push(f); else if (0 === p) e.add(d.ea(f)); else { if (0 === n) b.push(f); else { for (var q = Infinity, r = Infinity, s = -1, u = [], p = 0; p < b.length; p++)0 > a[b[p]].indexOf(b[p === b.length - 1 ? 0 : p + 1]) && u.push(p === b.length - 1 ? 0 : p + 1); if (0 === u.length) for (p = 0; p < b.length; p++)u.push(p); for (p = 0; p < u.length; p++) { var t = u[p], x, l = a[f]; x = k; for (var v = m, A = h, y = t, K = b, E = 0, Q = 0; Q < x.length; Q++) { var X = A[x[Q]], O = A[v[Q]], aa = 0, da = 0; X < O ? (aa = X, da = O) : (aa = O, da = X); if (aa < y && y <= da) for (X = 0; X < l.length; X++)O = l[X], 0 > K.indexOf(O) || aa < A[O] && A[O] < da || aa === A[O] || da === A[O] || E++; else for (X = 0; X < l.length; X++)O = l[X], 0 > K.indexOf(O) || aa < A[O] && A[O] < da && aa !== A[O] && da !== A[O] && E++ } x = E; for (A = v = 0; A < a[f].length; A++)l = b.indexOf(a[f][A]), 0 <= l && (l = Math.abs(t - (l >= t ? l + 1 : l)), v += l < b.length + 1 - l ? l : b.length + 1 - l); for (A = 0; A < k.length; A++)l = h[k[A]], y = h[m[A]], l >= t && l++ , y >= t && y++ , l > y && (K = y, y = l, l = K), y - l < (b.length + 2) / 2 === (l < t && t <= y) && v++; if (x < q || x === q && v < r) q = x, r = v, s = t } b.splice(s, 0, f); for (p = 0; p < b.length; p++)h[b[p]] = p; for (p = 0; p < a[f].length; p++)q = a[f][p], 0 <= b.indexOf(q) && (k.push(f), m.push(q)) } n++ } } f = !1; for (h = b.length; ;) { f = !0; for (k = 0; k < c.length; k++)if (m = c[k], n = a[m][0], l = b.indexOf(n), 0 <= l) { for (r = p = 0; r < a[n].length; r++)q = a[n][r], q = b.indexOf(q), 0 > q || q === l || (s = q > l ? q - l : l - q, p += q < l !== s > h - s ? 1 : -1); b.splice(0 > p ? l : l + 1, 0, m); c.splice(k, 1); k-- } else f = !1; if (f) break; else b.push(c[0]), c.splice(0, 1) } for (f = 0; f < b.length; f++)e.add(d.ea(b[f])); return e; default: w.k("Invalid sorting type.") }return a }; w.defineProperty(Ds, { kJ: "radius" }, function () { return this.Fs }, function (a) { this.Fs !== a && (w.j(a, "number", Ds, "radius"), 0 < a || isNaN(a)) && (this.Fs = a, this.J()) }); w.defineProperty(Ds, { mH: "aspectRatio" }, function () { return this.Mq }, function (a) { this.Mq !== a && (w.j(a, "number", Ds, "aspectRatio"), 0 < a && (this.Mq = a, this.J())) }); w.defineProperty(Ds, { ze: "startAngle" }, function () { return this.ft }, function (a) { this.ft !== a && (w.j(a, "number", Ds, "startAngle"), this.ft = a, this.J()) }); w.defineProperty(Ds, { of: "sweepAngle" }, function () { return this.ht }, function (a) { this.ht !== a && (w.j(a, "number", Ds, "sweepAngle"), this.ht = 0 < a && 360 >= a ? a : 360, this.J()) }); w.defineProperty(Ds, { Tf: "arrangement" }, function () { return this.md }, function (a) { this.md !== a && (w.mb(a, Ds, Ds, "arrangement"), a === Ss || a === Es || a === Rs || a === Qs) && (this.md = a, this.J()) }); w.defineProperty(Ds, { direction: "direction" }, function () { return this.aa }, function (a) { this.aa !== a && (w.mb(a, Ds, Ds, "direction"), a === Gs || a === Ps || a === Ns || a === Os) && (this.aa = a, this.J()) }); w.defineProperty(Ds, { sorting: "sorting" }, function () { return this.di }, function (a) { this.di !== a && (w.mb(a, Ds, Ds, "sorting"), a === Ls || a === Ms || a === Js || Ks || a === Hs) && (this.di = a, this.J()) }); w.defineProperty(Ds, { comparer: "comparer" }, function () { return this.Nh }, function (a) { this.Nh !== a && (w.j(a, "function", Ds, "comparer"), this.Nh = a, this.J()) }); w.defineProperty(Ds, { spacing: "spacing" }, function () { return this.ei }, function (a) { this.ei !== a && (w.j(a, "number", Ds, "spacing"), this.ei = a, this.J()) }); w.defineProperty(Ds, { Mx: "nodeDiameterFormula" }, function () { return this.ts }, function (a) { this.ts !== a && (w.mb(a, Ds, Ds, "nodeDiameterFormula"), a === Is || a === Ts) && (this.ts = a, this.J()) }); w.u(Ds, { cH: "actualXRadius" }, function () { return this.Zd }); w.u(Ds, { dH: "actualYRadius" }, function () { return this.Jg }); w.u(Ds, { bK: "actualSpacing" }, function () { return this.cl }); w.u(Ds, { bH: "actualCenter" }, function () { return isNaN(this.qe.x) || isNaN(this.qe.y) ? new z(0, 0) : new z(this.qe.x + this.cH, this.qe.y + this.dH) }); var Es; Ds.ConstantSpacing = Es = w.p(Ds, "ConstantSpacing", 0); var Rs; Ds.ConstantDistance = Rs = w.p(Ds, "ConstantDistance", 1); var Qs; Ds.ConstantAngle = Qs = w.p(Ds, "ConstantAngle", 2); var Ss; Ds.Packed = Ss = w.p(Ds, "Packed", 3); var Gs; Ds.Clockwise = Gs = w.p(Ds, "Clockwise", 4); var Ps; Ds.Counterclockwise = Ps = w.p(Ds, "Counterclockwise", 5); var Ns; Ds.BidirectionalLeft = Ns = w.p(Ds, "BidirectionalLeft", 6); var Os; Ds.BidirectionalRight = Os = w.p(Ds, "BidirectionalRight", 7); var Ls; Ds.Forwards = Ls = w.p(Ds, "Forwards", 8); var Ms; Ds.Reverse = Ms = w.p(Ds, "Reverse", 9); var Js; Ds.Ascending = Js = w.p(Ds, "Ascending", 10); var Ks; Ds.Descending = Ks = w.p(Ds, "Descending", 11); var Hs; Ds.Optimized = Hs = w.p(Ds, "Optimized", 12); var Is; Ds.Pythagorean = Is = w.p(Ds, "Pythagorean", 13); var Ts; Ds.Circular = Ts = w.p(Ds, "Circular", 14); function Fs() { this.Tp = -Infinity; this.Aq = this.fo = null } Fs.prototype.compare = function (a, b) { if (0 < a && 0 > this.Tp || Math.abs(a) < Math.abs(this.Tp) && !(0 > a && 0 < this.Tp)) { this.Tp = a; this.fo = []; this.Aq = []; for (var c = 0; c < b.length; c++)this.fo[c] = b[c].gb.x, this.Aq[c] = b[c].gb.y } }; Fs.prototype.commit = function (a) { if (null !== this.fo && null !== this.Aq) for (var b = 0; b < this.fo.length; b++) { var c = a.ea(b); c.x = this.fo[b]; c.y = this.Aq[b] } }; function Us() { tg.call(this) } w.Ka(Us, tg); w.ga("CircularNetwork", Us); Us.prototype.createVertex = function () { return new Vs }; Us.prototype.createEdge = function () { return new ht }; function Vs() { ns.call(this); this.actualAngle = this.diameter = NaN } w.Ka(Vs, ns); w.ga("CircularVertex", Vs); function Ws(a, b) { var c = a.network; if (null === c) return NaN; c = c.Tb; if (null === c) return NaN; if (c.Tf === Ss) if (c.Mx === Ts) a.diameter = Math.max(a.width, a.height); else { var c = Math.abs(Math.sin(b)), d = Math.abs(Math.cos(b)); if (0 === c) return a.width; if (0 === d) return a.height; a.diameter = Math.min(a.height / c, a.width / d) } else a.diameter = c.Mx === Ts ? Math.max(a.width, a.height) : Math.sqrt(a.width * a.width + a.height * a.height); return a.diameter } function ht() { os.call(this) } w.Ka(ht, os); w.ga("CircularEdge", ht); function it() { 0 < arguments.length && w.jd(it); sg.call(this); this.Ig = null; this.Tr = 0; this.mg = (new ia(100, 100)).freeze(); this.Lq = !1; this.ci = !0; this.Mh = !1; this.ap = 100; this.ur = 1; this.Sh = 1E3; this.Gs = Math; this.Ao = .05; this.zo = 50; this.xo = 150; this.yo = 0; this.ir = 10; this.hr = 5 } w.Ka(it, sg); w.ga("ForceDirectedLayout", it); it.prototype.cloneProtected = function (a) { sg.prototype.cloneProtected.call(this, a); a.mg.assign(this.mg); a.Lq = this.Lq; a.ci = this.ci; a.Mh = this.Mh; a.ap = this.ap; a.ur = this.ur; a.Sh = this.Sh; a.Gs = this.Gs; a.Ao = this.Ao; a.zo = this.zo; a.xo = this.xo; a.yo = this.yo; a.ir = this.ir; a.hr = this.hr }; it.prototype.createNetwork = function () { return new jt }; it.prototype.doLayout = function (a) { null === a && w.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts"); null === this.network && (this.network = this.makeNetwork(a)); a = this.LA; if (0 < this.network.vertexes.count) { this.network.gx(); for (var b = this.network.vertexes.i; b.next();) { var c = b.value; c.charge = this.electricalCharge(c); c.mass = this.gravitationalMass(c) } for (b = this.network.edges.i; b.next();)c = b.value, c.stiffness = this.springStiffness(c), c.length = this.springLength(c); this.Tz(); this.Tr = 0; if (this.needsClusterLayout()) { b = this.network; for (c = b.KJ().i; c.next();) { this.network = c.value; for (var d = this.network.vertexes.i; d.next();) { var e = d.value; e.hg = e.vertexes.count; e.Jk = 1; e.qn = null; e.Gh = null } kt(this, 0, a) } this.network = b; c.reset(); for (var d = this.pE, f = c.count, h = !0, k = e = 0, l = w.cb(), m = 0; m < f + b.vertexes.count + 2; m++)l[m] = null; f = 0; c.reset(); for (var n = w.If(); c.next();)if (m = c.value, this.uh(m, n), h) h = !1, e = n.x + n.width / 2, k = n.y + n.height / 2, l[0] = new z(n.x + n.width + d.width, n.y), l[1] = new z(n.x, n.y + n.height + d.height), f = 2; else { var p = ut(l, f, e, k, n.width, n.height, d), q = l[p], r = new z(q.x + n.width + d.width, q.y), s = new z(q.x, q.y + n.height + d.height); p + 1 < f && l.splice(p + 1, 0, null); l[p] = r; l[p + 1] = s; f++; p = q.x - n.x; q = q.y - n.y; for (m = m.vertexes.i; m.next();)r = m.value, r.ka += p, r.ra += q } w.Db(n); for (m = b.vertexes.i; m.next();)h = m.value, n = h.gb, 2 > f ? (e = n.x + n.width / 2, k = n.y + n.height / 2, l[0] = new z(n.x + n.width + d.width, n.y), l[1] = new z(n.x, n.y + n.height + d.height), f = 2) : (p = ut(l, f, e, k, n.width, n.height, d), q = l[p], r = new z(q.x + n.width + d.width, q.y), s = new z(q.x, q.y + n.height + d.height), p + 1 < f && l.splice(p + 1, 0, null), l[p] = r, l[p + 1] = s, f++ , h.ka = q.x + h.width / 2, h.ra = q.y + h.height / 2); w.ua(l); for (c.reset(); c.next();) { d = c.value; for (e = d.vertexes.i; e.next();)b.El(e.value); for (d = d.edges.i; d.next();)b.Cp(d.value) } } bu(this, a); this.updateParts() } this.ap = a; this.network = null; this.Cf = !0 }; it.prototype.needsClusterLayout = function () { if (3 > this.network.vertexes.count) return !1; for (var a = 0, b = 0, c = this.network.vertexes.first().gb, d = this.network.vertexes.i; d.next();) { if (d.value.gb.Wf(c) && (a++ , 2 < a)) return !0; if (10 < b) break; b++ } return !1 }; it.prototype.uh = function (a, b) { for (var c = !0, d = a.vertexes.i; d.next();) { var e = d.value; c ? (c = !1, b.set(e.gb)) : b.Kh(e.gb) } return b }; function kt(a, b, c) { if (cu(a, b)) { var d = a.Sh; a.Sh *= 1 + 1 / (b + 1); var e = du(a, b), f = Math.max(0, Math.max(Math.min(a.network.vertexes.count, c * (b + 1) / 11), 10)); a.LA += f; kt(a, b + 1, c); bu(a, f); eu(a, e); b = a.Ig; null === b ? b = new H(fu) : b.clear(); b.Jc(e.vertexes); b.sort(function (a, b) { return null === a || null === b || a === b ? 0 : b.hg - a.hg }); for (e = b.i; e.next();)gu(a, e.value); a.Sh = d } } function cu(a, b) { if (10 < b || 3 > a.network.vertexes.count) return !1; null === a.Ig ? a.Ig = new H(fu) : a.Ig.clear(); a.Ig.Jc(a.network.vertexes); var c = a.Ig; c.sort(function (a, b) { return null === a || null === b || a === b ? 0 : b.hg - a.hg }); for (var d = c.count - 1; 0 <= d && 1 >= c.ea(d).hg;)d--; return 1 < c.count - d } function du(a, b) { for (var c = a.network, d = new jt, e = a.Ig.i; e.next();) { var f = e.value; if (1 < f.hg) { d.El(f); var h = new hu; h.xy = f.hg; h.yy = f.width; h.wy = f.height; h.IB = f.T.x; h.JB = f.T.y; null === f.Gh && (f.Gh = new H(hu)); f.Gh.add(h); f.cB = f.Gh.count - 1 } else break } for (var k = c.edges.i; k.next();)if (h = k.value, e = h.fromVertex, f = h.toVertex, e.network === d && f.network === d) d.Cp(h); else if (e.network === d) { var l = e.qn; null === l && (l = new H(fu), e.qn = l); l.add(f); e.hg--; e.Jk += f.Jk } else f.network === d && (l = f.qn, null === l && (l = new H(fu), f.qn = l), l.add(e), f.hg-- , f.Jk += e.Jk); for (e = d.edges.i; e.next();)f = e.value, f.length *= Math.max(1, Vd((f.fromVertex.Jk + f.toVertex.Jk) / (4 * b + 1))); for (e = d.vertexes.i; e.next();)if (f = e.value, l = f.qn, null !== l && 0 < l.count && (h = f.Gh.ea(f.Gh.count - 1), h = h.xy - f.hg, !(0 >= h))) { for (var m = 0, n = 0, p = l.count - h; p < l.count; p++) { for (var q = l.ea(p), r = null, k = q.edges.i; k.next();) { var s = k.value; if (s.aI(q) === f) { r = s; break } } null !== r && (n += r.length, m += q.width * q.height) } k = f.ka; l = f.ra; p = f.width; q = f.height; r = f.T; s = p * q; 1 > s && (s = 1); m = Vd((m + s + n * n * 4 / (h * h)) / s); h = (m - 1) * p / 2; m = (m - 1) * q / 2; f.gb = new B(k - r.x - h, l - r.y - m, p + 2 * h, q + 2 * m); f.focus = new z(r.x + h, r.y + m) } a.network = d; return c } function eu(a, b) { for (var c = a.network.vertexes.i; c.next();) { var d = c.value; d.network = b; if (null !== d.Gh) { var e = d.Gh.ea(d.cB); d.hg = e.xy; var f = e.IB, h = e.JB; d.gb = new B(d.ka - f, d.ra - h, e.yy, e.wy); d.focus = new z(f, h); d.cB-- } } for (c = a.network.edges.i; c.next();)c.value.network = b; a.network = b } function gu(a, b) { var c = b.qn; if (null !== c && 0 !== c.count) { var d = b.ka, e = b.ra, f = b.width, h = b.height; null !== b.Gh && 0 < b.Gh.count && (h = b.Gh.ea(0), f = h.yy, h = h.wy); for (var f = Vd(f * f + h * h) / 2, k = !1, l = h = 0, m = 0, n = b.vertexes.i; n.next();) { var p = n.value; 1 >= p.hg ? l++ : (k = !0, m++ , h += Math.atan2(b.ra - p.ra, b.ka - p.ka)) } if (0 !== l) for (0 < m && (h /= m), n = m = 0, m = k ? 2 * Math.PI / (l + 1) : 2 * Math.PI / l, 0 === l % 2 && (n = m / 2), 1 < c.count && c.sort(function (a, b) { return null === a || null === b || a === b ? 0 : b.width * b.height - a.width * a.height }), k = 0 === l % 2 ? 0 : 1, c = c.i; c.next();)if (l = c.value, !(1 < l.hg || a.isFixed(l))) { for (var p = null, q = l.edges.i; q.next();) { p = q.value; break } var q = l.width, r = l.height, q = Vd(q * q + r * r) / 2, p = f + p.length + q, q = h + (m * (k / 2 >> 1) + n) * (0 === k % 2 ? 1 : -1); l.ka = d + p * Math.cos(q); l.ra = e + p * Math.sin(q); k++ } } } function ut(a, b, c, d, e, f, h) { var k = 9E19, l = -1, m = 0; a: for (; m < b; m++) { var n = a[m], p = n.x - c, q = n.y - d, p = p * p + q * q; if (p < k) { for (q = m - 1; 0 <= q; q--)if (a[q].y > n.y && a[q].x - n.x < e + h.width) continue a; for (q = m + 1; q < b; q++)if (a[q].x > n.x && a[q].y - n.y < f + h.height) continue a; l = m; k = p } } return l } it.prototype.Tz = function () { if (this.comments) for (var a = this.network.vertexes.i; a.next();)this.addComments(a.value) }; it.prototype.addComments = function (a) { var b = a.Pc; if (null !== b) for (b = b.NE(); b.next();) { var c = b.value; if ("Comment" === c.ud && c.isVisible()) { var d = this.network.zn(c); null === d && (d = this.network.xt(c)); d.charge = this.HH; for (var c = null, e = d.kc; e.next();) { var f = e.value; if (f.toVertex === a) { c = f; break } } if (null === c) for (e = d.mc; e.next();)if (f = e.value, f.fromVertex === a) { c = f; break } null === c && (c = this.network.eq(a, d, null)); c.length = this.IH } } }; function iu(a, b) { var c = a.M, d = c.x, e = c.y, f = c.width, c = c.height, h = b.M, k = h.x, l = h.y, m = h.width, h = h.height; return d + f < k ? e > l + h ? (d = d + f - k, e = e - l - h, Vd(d * d + e * e)) : e + c < l ? (d = d + f - k, e = e + c - l, Vd(d * d + e * e)) : k - (d + f) : d > k + m ? e > l + h ? (d = d - k - m, e = e - l - h, Vd(d * d + e * e)) : e + c < l ? (d = d - k - m, e = e + c - l, Vd(d * d + e * e)) : d - (k + m) : e > l + h ? e - (l + h) : e + c < l ? l - (e + c) : .1 } function bu(a, b) { a.Ig = null; for (var c = a.Tr + b; a.Tr < c && (a.Tr++ , ju(a));); a.Ig = null } function ju(a) { null === a.Ig && (a.Ig = new H(fu), a.Ig.Jc(a.network.vertexes)); var b = a.Ig.n; if (0 >= b.length) return !1; var c = b[0]; c.forceX = 0; c.forceY = 0; for (var d = c.ka, e = d, f = c.ra, h = f, c = 1; c < b.length; c++) { var k = b[c]; k.forceX = 0; k.forceY = 0; var l = k.ka, k = k.ra, d = Math.min(d, l), e = Math.max(e, l), f = Math.min(f, k), h = Math.max(h, k) } (f = e - d > h - f) ? b.sort(function (a, b) { return null === a || null === b || a === b ? 0 : a.ka - b.ka }) : b.sort(function (a, b) { return null === a || null === b || a === b ? 0 : a.ra - b.ra }); for (var h = a.Sh, m = 0, n = 0, p = 0, c = 0; c < b.length; c++) { var k = b[c], l = k.M, q = k.T, d = l.x + q.x, l = l.y + q.y, n = k.charge * a.electricalFieldX(d, l), p = k.charge * a.electricalFieldY(d, l), n = n + k.mass * a.gravitationalFieldX(d, l), p = p + k.mass * a.gravitationalFieldY(d, l); k.forceX += n; k.forceY += p; for (q = c + 1; q < b.length; q++)if (e = b[q], e !== k) { var r = e.M, n = e.T, p = r.x + n.x, r = r.y + n.y; if (d - p > h || p - d > h) { if (f) break } else if (l - r > h || r - l > h) { if (!f) break } else { var s = iu(k, e); 1 > s ? (n = a.Vx, null === n && (a.Vx = n = new ta(0)), m = n.random(), s = n.random(), d > p ? (n = Math.abs(e.M.right - k.M.x), n = (1 + n) * m) : d < p ? (n = Math.abs(e.M.x - k.M.right), n = -(1 + n) * m) : (n = Math.max(e.width, k.width), n = (1 + n) * m - n / 2), l > r ? (p = Math.abs(e.M.bottom - k.M.y), p = (1 + p) * s) : d < p ? (p = Math.abs(e.M.y - k.M.bottom), p = -(1 + p) * s) : (p = Math.max(e.height, k.height), p = (1 + p) * s - p / 2)) : (m = -(k.charge * e.charge) / (s * s), n = (p - d) / s * m, p = (r - l) / s * m); k.forceX += n; k.forceY += p; e.forceX -= n; e.forceY -= p } } } for (c = a.network.edges.i; c.next();)f = c.value, k = f.fromVertex, e = f.toVertex, l = k.M, q = k.T, d = l.x + q.x, l = l.y + q.y, r = e.M, n = e.T, p = r.x + n.x, r = r.y + n.y, s = iu(k, e), 1 > s ? (n = a.Vx, null === n && (a.Vx = n = new ta(0)), m = n.random(), s = n.random(), n = (d > p ? 1 : -1) * (1 + (e.width > k.width ? e.width : k.width)) * m, p = (l > r ? 1 : -1) * (1 + (e.height > k.height ? e.height : k.height)) * s) : (m = f.stiffness * (s - f.length), n = (p - d) / s * m, p = (r - l) / s * m), k.forceX += n, k.forceY += p, e.forceX -= n, e.forceY -= p; c = 0; d = Math.max(a.Sh / 20, 50); for (e = 0; e < b.length; e++)k = b[e], a.isFixed(k) ? a.moveFixedVertex(k) : (f = k.forceX, h = k.forceY, f < -d ? f = -d : f > d && (f = d), h < -d ? h = -d : h > d && (h = d), k.ka += f, k.ra += h, c = Math.max(c, f * f + h * h)); return c > a.KE * a.KE } it.prototype.moveFixedVertex = function () { }; it.prototype.commitLayout = function () { this.kB(); this.commitNodes(); this.iu && this.commitLinks() }; it.prototype.kB = function () { if (this.tq) for (var a = this.network.edges.i; a.next();) { var b = a.value.link; null !== b && (b.Ab = rc, b.Bb = rc) } }; it.prototype.commitNodes = function () { var a = 0, b = 0; if (this.lH) { var c = w.If(); this.uh(this.network, c); b = this.qe; a = b.x - c.x; b = b.y - c.y; w.Db(c) } for (var c = w.If(), d = this.network.vertexes.i; d.next();) { var e = d.value; if (0 !== a || 0 !== b) c.assign(e.gb), c.x += a, c.y += b, e.gb = c; e.commit() } w.Db(c) }; it.prototype.commitLinks = function () { for (var a = this.network.edges.i; a.next();)a.value.commit() }; it.prototype.springStiffness = function (a) { a = a.stiffness; return isNaN(a) ? this.Ao : a }; it.prototype.springLength = function (a) { a = a.length; return isNaN(a) ? this.zo : a }; it.prototype.electricalCharge = function (a) { a = a.charge; return isNaN(a) ? this.xo : a }; it.prototype.electricalFieldX = function () { return 0 }; it.prototype.electricalFieldY = function () { return 0 }; it.prototype.gravitationalMass = function (a) { a = a.mass; return isNaN(a) ? this.yo : a }; it.prototype.gravitationalFieldX = function () { return 0 }; it.prototype.gravitationalFieldY = function () { return 0 }; it.prototype.isFixed = function (a) { return a.isFixed }; w.u(it, { GK: "currentIteration" }, function () { return this.Tr }); w.defineProperty(it, { pE: "arrangementSpacing" }, function () { return this.mg }, function (a) { w.G(a, ia, it, "arrangementSpacing"); this.mg.L(a) || (this.mg.assign(a), this.J()) }); w.defineProperty(it, { lH: "arrangesToOrigin" }, function () { return this.Lq }, function (a) { this.Lq !== a && (w.j(a, "boolean", it, "arrangesToOrigin"), this.Lq = a, this.J()) }); w.defineProperty(it, { tq: "setsPortSpots" }, function () { return this.ci }, function (a) { this.ci !== a && (w.j(a, "boolean", it, "setsPortSpots"), this.ci = a, this.J()) }); w.defineProperty(it, { comments: "comments" }, function () { return this.Mh }, function (a) { this.Mh !== a && (w.j(a, "boolean", it, "comments"), this.Mh = a, this.J()) }); w.defineProperty(it, { LA: "maxIterations" }, function () { return this.ap }, function (a) { this.ap !== a && (w.j(a, "number", it, "maxIterations"), 0 <= a && (this.ap = a, this.J())) }); w.defineProperty(it, { KE: "epsilonDistance" }, function () { return this.ur }, function (a) { this.ur !== a && (w.j(a, "number", it, "epsilonDistance"), 0 < a && (this.ur = a, this.J())) }); w.defineProperty(it, { $K: "infinityDistance" }, function () { return this.Sh }, function (a) { this.Sh !== a && (w.j(a, "number", it, "infinityDistance"), 1 < a && (this.Sh = a, this.J())) }); w.defineProperty(it, { Vx: "randomNumberGenerator" }, function () { return this.Gs }, function (a) { this.Gs !== a && (null !== a && "function" !== typeof a.random && w.k('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: ' + a), this.Gs = a) }); w.defineProperty(it, { SK: "defaultSpringStiffness" }, function () { return this.Ao }, function (a) { this.Ao !== a && (w.j(a, "number", it, "defaultSpringStiffness"), this.Ao = a, this.J()) }); w.defineProperty(it, { RK: "defaultSpringLength" }, function () { return this.zo }, function (a) { this.zo !== a && (w.j(a, "number", it, "defaultSpringLength"), this.zo = a, this.J()) }); w.defineProperty(it, { LK: "defaultElectricalCharge" }, function () { return this.xo }, function (a) { this.xo !== a && (w.j(a, "number", it, "defaultElectricalCharge"), this.xo = a, this.J()) }); w.defineProperty(it, { MK: "defaultGravitationalMass" }, function () { return this.yo }, function (a) { this.yo !== a && (w.j(a, "number", it, "defaultGravitationalMass"), this.yo = a, this.J()) }); w.defineProperty(it, { IH: "defaultCommentSpringLength" }, function () { return this.ir }, function (a) { this.ir !== a && (w.j(a, "number", it, "defaultCommentSpringLength"), this.ir = a, this.J()) }); w.defineProperty(it, { HH: "defaultCommentElectricalCharge" }, function () { return this.hr }, function (a) { this.hr !== a && (w.j(a, "number", it, "defaultCommentElectricalCharge"), this.hr = a, this.J()) }); function hu() { this.JB = this.IB = this.wy = this.yy = this.xy = 0 } function jt() { tg.call(this) } w.Ka(jt, tg); w.ga("ForceDirectedNetwork", jt); jt.prototype.createVertex = function () { return new fu }; jt.prototype.createEdge = function () { return new ku }; function fu() { ns.call(this); this.isFixed = !1; this.mass = this.charge = NaN; this.Jk = this.hg = this.forceY = this.forceX = 0; this.Gh = this.qn = null; this.cB = 0 } w.Ka(fu, ns); w.ga("ForceDirectedVertex", fu); function ku() { os.call(this); this.length = this.stiffness = NaN } w.Ka(ku, os); w.ga("ForceDirectedEdge", ku); function lu() { 0 < arguments.length && w.jd(lu); sg.call(this); this.Xd = this.Im = 25; this.aa = 0; this.wo = mu; this.Xo = nu; this.Mo = ou; this.Gm = 4; this.ko = pu; this.Zi = qu; this.ci = !0; this.Yr = 4; this.Jb = this.Yv = this.qb = -1; this.Qf = this.gs = 0; this.Nb = this.Of = this.Pf = this.yg = this.je = null; this.ps = 0; this.os = this.Nm = null; this.Cg = 0; this.qs = null; this.VB = new z; this.jh = []; this.jh.length = 100 } w.Ka(lu, sg); w.ga("LayeredDigraphLayout", lu); lu.prototype.cloneProtected = function (a) { sg.prototype.cloneProtected.call(this, a); a.Im = this.Im; a.Xd = this.Xd; a.aa = this.aa; a.wo = this.wo; a.Xo = this.Xo; a.Mo = this.Mo; a.Gm = this.Gm; a.ko = this.ko; a.Zi = this.Zi; a.ci = this.ci; a.Yr = this.Yr }; lu.prototype.ic = function (a) { a.Ee === lu ? 0 === a.name.indexOf("Aggressive") ? this.jH = a : 0 === a.name.indexOf("Cycle") ? this.GH = a : 0 === a.name.indexOf("Init") ? this.sI = a : 0 === a.name.indexOf("Layer") ? this.HI = a : w.k("Unknown enum value: " + a) : sg.prototype.ic.call(this, a) }; lu.prototype.createNetwork = function () { return new ru }; lu.prototype.doLayout = function (a) { null === a && w.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts"); null === this.network && (this.network = this.makeNetwork(a)); this.qe = this.initialOrigin(this.qe); this.Yv = -1; this.Qf = this.gs = 0; this.qs = this.os = this.Nm = null; for (a = 0; a < this.jh.length; a++)this.jh[a] = null; if (0 < this.network.vertexes.count) { this.network.gx(); for (a = this.network.edges.i; a.next();)a.value.rev = !1; switch (this.wo) { default: case su: a = this.network; var b = 0, c = a.vertexes.count - 1, d = []; d.length = c + 1; for (var e = a.vertexes.i; e.next();)e.value.valid = !0; for (; null !== tu(a);) { for (e = uu(a); null !== e;)d[c] = e, c-- , e.valid = !1, e = uu(a); for (e = vu(a); null !== e;)d[b] = e, b++ , e.valid = !1, e = vu(a); for (var e = null, f = 0, h = this.network.vertexes.i; h.next();) { var k = h.value; if (k.valid) { for (var l = 0, m = k.kc; m.next();)m.value.toVertex.valid && l++; for (var m = 0, n = k.mc; n.next();)n.value.fromVertex.valid && m++; if (null === e || f < l - m) e = k, f = l - m } } null !== e && (d[b] = e, b++ , e.valid = !1) } for (b = 0; b < a.vertexes.count; b++)d[b].index = b; for (d = a.edges.i; d.next();)b = d.value, b.fromVertex.index > b.toVertex.index && (a.by(b), b.rev = !0); break; case mu: for (d = this.network.vertexes.i; d.next();)a = d.value, a.Op = -1, a.finish = -1; for (a = this.network.edges.i; a.next();)a.value.forest = !1; this.ps = 0; for (d.reset(); d.next();)b = d.value, 0 === b.mc.count && wu(this, b); for (d.reset(); d.next();)b = d.value, -1 === b.Op && wu(this, b); for (a.reset(); a.next();)d = a.value, d.forest || (b = d.fromVertex, c = b.finish, e = d.toVertex, f = e.finish, e.Op < b.Op && c < f && (this.network.by(d), d.rev = !0)) }for (a = this.network.vertexes.i; a.next();)a.value.layer = -1; this.qb = -1; this.assignLayers(); for (a.reset(); a.next();)this.qb = Math.max(this.qb, a.value.layer); a = this.network; d = []; for (c = a.edges.i; c.next();)b = c.value, b.valid = !1, d.push(b); for (c = 0; c < d.length; c++)if (b = d[c], f = b.fromVertex, e = b.toVertex, !b.valid && (null !== f.sd && null !== e.sd || f.layer !== e.layer)) { m = k = l = h = 0; if (null !== b.link) { l = b.link; if (null === l) continue; var p = f.sd, h = e.sd; if (null === p || null === h) continue; var q = l.V, k = l.Z, r = l.Lc, m = l.kd; b.rev && (l = q, n = r, q = k, r = m, k = l, m = n); var s = f.T, l = e.T, u = b.rev ? e.M : f.M, n = w.K(); u.I() ? (cr(q, r, Hb, n), n.I() || n.assign(s)) : n.assign(s); p !== q && u.I() && q.isVisible() && (p = f.M, p.I() && (n.x += u.x - p.x, n.y += u.y - p.y)); q = b.rev ? f.M : e.M; p = w.K(); q.I() ? (cr(k, m, Hb, p), p.I() || p.assign(l)) : p.assign(l); h !== k && q.I() && k.isVisible() && (h = e.M, h.I() && (p.x += q.x - h.x, p.y += q.y - h.y)); 90 === this.aa || 270 === this.aa ? (h = Math.round((n.x - s.x) / this.Xd), k = n.x, l = Math.round((p.x - l.x) / this.Xd), m = p.x) : (h = Math.round((n.y - s.y) / this.Xd), k = n.y, l = Math.round((p.y - l.y) / this.Xd), m = p.y); w.v(n); w.v(p); b.portFromColOffset = h; b.portFromPos = k; b.portToColOffset = l; b.portToPos = m } else b.portFromColOffset = 0, b.portFromPos = 0, b.portToColOffset = 0, b.portToPos = 0; n = f.layer; s = e.layer; a: if (p = b, q = 0, u = p.link, null !== u) { var t = u.Lc, x = u.kd; if (null !== t && null !== x) { var v = u.V, r = u.Z; if (null !== v && null !== r) { var A = t.Ab, y = x.Bb; this.tq || (u.Ab.Wc() || (A = u.Ab), u.Bb.Wc() || (y = u.Bb)); var K = u.ac, E = xu(this, !0); if (A.Wc() || A === tb) A = E; var Q = xu(this, !1); if (y.Wc() || y === tb) y = Q; if (A.uj() && A.sj(Q) && y.uj() && y.sj(E)) { q = 0; break a } E = u.getLinkPoint(v, t, A, !0, K, r, x, w.K()); A = u.getLinkDirection(v, t, E, A, !0, K, r, x); w.v(E); A === yu(this, p, !0) ? q += 1 : this.tq && null !== v && 1 === v.ports.count && p.rev && (q += 1); A = u.getLinkPoint(r, x, y, !1, K, v, t, w.K()); u = u.getLinkDirection(r, x, A, y, !1, K, v, t); w.v(A); u === yu(this, p, !1) ? q += 2 : this.tq && null !== r && 1 === r.ports.count && p.rev && (q += 2) } } } p = 1 === q || 3 === q ? !0 : !1; if (q = 2 === q || 3 === q ? !0 : !1) r = a.createVertex(), r.sd = null, r.ln = 1, r.layer = n, r.near = f, a.El(r), f = a.eq(f, r, b.link), f.valid = !1, f.rev = b.rev, f.portFromColOffset = h, f.portToColOffset = 0, f.portFromPos = k, f.portToPos = 0, f = r; u = 1; p && u--; if (n - s > u && 0 < n) { b.valid = !1; r = a.createVertex(); r.sd = null; r.ln = 2; r.layer = n - 1; a.El(r); f = a.eq(f, r, b.link); f.valid = !0; f.rev = b.rev; f.portFromColOffset = q ? 0 : h; f.portToColOffset = 0; f.portFromPos = q ? 0 : k; f.portToPos = 0; f = r; for (n--; n - s > u && 0 < n;)r = a.createVertex(), r.sd = null, r.ln = 3, r.layer = n - 1, a.El(r), f = a.eq(f, r, b.link), f.valid = !0, f.rev = b.rev, f.portFromColOffset = 0, f.portToColOffset = 0, f.portFromPos = 0, f.portToPos = 0, f = r, n--; f = a.eq(r, e, b.link); f.valid = !p; p && (r.near = e); f.rev = b.rev; f.portFromColOffset = 0; f.portToColOffset = l; f.portFromPos = 0; f.portToPos = m } else b.valid = !0 } d = this.je = []; for (b = 0; b <= this.qb; b++)d[b] = 0; for (a = this.network.vertexes.i; a.next();)a.value.index = -1; this.initializeIndices(); this.Yv = -1; for (b = this.Qf = this.gs = 0; b <= this.qb; b++)d[b] > d[this.Qf] && (this.Yv = d[b] - 1, this.Qf = b), d[b] < d[this.gs] && (this.gs = b); this.qs = []; for (b = 0; b < d.length; b++)this.qs[b] = []; for (a.reset(); a.next();)d = a.value, this.qs[d.layer][d.index] = d; this.Jb = -1; for (a = 0; a <= this.qb; a++) { d = zu(this, a); b = 0; c = this.je[a]; for (e = 0; e < c; e++)f = d[e], b += this.nodeMinColumnSpace(f, !0), f.column = b, b += 1, b += this.nodeMinColumnSpace(f, !1); this.Jb = Math.max(this.Jb, b - 1); Au(this, a, d) } this.reduceCrossings(); this.straightenAndPack(); this.updateParts() } this.network = null; this.Cf = !0 }; lu.prototype.linkMinLength = function () { return 1 }; function Bu(a) { var b = a.fromVertex.sd; a = a.toVertex.sd; return null === b && null === a ? 8 : null === b || null === a ? 4 : 1 } lu.prototype.nodeMinLayerSpace = function (a, b) { return null === a.sd ? 0 : 90 === this.aa || 270 === this.aa ? b ? a.T.y + 10 : a.M.height - a.T.y + 10 : b ? a.T.x + 10 : a.M.width - a.T.x + 10 }; lu.prototype.nodeMinColumnSpace = function (a, b) { if (null === a.sd) return 0; var c = b ? a.SA : a.RA; if (null !== c) return c; c = this.aa; return 90 === c || 270 === c ? b ? a.SA = a.T.x / this.Xd + 1 | 0 : a.RA = (a.M.width - a.T.x) / this.Xd + 1 | 0 : b ? a.SA = a.T.y / this.Xd + 1 | 0 : a.RA = (a.M.height - a.T.y) / this.Xd + 1 | 0 }; function Cu(a) { null === a.Nm && (a.Nm = []); for (var b = 0, c = a.network.vertexes.i; c.next();) { var d = c.value; a.Nm[b] = d.layer; b++; a.Nm[b] = d.column; b++; a.Nm[b] = d.index; b++ } return a.Nm } function Du(a, b) { for (var c = 0, d = a.network.vertexes.i; d.next();) { var e = d.value; e.layer = b[c]; c++; e.column = b[c]; c++; e.index = b[c]; c++ } } function Eu(a, b, c) { var d = zu(a, b), e = a.je[b]; if (null === a.os || a.os.length < e * e) a.os = []; for (var f = a.os, h = 0; h < e; h++) { var k = 0, l = d[h], m = l.near, n = 0; if (null !== m && m.layer === l.layer) if (n = m.index, n > h) for (var p = h + 1; p < n; p++)l = d[p], l.near === m && l.ln === m.ln || k++; else for (p = h - 1; p > n; p--)l = d[p], l.near === m && l.ln === m.ln || k++; var m = 0, q, r = q = p = l = 0, s, u = 0, t = 0; s = 0; var x; if (0 <= c) for (n = d[h].Pe, m = 0; m < n.count; m++)if (q = n.n[m], q.valid && q.fromVertex.layer !== b) for (l = q.fromVertex.index, p = q.portToPos, q = q.portFromPos, r = m + 1; r < n.count; r++)s = n.n[r], s.valid && s.fromVertex.layer !== b && (u = s.fromVertex.index, t = s.portToPos, s = s.portFromPos, p < t && (l > u || l === u && q > s) && k++ , t < p && (u > l || u === l && s > q) && k++); if (0 >= c) for (n = d[h].Ie, m = 0; m < n.count; m++)if (q = n.n[m], q.valid && q.toVertex.layer !== b) for (l = q.toVertex.index, p = q.portToPos, q = q.portFromPos, r = m + 1; r < n.count; r++)s = n.n[r], s.valid && s.toVertex.layer !== b && (u = s.toVertex.index, t = s.portToPos, s = s.portFromPos, q < s && (l > u || l === u && p > t) && k++ , s < q && (u > l || u === l && t > p) && k++); f[h * e + h] = k; for (n = h + 1; n < e; n++) { var v = 0, A = 0; if (0 <= c) for (k = d[h].Pe, x = d[n].Pe, m = 0; m < k.count; m++)if (q = k.n[m], q.valid && q.fromVertex.layer !== b) for (l = q.fromVertex.index, q = q.portFromPos, r = 0; r < x.count; r++)s = x.n[r], s.valid && s.fromVertex.layer !== b && (u = s.fromVertex.index, s = s.portFromPos, (l < u || l === u && q < s) && A++ , (u < l || u === l && s < q) && v++); if (0 >= c) for (k = d[h].Ie, x = d[n].Ie, m = 0; m < k.count; m++)if (q = k.n[m], q.valid && q.toVertex.layer !== b) for (l = q.toVertex.index, p = q.portToPos, r = 0; r < x.count; r++)s = x.n[r], s.valid && s.toVertex.layer !== b && (u = s.toVertex.index, t = s.portToPos, (l < u || l === u && p < t) && A++ , (u < l || u === l && t < p) && v++); f[h * e + n] = v; f[n * e + h] = A } } Au(a, b, d); return f } lu.prototype.countCrossings = function () { for (var a = 0, b = 0; b <= this.qb; b++)for (var c = Eu(this, b, 1), d = this.je[b], e = 0; e < d; e++)for (var f = e; f < d; f++)a += c[e * d + f]; return a }; function Fu(a) { for (var b = 0, c = 0; c <= a.qb; c++) { for (var d = a, e = c, f = zu(d, e), h = d.je[e], k = 0, l = 0; l < h; l++) { var m = null, m = f[l].Ie, n, p = 0, q = 0; if (null !== m) for (var r = 0; r < m.count; r++)n = m.n[r], n.valid && n.toVertex.layer !== e && (p = n.fromVertex.column + n.portFromColOffset, q = n.toVertex.column + n.portToColOffset, k += (Math.abs(p - q) + 1) * Bu(n)) } Au(d, e, f); b += k } return b } lu.prototype.normalize = function () { var a = Infinity; this.Jb = -1; for (var b = this.network.vertexes.i; b.next();) { var c = b.value, a = Math.min(a, c.column - this.nodeMinColumnSpace(c, !0)); this.Jb = Math.max(this.Jb, c.column + this.nodeMinColumnSpace(c, !1)) } for (b.reset(); b.next();)b.value.column -= a; this.Jb -= a }; function Gu(a, b, c) { for (var d = zu(a, b), e = a.je[b], f = [], h = 0; h < e; h++) { var k = d[h], l = null; 0 >= c && (l = k.Pe); var m = null; 0 <= c && (m = k.Ie); var n = 0, p = 0, q = k.near; null !== q && q.layer === k.layer && (n += q.column - 1, p++); if (null !== l) for (q = 0; q < l.count; q++) { var k = l.n[q], r = k.fromVertex; k.valid && !k.rev && r.layer !== b && (n += r.column, p++) } if (null !== m) for (l = 0; l < m.count; l++)k = m.n[l], q = k.toVertex, k.valid && !k.rev && q.layer !== b && (n += q.column, p++); f[h] = 0 === p ? -1 : n / p } Au(a, b, d); return f } function Hu(a, b, c) { for (var d = zu(a, b), e = a.je[b], f = [], h = 0; h < e; h++) { var k = d[h], l = null; 0 >= c && (l = k.Pe); var m = null; 0 <= c && (m = k.Ie); var n = 0, p = [], q = k.near; null !== q && q.layer === k.layer && (p[n] = q.column - 1, n++); if (null !== l) for (q = 0; q < l.count; q++) { var k = l.n[q], r = k.fromVertex; k.valid && !k.rev && r.layer !== b && (p[n] = r.column + k.portFromColOffset, n++) } if (null !== m) for (l = 0; l < m.count; l++)k = m.n[l], q = k.toVertex, k.valid && !k.rev && q.layer !== b && (p[n] = q.column + k.portToColOffset, n++); 0 === n ? f[h] = -1 : (p.sort(function (a, b) { return a - b }), m = n >> 1, f[h] = 0 !== (n & 1) ? p[m] : p[m - 1] + p[m] >> 1) } Au(a, b, d); return f } function Iu(a, b, c, d, e, f) { if (b.component === d) { b.component = c; var h = 0, k = 0; if (e) for (var l = b.kc; l.next();) { var k = l.value, m = k.toVertex, h = b.layer - m.layer, k = a.linkMinLength(k); h === k && Iu(a, m, c, d, e, f) } if (f) for (l = b.mc; l.next();)k = l.value, m = k.fromVertex, h = m.layer - b.layer, k = a.linkMinLength(k), h === k && Iu(a, m, c, d, e, f) } } function Ju(a, b, c, d, e, f) { if (b.component === d) { b.component = c; if (e) for (var h = b.kc; h.next();)Ju(a, h.value.toVertex, c, d, e, f); if (f) for (b = b.mc; b.next();)Ju(a, b.value.fromVertex, c, d, e, f) } } function tu(a) { for (a = a.vertexes.i; a.next();) { var b = a.value; if (b.valid) return b } return null } function uu(a) { for (a = a.vertexes.i; a.next();) { var b = a.value; if (b.valid) { for (var c = !0, d = b.kc; d.next();)if (d.value.toVertex.valid) { c = !1; break } if (c) return b } } return null } function vu(a) { for (a = a.vertexes.i; a.next();) { var b = a.value; if (b.valid) { for (var c = !0, d = b.mc; d.next();)if (d.value.fromVertex.valid) { c = !1; break } if (c) return b } } return null } function wu(a, b) { b.Op = a.ps; a.ps++; for (var c = b.kc; c.next();) { var d = c.value, e = d.toVertex; -1 === e.Op && (d.forest = !0, wu(a, e)) } b.finish = a.ps; a.ps++ } lu.prototype.assignLayers = function () { switch (this.Xo) { case Ku: Lu(this); break; case Mu: for (var a = 0, b = this.network.vertexes.i; b.next();)a = Nu(this, b.value), this.qb = Math.max(a, this.qb); for (b.reset(); b.next();)a = b.value, a.layer = this.qb - a.layer; break; default: case nu: Lu(this); for (b = this.network.vertexes.i; b.next();)b.value.valid = !1; for (b.reset(); b.next();)a = b.value, 0 === a.mc.count && Ou(this, a); a = Infinity; for (b.reset(); b.next();)a = Math.min(a, b.value.layer); this.qb = -1; for (b.reset(); b.next();) { var c = b.value; c.layer -= a; this.qb = Math.max(this.qb, c.layer) } } }; function Lu(a) { for (var b = a.network.vertexes.i; b.next();) { var c = Pu(a, b.value); a.qb = Math.max(c, a.qb) } } function Pu(a, b) { var c = 0; if (-1 === b.layer) { for (var d = b.kc; d.next();)var e = d.value, f = e.toVertex, e = a.linkMinLength(e), c = Math.max(c, Pu(a, f) + e); b.layer = c } else c = b.layer; return c } function Nu(a, b) { var c = 0; if (-1 === b.layer) { for (var d = b.mc; d.next();)var e = d.value, f = e.fromVertex, e = a.linkMinLength(e), c = Math.max(c, Nu(a, f) + e); b.layer = c } else c = b.layer; return c } function Ou(a, b) { if (!b.valid) { b.valid = !0; for (var c = b.kc; c.next();)Ou(a, c.value.toVertex); for (c = a.network.vertexes.i; c.next();)c.value.component = -1; for (var d = b.Pe.n, e = d.length, f = 0; f < e; f++) { var h = d[f], k = h.fromVertex, l = h.toVertex, h = a.linkMinLength(h); k.layer - l.layer > h && Iu(a, k, 0, -1, !0, !1) } for (Iu(a, b, 1, -1, !0, !0); 0 !== b.component;) { for (var k = 0, d = Infinity, l = 0, m = null, n = a.network.vertexes.i; n.next();) { var p = n.value; if (1 === p.component) { for (var q = 0, r = !1, s = p.Pe.n, e = s.length, f = 0; f < e; f++) { var h = s[f], u = h.fromVertex, q = q + 1; 1 !== u.component && (k += 1, u = u.layer - p.layer, h = a.linkMinLength(h), d = Math.min(d, u - h)) } h = p.Ie.n; e = h.length; for (f = 0; f < e; f++)s = h[f].toVertex, q -= 1, 1 !== s.component ? k -= 1 : r = !0; (null === m || q < l) && !r && (m = p, l = q) } } if (0 < k) { for (c.reset(); c.next();)e = c.value, 1 === e.component && (e.layer += d); b.component = 0 } else m.component = 0 } for (c = a.network.vertexes.i; c.next();)c.value.component = -1; for (Iu(a, b, 1, -1, !0, !1); 0 !== b.component;) { f = 0; e = Infinity; d = 0; h = null; for (k = a.network.vertexes.i; k.next();)if (l = k.value, 1 === l.component) { m = 0; n = !1; r = l.Pe.n; p = r.length; for (q = 0; q < p; q++)s = r[q].fromVertex, m += 1, 1 !== s.component ? f += 1 : n = !0; r = l.Ie.n; p = r.length; for (q = 0; q < p; q++)s = r[q], u = s.toVertex, m -= 1, 1 !== u.component && (f -= 1, u = l.layer - u.layer, s = a.linkMinLength(s), e = Math.min(e, u - s)); (null === h || m > d) && !n && (h = l, d = m) } if (0 > f) { for (c.reset(); c.next();)f = c.value, 1 === f.component && (f.layer -= e); b.component = 0 } else h.component = 0 } } } function yu(a, b, c) { return 90 === a.aa ? c && !b.rev || !c && b.rev ? 270 : 90 : 180 === a.aa ? c && !b.rev || !c && b.rev ? 0 : 180 : 270 === a.aa ? c && !b.rev || !c && b.rev ? 90 : 270 : c && !b.rev || !c && b.rev ? 180 : 0 } lu.prototype.initializeIndices = function () { switch (this.Mo) { default: case Qu: for (var a = this.network.vertexes.i; a.next();) { var b = a.value, c = b.layer; b.index = this.je[c]; this.je[c]++ } break; case ou: a = this.network.vertexes.i; for (b = this.qb; 0 <= b; b--)for (a.reset(); a.next();)c = a.value, c.layer === b && -1 === c.index && Ru(this, c); break; case Su: for (a = this.network.vertexes.i, b = 0; b <= this.qb; b++)for (a.reset(); a.next();)c = a.value, c.layer === b && -1 === c.index && Tu(this, c) } }; function Ru(a, b) { var c = b.layer; b.index = a.je[c]; a.je[c]++; for (var c = b.Ie.gc(), d = !0; d;)for (var d = !1, e = 0; e < c.length - 1; e++) { var f = c[e], h = c[e + 1]; f.portFromColOffset > h.portFromColOffset && (d = !0, c[e] = h, c[e + 1] = f) } for (e = 0; e < c.length; e++)d = c[e], d.valid && (d = d.toVertex, -1 === d.index && Ru(a, d)) } function Tu(a, b) { var c = b.layer; b.index = a.je[c]; a.je[c]++; for (var c = b.Pe.gc(), d = !0, e = 0; d;)for (d = !1, e = 0; e < c.length - 1; e++) { var f = c[e], h = c[e + 1]; f.portToColOffset > h.portToColOffset && (d = !0, c[e] = h, c[e + 1] = f) } for (e = 0; e < c.length; e++)d = c[e], d.valid && (d = d.fromVertex, -1 === d.index && Tu(a, d)) } lu.prototype.reduceCrossings = function () { for (var a = this.countCrossings(), b = Cu(this), c = 0, d = 0, e = 0, c = 0; c < this.Gm; c++) { for (d = 0; d <= this.qb; d++)Uu(this, d, 1), Vu(this, d, 1); e = this.countCrossings(); e < a && (a = e, b = Cu(this)); for (d = this.qb; 0 <= d; d--)Uu(this, d, -1), Vu(this, d, -1); e = this.countCrossings(); e < a && (a = e, b = Cu(this)) } Du(this, b); for (c = 0; c < this.Gm; c++) { for (d = 0; d <= this.qb; d++)Uu(this, d, 0), Vu(this, d, 0); e = this.countCrossings(); e < a && (a = e, b = Cu(this)); for (d = this.qb; 0 <= d; d--)Uu(this, d, 0), Vu(this, d, 0); e = this.countCrossings(); e < a && (a = e, b = Cu(this)) } Du(this, b); var f = !1, h = c = 0, k = 0, d = 0; switch (this.ko) { case Wu: break; case Xu: for (k = a + 1; (d = this.countCrossings()) < k;)for (k = d, c = this.qb; 0 <= c; c--)for (h = 0; h <= c; h++) { for (f = !0; f;)for (f = !1, d = c; d >= h; d--)f = Vu(this, d, -1) || f; e = this.countCrossings(); e >= a ? Du(this, b) : (a = e, b = Cu(this)); for (f = !0; f;)for (f = !1, d = c; d >= h; d--)f = Vu(this, d, 1) || f; e = this.countCrossings(); e >= a ? Du(this, b) : (a = e, b = Cu(this)); for (f = !0; f;)for (f = !1, d = h; d <= c; d++)f = Vu(this, d, 1) || f; e >= a ? Du(this, b) : (a = e, b = Cu(this)); for (f = !0; f;)for (f = !1, d = h; d <= c; d++)f = Vu(this, d, -1) || f; e >= a ? Du(this, b) : (a = e, b = Cu(this)); for (f = !0; f;)for (f = !1, d = c; d >= h; d--)f = Vu(this, d, 0) || f; e >= a ? Du(this, b) : (a = e, b = Cu(this)); for (f = !0; f;)for (f = !1, d = h; d <= c; d++)f = Vu(this, d, 0) || f; e >= a ? Du(this, b) : (a = e, b = Cu(this)) } break; default: case pu: for (c = this.qb, h = 0, k = a + 1; (d = this.countCrossings()) < k;) { k = d; for (f = !0; f;)for (f = !1, d = c; d >= h; d--)f = Vu(this, d, -1) || f; e = this.countCrossings(); e >= a ? Du(this, b) : (a = e, b = Cu(this)); for (f = !0; f;)for (f = !1, d = c; d >= h; d--)f = Vu(this, d, 1) || f; e = this.countCrossings(); e >= a ? Du(this, b) : (a = e, b = Cu(this)); for (f = !0; f;)for (f = !1, d = h; d <= c; d++)f = Vu(this, d, 1) || f; e >= a ? Du(this, b) : (a = e, b = Cu(this)); for (f = !0; f;)for (f = !1, d = h; d <= c; d++)f = Vu(this, d, -1) || f; e >= a ? Du(this, b) : (a = e, b = Cu(this)); for (f = !0; f;)for (f = !1, d = c; d >= h; d--)f = Vu(this, d, 0) || f; e >= a ? Du(this, b) : (a = e, b = Cu(this)); for (f = !0; f;)for (f = !1, d = h; d <= c; d++)f = Vu(this, d, 0) || f; e >= a ? Du(this, b) : (a = e, b = Cu(this)) } }Du(this, b) }; function Uu(a, b, c) { var d = 0, e = zu(a, b), f = a.je[b], h = Hu(a, b, c); c = Gu(a, b, c); for (d = 0; d < f; d++)-1 === c[d] && (c[d] = e[d].column), -1 === h[d] && (h[d] = e[d].column); for (var k = !0, l; k;)for (k = !1, d = 0; d < f - 1; d++)if (h[d + 1] < h[d] || h[d + 1] === h[d] && c[d + 1] < c[d]) k = !0, l = h[d], h[d] = h[d + 1], h[d + 1] = l, l = c[d], c[d] = c[d + 1], c[d + 1] = l, l = e[d], e[d] = e[d + 1], e[d + 1] = l; for (d = h = 0; d < f; d++)l = e[d], l.index = d, h += a.nodeMinColumnSpace(l, !0), l.column = h, h += 1, h += a.nodeMinColumnSpace(l, !1); Au(a, b, e) } function Vu(a, b, c) { var d = zu(a, b), e = a.je[b]; c = Eu(a, b, c); var f = 0, h; h = []; for (f = 0; f < e; f++)h[f] = -1; var k; k = []; for (f = 0; f < e; f++)k[f] = -1; for (var l = !1, m = !0; m;)for (m = !1, f = 0; f < e - 1; f++) { var n = c[d[f].index * e + d[f + 1].index], p = c[d[f + 1].index * e + d[f].index], q = 0, r = 0, s = d[f].column, u = d[f + 1].column, t = a.nodeMinColumnSpace(d[f], !0), x = a.nodeMinColumnSpace(d[f], !1), v = a.nodeMinColumnSpace(d[f + 1], !0), A = a.nodeMinColumnSpace(d[f + 1], !1), t = s - t + v, x = u - x + A, v = v = 0, y = d[f].mc.i; for (y.reset(); y.next();)if (v = y.value, A = v.fromVertex, v.valid && A.layer === b) { for (v = 0; d[v] !== A;)v++; v < f && (q += 2 * (f - v), r += 2 * (f + 1 - v)); v === f + 1 && (q += 1); v > f + 1 && (q += 4 * (v - f), r += 4 * (v - (f + 1))) } y = d[f].kc.i; for (y.reset(); y.next();)if (v = y.value, A = v.toVertex, v.valid && A.layer === b) { for (v = 0; d[v] !== A;)v++; v === f + 1 && (r += 1) } y = d[f + 1].mc.i; for (y.reset(); y.next();)if (v = y.value, A = v.fromVertex, v.valid && A.layer === b) { for (v = 0; d[v] !== A;)v++; v < f && (q += 2 * (f + 1 - v), r += 2 * (f - v)); v === f && (r += 1); v > f + 1 && (q += 4 * (v - (f + 1)), r += 4 * (v - f)) } y = d[f + 1].kc.i; for (y.reset(); y.next();)if (v = y.value, A = v.toVertex, v.valid && A.layer === b) { for (v = 0; d[v] !== A;)v++; v === f && (q += 1) } var v = A = 0, y = h[d[f].index], K = k[d[f].index], E = h[d[f + 1].index], Q = k[d[f + 1].index]; -1 !== y && (A += Math.abs(y - s), v += Math.abs(y - x)); -1 !== K && (A += Math.abs(K - s), v += Math.abs(K - x)); -1 !== E && (A += Math.abs(E - u), v += Math.abs(E - t)); -1 !== Q && (A += Math.abs(Q - u), v += Math.abs(Q - t)); if (r < q - .5 || r === q && p < n - .5 || r === q && p === n && v < A - .5) m = l = !0, d[f].column = x, d[f + 1].column = t, n = d[f], d[f] = d[f + 1], d[f + 1] = n } for (f = 0; f < e; f++)d[f].index = f; Au(a, b, d); return l } lu.prototype.straightenAndPack = function () { var a = 0, b = !1, c = 0 !== (this.Zi & Yu), a = this.Zi === qu; 1E3 < this.network.edges.count && !a && (c = !1); if (c) { b = []; for (a = a = 0; a <= this.qb; a++)b[a] = 0; for (var d = 0, e = this.network.vertexes.i; e.next();) { var f = e.value, a = f.layer, d = f.column, f = this.nodeMinColumnSpace(f, !1); b[a] = Math.max(b[a], d + f) } for (e.reset(); e.next();)f = e.value, a = f.layer, d = f.column, f.column = (8 * (this.Jb - b[a]) >> 1) + 8 * d; this.Jb *= 8 } if (0 !== (this.Zi & Zu)) for (b = !0; b;) { b = !1; for (a = this.Qf + 1; a <= this.qb; a++)b = $u(this, a, 1) || b; for (a = this.Qf - 1; 0 <= a; a--)b = $u(this, a, -1) || b; b = $u(this, this.Qf, 0) || b } if (0 !== (this.Zi & av)) { for (a = this.Qf + 1; a <= this.qb; a++)bv(this, a, 1); for (a = this.Qf - 1; 0 <= a; a--)bv(this, a, -1); bv(this, this.Qf, 0) } c && (cv(this, -1), cv(this, 1)); if (0 !== (this.Zi & Zu)) for (b = !0; b;) { b = !1; b = $u(this, this.Qf, 0) || b; for (a = this.Qf + 1; a <= this.qb; a++)b = $u(this, a, 0) || b; for (a = this.Qf - 1; 0 <= a; a--)b = $u(this, a, 0) || b } }; function $u(a, b, c) { for (var d = !1; dv(a, b, c);)d = !0; return d } function dv(a, b, c) { var d = 0, e = zu(a, b), f = a.je[b], h = Gu(a, b, -1); if (0 < c) for (d = 0; d < f; d++)h[d] = -1; var k = Gu(a, b, 1); if (0 > c) for (d = 0; d < f; d++)k[d] = -1; for (var l = !1, m = !0; m;)for (m = !1, d = 0; d < f; d++) { var n = e[d].column, p = a.nodeMinColumnSpace(e[d], !0), q = a.nodeMinColumnSpace(e[d], !1), r = 0, r = 0 > d - 1 || n - e[d - 1].column - 1 > p + a.nodeMinColumnSpace(e[d - 1], !1) ? n - 1 : n, p = 0, p = d + 1 >= f || e[d + 1].column - n - 1 > q + a.nodeMinColumnSpace(e[d + 1], !0) ? n + 1 : n, s = q = 0, u = 0, t = 0, x = 0, v = 0; if (0 >= c) for (var A = e[d].mc.i; A.next();) { var v = A.value, y = v.fromVertex; v.valid && y.layer !== b && (t = Bu(v), x = v.portFromColOffset, v = v.portToColOffset, y = y.column, q += (Math.abs(n + v - (y + x)) + 1) * t, s += (Math.abs(r + v - (y + x)) + 1) * t, u += (Math.abs(p + v - (y + x)) + 1) * t) } if (0 <= c) for (A = e[d].kc.i; A.next();)v = A.value, y = v.toVertex, v.valid && y.layer !== b && (t = Bu(v), x = v.portFromColOffset, v = v.portToColOffset, y = y.column, q += (Math.abs(n + x - (y + v)) + 1) * t, s += (Math.abs(r + x - (y + v)) + 1) * t, u += (Math.abs(p + x - (y + v)) + 1) * t); v = x = t = 0; A = h[e[d].index]; y = k[e[d].index]; -1 !== A && (t += Math.abs(A - n), x += Math.abs(A - r), v += Math.abs(A - p)); -1 !== y && (t += Math.abs(y - n), x += Math.abs(y - r), v += Math.abs(y - p)); if (s < q || s === q && x < t) m = l = !0, e[d].column = r; else if (u < q || u === q && v < t) m = l = !0, e[d].column = p } Au(a, b, e); a.normalize(); return l } function bv(a, b, c) { var d = 0, e = zu(a, b), f = a.je[b], h = Hu(a, b, c); c = []; for (d = 0; d < f; d++)c[d] = h[d]; for (h = !0; h;)for (h = !1, d = 0; d < f; d++) { var k = e[d].column, l = a.nodeMinColumnSpace(e[d], !0), m = a.nodeMinColumnSpace(e[d], !1), n = 0, p = 0, q = 0, q = p = 0; -1 === c[d] ? 0 === d && d === f - 1 ? n = k : 0 === d ? (p = e[d + 1].column, n = p - k === m + a.nodeMinColumnSpace(e[d + 1], !0) ? k - 1 : k) : d === f - 1 ? (q = e[d - 1].column, n = k - q === l + a.nodeMinColumnSpace(e[d - 1], !1) ? k + 1 : k) : (q = e[d - 1].column, q = q + a.nodeMinColumnSpace(e[d - 1], !1) + l + 1, p = e[d + 1].column, p = p - a.nodeMinColumnSpace(e[d + 1], !0) - m - 1, n = (q + p) / 2 | 0) : 0 === d && d === f - 1 ? n = c[d] : 0 === d ? (p = e[d + 1].column, p = p - a.nodeMinColumnSpace(e[d + 1], !0) - m - 1, n = Math.min(c[d], p)) : d === f - 1 ? (q = e[d - 1].column, q = q + a.nodeMinColumnSpace(e[d - 1], !1) + l + 1, n = Math.max(c[d], q)) : (q = e[d - 1].column, q = q + a.nodeMinColumnSpace(e[d - 1], !1) + l + 1, p = e[d + 1].column, p = p - a.nodeMinColumnSpace(e[d + 1], !0) - m - 1, q < c[d] && c[d] < p ? n = c[d] : q >= c[d] ? n = q : p <= c[d] && (n = p)); n !== k && (h = !0, e[d].column = n) } Au(a, b, e); a.normalize() } function ev(a, b) { for (var c = !0, d = a.network.vertexes.i; d.next();) { var e = d.value, f = a.nodeMinColumnSpace(e, !0), h = a.nodeMinColumnSpace(e, !1); if (e.column - f <= b && e.column + h >= b) { c = !1; break } } e = !1; if (c) for (d.reset(); d.next();)c = d.value, c.column > b && (c.column -= 1, e = !0); return e } function fv(a, b) { for (var c = b, c = b + 1, d = 0, e = [], f = [], d = 0; d <= a.qb; d++)e[d] = !1, f[d] = !1; for (var h = a.network.vertexes.i; h.next();) { var d = h.value, k = d.column - a.nodeMinColumnSpace(d, !0), l = d.column + a.nodeMinColumnSpace(d, !1); k <= b && l >= b && (e[d.layer] = !0); k <= c && l >= c && (f[d.layer] = !0) } k = !0; c = !1; for (d = 0; d <= a.qb; d++)k = k && !(e[d] && f[d]); if (k) for (h.reset(); h.next();)e = h.value, e.column > b && (e.column -= 1, c = !0); return c } function cv(a, b) { for (var c = 0; c <= a.Jb; c++)for (; ev(a, c);); a.normalize(); for (c = 0; c < a.Jb; c++)for (; fv(a, c);); a.normalize(); var c = 0, d, e = 0, f = 0, h = 0; if (0 < b) for (c = 0; c <= a.Jb; c++)for (d = Cu(a), e = Fu(a), f = e + 1; e < f;)f = e, gv(a, c, 1), h = Fu(a), h > e ? Du(a, d) : h < e && (e = h, d = Cu(a)); if (0 > b) for (c = a.Jb; 0 <= c; c--)for (d = Cu(a), e = Fu(a), f = e + 1; e < f;)f = e, gv(a, c, -1), h = Fu(a), h > e ? Du(a, d) : h < e && (e = h, d = Cu(a)); a.normalize() } function gv(a, b, c) { a.Cg = 0; for (var d = a.network.vertexes.i; d.next();)d.value.component = -1; if (0 < c) for (d.reset(); d.next();) { var e = d.value; e.column - a.nodeMinColumnSpace(e, !0) <= b && (e.component = a.Cg) } if (0 > c) for (d.reset(); d.next();)e = d.value, e.column + a.nodeMinColumnSpace(e, !1) >= b && (e.component = a.Cg); a.Cg++; for (d.reset(); d.next();)b = d.value, -1 === b.component && (Ju(a, b, a.Cg, -1, !0, !0), a.Cg++); var f = 0; b = []; for (f = 0; f < a.Cg * a.Cg; f++)b[f] = !1; e = []; for (f = 0; f < (a.qb + 1) * (a.Jb + 1); f++)e[f] = -1; for (d.reset(); d.next();)for (var f = d.value, h = f.layer, k = Math.max(0, f.column - a.nodeMinColumnSpace(f, !0)), l = Math.min(a.Jb, f.column + a.nodeMinColumnSpace(f, !1)); k <= l; k++)e[h * (a.Jb + 1) + k] = f.component; for (f = 0; f <= a.qb; f++) { if (0 < c) for (k = 0; k < a.Jb; k++)-1 !== e[f * (a.Jb + 1) + k] && -1 !== e[f * (a.Jb + 1) + k + 1] && e[f * (a.Jb + 1) + k] !== e[f * (a.Jb + 1) + k + 1] && (b[e[f * (a.Jb + 1) + k] * a.Cg + e[f * (a.Jb + 1) + k + 1]] = !0); if (0 > c) for (k = a.Jb; 0 < k; k--)-1 !== e[f * (a.Jb + 1) + k] && -1 !== e[f * (a.Jb + 1) + k - 1] && e[f * (a.Jb + 1) + k] !== e[f * (a.Jb + 1) + k - 1] && (b[e[f * (a.Jb + 1) + k] * a.Cg + e[f * (a.Jb + 1) + k - 1]] = !0) } e = []; for (f = 0; f < a.Cg; f++)e[f] = !0; h = new H("number"); h.add(0); for (l = 0; 0 !== h.count;)if (l = h.n[h.count - 1], h.$c(h.count - 1), e[l]) for (e[l] = !1, f = 0; f < a.Cg; f++)b[l * a.Cg + f] && h.Pd(0, f); if (0 < c) for (d.reset(); d.next();)a = d.value, e[a.component] && (a.column -= 1); if (0 > c) for (d.reset(); d.next();)c = d.value, e[c.component] && (c.column += 1) } lu.prototype.commitLayout = function () { if (this.tq) for (var a = xu(this, !0), b = xu(this, !1), c = this.network.edges.i; c.next();) { var d = c.value.link; null !== d && (d.Ab = a, d.Bb = b) } this.commitNodes(); this.Yz(); this.iu && this.commitLinks() }; function xu(a, b) { return 270 === a.aa ? b ? Hc : Kc : 90 === a.aa ? b ? Kc : Hc : 180 === a.aa ? b ? Ic : Jc : b ? Jc : Ic } lu.prototype.commitNodes = function () { this.yg = []; this.Pf = []; this.Of = []; this.Nb = []; for (var a = 0; a <= this.qb; a++)this.yg[a] = 0, this.Pf[a] = 0, this.Of[a] = 0, this.Nb[a] = 0; for (a = this.network.vertexes.i; a.next();) { var b = a.value, c = b.layer; this.yg[c] = Math.max(this.yg[c], this.nodeMinLayerSpace(b, !0)); this.Pf[c] = Math.max(this.Pf[c], this.nodeMinLayerSpace(b, !1)) } for (var b = 0, d = this.Im, c = 0; c <= this.qb; c++) { var e = d; 0 >= this.yg[c] + this.Pf[c] && (e = 0); 0 < c && (b += e / 2); 90 === this.aa || 0 === this.aa ? (b += this.Pf[c], this.Of[c] = b, b += this.yg[c]) : (b += this.yg[c], this.Of[c] = b, b += this.Pf[c]); c < this.qb && (b += e / 2); this.Nb[c] = b } d = b; b = this.qe; for (c = 0; c <= this.qb; c++)270 === this.aa ? this.Of[c] = b.y + this.Of[c] : 90 === this.aa ? (this.Of[c] = b.y + d - this.Of[c], this.Nb[c] = d - this.Nb[c]) : 180 === this.aa ? this.Of[c] = b.x + this.Of[c] : (this.Of[c] = b.x + d - this.Of[c], this.Nb[c] = d - this.Nb[c]); a.reset(); for (d = e = Infinity; a.next();) { var c = a.value, f = c.layer, h = c.column | 0, k = 0, l = 0; 270 === this.aa || 90 === this.aa ? (k = b.x + this.Xd * h, l = this.Of[f]) : (k = this.Of[f], l = b.y + this.Xd * h); c.ka = k; c.ra = l; e = Math.min(c.x, e); d = Math.min(c.y, d) } e = b.x - e; b = b.y - d; this.VB = new z(e, b); for (a.reset(); a.next();)c = a.value, c.x += e, c.y += b, c.commit() }; lu.prototype.Yz = function () { for (var a = 0, b = this.Im, c = 0; c <= this.qb; c++)a += this.yg[c], a += this.Pf[c]; for (var a = a + this.qb * b, b = [], c = this.Xd * this.Jb, d = this.RI; 0 <= d; d--)270 === this.aa ? 0 === d ? b.push(new B(0, 0, c, Math.abs(this.Nb[0]))) : b.push(new B(0, this.Nb[d - 1], c, Math.abs(this.Nb[d - 1] - this.Nb[d]))) : 90 === this.aa ? 0 === d ? b.push(new B(0, this.Nb[0], c, Math.abs(this.Nb[0] - a))) : b.push(new B(0, this.Nb[d], c, Math.abs(this.Nb[d - 1] - this.Nb[d]))) : 180 === this.aa ? 0 === d ? b.push(new B(0, 0, Math.abs(this.Nb[0]), c)) : b.push(new B(this.Nb[d - 1], 0, Math.abs(this.Nb[d - 1] - this.Nb[d]), c)) : 0 === d ? b.push(new B(this.Nb[0], 0, Math.abs(this.Nb[0] - a), c)) : b.push(new B(this.Nb[d], 0, Math.abs(this.Nb[d - 1] - this.Nb[d]), c)); this.commitLayers(b, this.VB) }; lu.prototype.commitLayers = function () { }; lu.prototype.commitLinks = function () { for (var a = this.network.edges.i, b; a.next();)b = a.value.link, null !== b && (b.fm(), b.Gp(), b.kj()); for (a.reset(); a.next();)b = a.value.link, null !== b && b.co(); for (a.reset(); a.next();) { var c = a.value; b = c.link; if (null !== b) { b.fm(); var d = b, e = d.V, f = d.Z, h = d.Lc, k = d.kd, l = c.fromVertex, m = c.toVertex; if (c.valid) { if (b.$e === Jj && 4 === b.qa) { if (c.rev) var n = e, e = f, f = n, p = h, h = k, k = p; if (l.column === m.column) { var q = b.getLinkPoint(e, h, b.computeSpot(!0), !0, !1, f, k), r = b.getLinkPoint(f, k, b.computeSpot(!1), !1, !1, e, h); q.I() || q.set(e.Y.Il); r.I() || r.set(f.Y.Il); b.Gp(); b.ij(q.x, q.y); b.ij((2 * q.x + r.x) / 3, (2 * q.y + r.y) / 3); b.ij((q.x + 2 * r.x) / 3, (q.y + 2 * r.y) / 3); b.ij(r.x, r.y) } else { var s = !1, u = !1; null !== h && b.computeSpot(!0) === tb && (s = !0); null !== k && b.computeSpot(!1) === tb && (u = !0); if (s || u) { var t = b.l(0).x, x = b.l(0).y, v = b.l(1).x, A = b.l(1).y, y = b.l(2).x, K = b.l(2).y, E = b.l(3).x, Q = b.l(3).y; if (s) { 90 === this.aa || 270 === this.aa ? (v = t, A = (x + Q) / 2) : (v = (t + E) / 2, A = x); b.ca(1, v, A); var X = b.getLinkPoint(e, h, b.computeSpot(!0), !0, !1, f, k); X.I() || X.set(e.Y.Il); b.ca(0, X.x, X.y) } u && (90 === this.aa || 270 === this.aa ? (y = E, K = (x + Q) / 2) : (y = (t + E) / 2, K = Q), b.ca(2, y, K), X = b.getLinkPoint(f, k, b.computeSpot(!1), !1, !1, e, h), X.I() || X.set(f.Y.Il), b.ca(3, X.x, X.y)) } } } b.kj() } else if (l.layer === m.layer) b.kj(); else { var O = !1, aa = !1, da = 0, S = b.Pt + 1; if (b.ac) aa = !0, da = b.qa, 4 < da && b.points.removeRange(2, da - 3); else if (b.$e === Jj) O = !0, da = b.qa, 4 < da && b.points.removeRange(2, da - 3), S = 2; else { var da = b.qa, Ra = b.computeSpot(!0) === tb, gb = b.computeSpot(!1) === tb; 2 < da && Ra && gb ? b.points.removeRange(1, da - 2) : 3 < da && Ra && !gb ? b.points.removeRange(1, da - 3) : 3 < da && !Ra && gb ? b.points.removeRange(2, da - 2) : 4 < da && !Ra && !gb && b.points.removeRange(2, da - 3) } var qa, Ja; if (c.rev) { for (var za = 0; null !== m && l !== m;) { Ja = qa = null; for (var Tb = m.mc.i; Tb.next();) { var Ob = Tb.value; if (Ob.link === c.link && (qa = Ob.fromVertex, Ja = Ob.toVertex, null === qa.sd)) break } if (qa !== l) if (Ua = b.l(S - 1).x, nb = b.l(S - 1).y, na = qa.ka, ma = qa.ra, aa) 180 === this.aa || 0 === this.aa ? 2 === S ? (b.w(S++, Ua, nb), b.w(S++, Ua, ma)) : (qe = null !== Ja ? Ja.ra : nb, qe !== ma && (hb = this.Nb[qa.layer - 1], b.w(S++, hb, nb), b.w(S++, hb, ma))) : 2 === S ? (b.w(S++, Ua, nb), b.w(S++, na, nb)) : (Hd = null !== Ja ? Ja.ka : Ua, Hd !== na && (hb = this.Nb[qa.layer - 1], b.w(S++, Ua, hb), b.w(S++, na, hb))); else if (2 === S) if (ib = Math.max(10, this.yg[m.layer]), fb = Math.max(10, this.Pf[m.layer]), O) 180 === this.aa ? na <= m.M.x ? (za = m.M.x, b.w(S++, za - ib, ma), b.w(S++, za, ma), b.w(S++, za + fb, ma)) : (b.w(S++, na - ib, ma), b.w(S++, na, ma), b.w(S++, na + fb, ma)) : 90 === this.aa ? ma >= m.M.bottom ? (za = m.M.y + m.M.height, b.w(S++, na, za + fb), b.w(S++, na, za), b.w(S++, na, za - ib)) : (b.w(S++, na, ma + fb), b.w(S++, na, ma), b.w(S++, na, ma - ib)) : 270 === this.aa ? ma <= m.M.y ? (za = m.M.y, b.w(S++, na, za - ib), b.w(S++, na, za), b.w(S++, na, za + fb)) : (b.w(S++, na, ma - ib), b.w(S++, na, ma), b.w(S++, na, ma + fb)) : 0 === this.aa && (na >= m.M.right ? (za = m.M.x + m.M.width, b.w(S++, za + fb, ma), b.w(S++, za, ma), b.w(S++, za - ib, ma)) : (b.w(S++, na + fb, ma), b.w(S++, na, ma), b.w(S++, na - ib, ma))); else { b.w(S++, Ua, nb); var $d = 0; if (180 === this.aa || 0 === this.aa) { if (180 === this.aa ? na >= m.M.right : na <= m.M.x) $d = (0 === this.aa ? -ib : fb) / 2; b.w(S++, Ua + $d, ma) } else { if (270 === this.aa ? ma >= m.M.bottom : ma <= m.M.y) $d = (90 === this.aa ? -ib : fb) / 2; b.w(S++, na, nb + $d) } b.w(S++, na, ma) } else ib = Math.max(10, this.yg[qa.layer]), fb = Math.max(10, this.Pf[qa.layer]), 180 === this.aa ? (O && b.w(S++, na - ib, ma), b.w(S++, na, ma), O && b.w(S++, na + fb, ma)) : 90 === this.aa ? (O && b.w(S++, na, ma + fb), b.w(S++, na, ma), O && b.w(S++, na, ma - ib)) : 270 === this.aa ? (O && b.w(S++, na, ma - ib), b.w(S++, na, ma), O && b.w(S++, na, ma + fb)) : (O && b.w(S++, na + fb, ma), b.w(S++, na, ma), O && b.w(S++, na - ib, ma)); m = qa } if (null === k || b.computeSpot(!1) !== tb || aa) if (Ua = b.l(S - 1).x, nb = b.l(S - 1).y, na = b.l(S).x, ma = b.l(S).y, aa) { var sd = this.Pf[l.layer], uc = 0; 180 === this.aa || 0 === this.aa ? (uc = nb, uc >= l.M.y && uc <= l.M.bottom && (180 === this.aa ? na >= l.M.x : na <= l.M.right) && (za = l.ka + (180 === this.aa ? -sd : sd), uc = uc < l.M.y + l.M.height / 2 ? l.M.y - this.Xd / 2 : l.M.bottom + this.Xd / 2, b.w(S++, za, nb), b.w(S++, za, uc)), b.w(S++, na, uc)) : (uc = Ua, uc >= l.M.x && uc <= l.M.right && (270 === this.aa ? ma >= l.M.y : ma <= l.M.bottom) && (za = l.ra + (270 === this.aa ? -sd : sd), uc = uc < l.M.x + l.M.width / 2 ? l.M.x - this.Xd / 2 : l.M.right + this.Xd / 2, b.w(S++, Ua, za), b.w(S++, uc, za)), b.w(S++, uc, ma)); b.w(S++, na, ma) } else if (O) ib = Math.max(10, this.yg[l.layer]), fb = Math.max(10, this.Pf[l.layer]), 180 === this.aa && na >= l.M.x ? (za = l.M.x + l.M.width, b.ca(S - 2, za, nb), b.ca(S - 1, za + fb, nb)) : 90 === this.aa && ma <= l.M.bottom ? (za = l.M.y, b.ca(S - 2, Ua, za), b.ca(S - 1, Ua, za - ib)) : 270 === this.aa && ma >= l.M.y ? (za = l.M.y + l.M.height, b.ca(S - 2, Ua, za), b.ca(S - 1, Ua, za + fb)) : 0 === this.aa && na <= l.M.right && (za = l.M.x, b.ca(S - 2, za, nb), b.ca(S - 1, za - ib, nb)); else { ib = Math.max(10, this.yg[l.layer]); fb = Math.max(10, this.Pf[l.layer]); $d = 0; if (180 === this.aa || 0 === this.aa) { if (180 === this.aa ? na <= l.M.x : na >= l.M.right) $d = (0 === this.aa ? fb : -ib) / 2; b.w(S++, na + $d, nb) } else { if (270 === this.aa ? ma <= l.M.y : ma >= l.M.bottom) $d = (90 === this.aa ? fb : -ib) / 2; b.w(S++, Ua, ma + $d) } b.w(S++, na, ma) } } else { for (; null !== l && l !== m;) { Ja = qa = null; for (var Ag = l.kc.i; Ag.next();) { var Ff = Ag.value; if (Ff.link === c.link && (qa = Ff.toVertex, Ja = Ff.fromVertex, null !== Ja.sd && (Ja = null), null === qa.sd)) break } var Ua = 0, nb = 0, na = 0, ma = 0, hb = 0, ib = 0, fb = 0; if (qa !== m) if (Ua = b.l(S - 1).x, nb = b.l(S - 1).y, na = qa.ka, ma = qa.ra, aa) if (180 === this.aa || 0 === this.aa) { var qe = null !== Ja ? Ja.ra : nb; qe !== ma && (hb = this.Nb[qa.layer], 2 === S && (hb = 0 === this.aa ? Math.max(hb, Ua) : Math.min(hb, Ua)), b.w(S++, hb, nb), b.w(S++, hb, ma)) } else { var Hd = null !== Ja ? Ja.ka : Ua; Hd !== na && (hb = this.Nb[qa.layer], 2 === S && (hb = 90 === this.aa ? Math.max(hb, nb) : Math.min(hb, nb)), b.w(S++, Ua, hb), b.w(S++, na, hb)) } else ib = Math.max(10, this.yg[qa.layer]), fb = Math.max(10, this.Pf[qa.layer]), 180 === this.aa ? (b.w(S++, na + fb, ma), O && b.w(S++, na, ma), b.w(S++, na - ib, ma)) : 90 === this.aa ? (b.w(S++, na, ma - ib), O && b.w(S++, na, ma), b.w(S++, na, ma + fb)) : 270 === this.aa ? (b.w(S++, na, ma + fb), O && b.w(S++, na, ma), b.w(S++, na, ma - ib)) : (b.w(S++, na - ib, ma), O && b.w(S++, na, ma), b.w(S++, na + fb, ma)); l = qa } aa && (Ua = b.l(S - 1).x, nb = b.l(S - 1).y, na = b.l(S).x, ma = b.l(S).y, 180 === this.aa || 0 === this.aa ? nb !== ma && (hb = 0 === this.aa ? Math.min(Math.max((na + Ua) / 2, this.Nb[m.layer]), na) : Math.max(Math.min((na + Ua) / 2, this.Nb[m.layer]), na), b.w(S++, hb, nb), b.w(S++, hb, ma)) : Ua !== na && (hb = 90 === this.aa ? Math.min(Math.max((ma + nb) / 2, this.Nb[m.layer]), ma) : Math.max(Math.min((ma + nb) / 2, this.Nb[m.layer]), ma), b.w(S++, Ua, hb), b.w(S++, na, hb))) } if (null !== d && O) { if (null !== h) { if (b.computeSpot(!0) === tb) { var ub = b.l(0), Ie = b.l(2); ub.L(Ie) || b.ca(1, (ub.x + Ie.x) / 2, (ub.y + Ie.y) / 2) } X = b.getLinkPoint(e, h, tb, !0, !1, f, k); X.I() || X.set(e.Y.Il); b.ca(0, X.x, X.y) } null !== k && (b.computeSpot(!1) === tb && (ub = b.l(b.qa - 1), Ie = b.l(b.qa - 3), ub.L(Ie) || b.ca(b.qa - 2, (ub.x + Ie.x) / 2, (ub.y + Ie.y) / 2)), X = b.getLinkPoint(f, k, tb, !1, !1, e, h), X.I() || X.set(f.Y.Il), b.ca(b.qa - 1, X.x, X.y)) } b.kj(); c.commit() } } } for (var hd = new H(W), cg = this.network.edges.i; cg.next();) { var Gf = cg.value.link; null !== Gf && Gf.ac && !hd.contains(Gf) && hd.add(Gf) } if (0 < hd.count) if (90 === this.aa || 270 === this.aa) { for (var Bg = 0, jb = new H(hv), zc, td, dg = hd.i; dg.next();) { var Eb = dg.value; if (null !== Eb && Eb.ac) for (var Pb = 2; Pb < Eb.qa - 3; Pb++)if (zc = Eb.l(Pb), td = Eb.l(Pb + 1), iv(zc.y, td.y) && !iv(zc.x, td.x)) { var re = new hv; re.layer = Math.floor(zc.y / 2); var Cg = Eb.l(0), Id = Eb.l(Eb.qa - 1); re.first = Cg.x * Cg.x + Cg.y; re.fe = Id.x * Id.x + Id.y; re.Ye = Math.min(zc.x, td.x); re.re = Math.max(zc.x, td.x); re.index = Pb; re.link = Eb; if (Pb + 2 < Eb.qa) { var ob = Eb.l(Pb - 1), Nc = Eb.l(Pb + 2), Hf = 0; ob.y < zc.y ? Hf = Nc.y < zc.y ? 3 : zc.x < td.x ? 2 : 1 : ob.y > zc.y && (Hf = Nc.y > zc.y ? 0 : td.x < zc.x ? 2 : 1); re.ti = Hf } jb.add(re) } } if (1 < jb.count) { jb.sort(this.fG); for (var Je = 0; Je < jb.count;) { for (var ai = jb.n[Je].layer, Sa = Je + 1; Sa < jb.count && jb.n[Sa].layer === ai;)Sa++; if (1 < Sa - Je) for (var ab = Je; ab < Sa;) { for (var Ac = jb.n[ab].re, vc = Je + 1; vc < Sa && jb.n[vc].Ye < Ac;)Ac = Math.max(Ac, jb.n[vc].re), vc++; var Yc = vc - ab; if (1 < Yc) { jb.wq(this.hy, ab, ab + Yc); for (var ph = 1, Wa = jb.n[ab].fe, Pb = ab; Pb < vc; Pb++) { var zb = jb.n[Pb]; zb.fe !== Wa && (ph++ , Wa = zb.fe) } jb.wq(this.eG, ab, ab + Yc); for (var vb = 1, Wa = jb.n[ab].first, Pb = ab; Pb < vc; Pb++)zb = jb.n[Pb], zb.first !== Wa && (vb++ , Wa = zb.first); var Bc = !0, Ab = vb; ph < vb ? (Bc = !1, Ab = ph, Wa = jb.n[ab].fe, jb.wq(this.hy, ab, ab + Yc)) : Wa = jb.n[ab].first; for (var pb = 0, Pb = ab; Pb < vc; Pb++) { zb = jb.n[Pb]; (Bc ? zb.first : zb.fe) !== Wa && (pb++ , Wa = Bc ? zb.first : zb.fe); Eb = zb.link; zc = Eb.l(zb.index); td = Eb.l(zb.index + 1); var Ib = this.AF * (pb - (Ab - 1) / 2); Bg++; Eb.fm(); Eb.ca(zb.index, zc.x, zc.y + Ib); Eb.ca(zb.index + 1, td.x, td.y + Ib); Eb.kj() } } ab = vc } Je = Sa } } } else { for (var ae = 0, Fb = new H(hv), Ub, id, bi = hd.i; bi.next();) { var Qb = bi.value; if (null !== Qb && Qb.ac) for (var Rb = 2; Rb < Qb.qa - 3; Rb++)if (Ub = Qb.l(Rb), id = Qb.l(Rb + 1), iv(Ub.x, id.x) && !iv(Ub.y, id.y)) { var Cc = new hv; Cc.layer = Math.floor(Ub.x / 2); var Zc = Qb.l(0), ud = Qb.l(Qb.qa - 1); Cc.first = Zc.x + Zc.y * Zc.y; Cc.fe = ud.x + ud.y * ud.y; Cc.Ye = Math.min(Ub.y, id.y); Cc.re = Math.max(Ub.y, id.y); Cc.index = Rb; Cc.link = Qb; if (Rb + 2 < Qb.qa) { var Dg = Qb.l(Rb - 1), ci = Qb.l(Rb + 2), qb = 0; Dg.x < Ub.x ? qb = ci.x < Ub.x ? 3 : Ub.y < id.y ? 2 : 1 : Dg.x > Ub.x && (qb = ci.x > Ub.x ? 0 : id.y < Ub.y ? 2 : 1); Cc.ti = qb } Fb.add(Cc) } } if (1 < Fb.count) { Fb.sort(this.fG); for (var $c = 0; $c < Fb.count;) { for (var di = Fb.n[$c].layer, Ke = $c + 1; Ke < Fb.count && Fb.n[Ke].layer === di;)Ke++; if (1 < Ke - $c) for (var jc = $c; jc < Ke;) { for (var se = Fb.n[jc].re, bc = $c + 1; bc < Ke && Fb.n[bc].Ye < se;)se = Math.max(se, Fb.n[bc].re), bc++; var Dc = bc - jc; if (1 < Dc) { Fb.wq(this.hy, jc, jc + Dc); for (var vd = 1, kc = Fb.n[jc].fe, Rb = jc; Rb < bc; Rb++) { var Ta = Fb.n[Rb]; Ta.fe !== kc && (vd++ , kc = Ta.fe) } Fb.wq(this.eG, jc, jc + Dc); for (var lc = 1, kc = Fb.n[jc].first, Rb = jc; Rb < bc; Rb++)Ta = Fb.n[Rb], Ta.first !== kc && (lc++ , kc = Ta.first); var ei = !0, Ze = lc; vd < lc ? (ei = !1, Ze = vd, kc = Fb.n[jc].fe, Fb.wq(this.hy, jc, jc + Dc)) : kc = Fb.n[jc].first; for (var Jd = 0, Rb = jc; Rb < bc; Rb++) { Ta = Fb.n[Rb]; (ei ? Ta.first : Ta.fe) !== kc && (Jd++ , kc = ei ? Ta.first : Ta.fe); Qb = Ta.link; Ub = Qb.l(Ta.index); id = Qb.l(Ta.index + 1); var Le = this.AF * (Jd - (Ze - 1) / 2); ae++; Qb.fm(); Qb.ca(Ta.index, Ub.x + Le, Ub.y); Qb.ca(Ta.index + 1, id.x + Le, id.y); Qb.kj() } } jc = bc } $c = Ke } } } }; lu.prototype.fG = function (a, b) { return a instanceof hv && b instanceof hv && a !== b ? a.layer < b.layer ? -1 : a.layer > b.layer ? 1 : a.Ye < b.Ye ? -1 : a.Ye > b.Ye ? 1 : a.re < b.re ? -1 : a.re > b.re ? 1 : 0 : 0 }; lu.prototype.eG = function (a, b) { return a instanceof hv && b instanceof hv && a !== b ? a.first < b.first ? -1 : a.first > b.first || a.ti < b.ti ? 1 : a.ti > b.ti || a.Ye < b.Ye ? -1 : a.Ye > b.Ye ? 1 : a.re < b.re ? -1 : a.re > b.re ? 1 : 0 : 0 }; lu.prototype.hy = function (a, b) { return a instanceof hv && b instanceof hv && a !== b ? a.fe < b.fe ? -1 : a.fe > b.fe || a.ti < b.ti ? 1 : a.ti > b.ti || a.Ye < b.Ye ? -1 : a.Ye > b.Ye ? 1 : a.re < b.re ? -1 : a.re > b.re ? 1 : 0 : 0 }; function iv(a, b) { var c = a - b; return -1 < c && 1 > c } function zu(a, b) { var c, d = a.je[b]; if (d >= a.jh.length) { c = []; for (var e = 0; e < a.jh.length; e++)c[e] = a.jh[e]; a.jh = c } void 0 === a.jh[d] || null === a.jh[d] ? c = [] : (c = a.jh[d], a.jh[d] = null); d = a.qs[b]; for (e = 0; e < d.length; e++) { var f = d[e]; c[f.index] = f } return c } function Au(a, b, c) { a.jh[a.je[b]] = c } w.defineProperty(lu, { layerSpacing: "layerSpacing" }, function () { return this.Im }, function (a) { this.Im !== a && (w.j(a, "number", lu, "layerSpacing"), 0 <= a && (this.Im = a, this.J())) }); w.defineProperty(lu, { DK: "columnSpacing" }, function () { return this.Xd }, function (a) { this.Xd !== a && (w.j(a, "number", lu, "columnSpacing"), 0 < a && (this.Xd = a, this.J())) }); w.defineProperty(lu, { direction: "direction" }, function () { return this.aa }, function (a) { this.aa !== a && (w.j(a, "number", lu, "direction"), 0 === a || 90 === a || 180 === a || 270 === a ? (this.aa = a, this.J()) : w.k("LayeredDigraphLayout.direction must be 0, 90, 180, or 270")) }); w.defineProperty(lu, { angle: "angle" }, function () { return this.direction }, function (a) { this.direction = a }); w.defineProperty(lu, { GH: "cycleRemoveOption" }, function () { return this.wo }, function (a) { this.wo !== a && (w.mb(a, lu, lu, "cycleRemoveOption"), a === su || a === mu) && (this.wo = a, this.J()) }); w.defineProperty(lu, { HI: "layeringOption" }, function () { return this.Xo }, function (a) { this.Xo !== a && (w.mb(a, lu, lu, "layeringOption"), a === nu || a === Ku || a === Mu) && (this.Xo = a, this.J()) }); w.defineProperty(lu, { sI: "initializeOption" }, function () { return this.Mo }, function (a) { this.Mo !== a && (w.mb(a, lu, lu, "initializeOption"), a === ou || a === Su || a === Qu) && (this.Mo = a, this.J()) }); w.defineProperty(lu, { hL: "iterations" }, function () { return this.Gm }, function (a) { this.Gm !== a && (w.vd(a, ru, "iterations"), 0 <= a && (this.Gm = a, this.J())) }); w.defineProperty(lu, { jH: "aggressiveOption" }, function () { return this.ko }, function (a) { this.ko !== a && (w.mb(a, lu, lu, "aggressiveOption"), a === Wu || a === pu || a === Xu) && (this.ko = a, this.J()) }); w.defineProperty(lu, { CL: "packOption" }, function () { return this.Zi }, function (a) { this.Zi !== a && (w.j(a, "number", lu, "packOption"), 0 <= a && 8 > a && (this.Zi = a, this.J())) }); w.defineProperty(lu, { tq: "setsPortSpots" }, function () { return this.ci }, function (a) { this.ci !== a && (w.j(a, "boolean", lu, "setsPortSpots"), this.ci = a, this.J()) }); w.defineProperty(lu, { AF: "linkSpacing" }, function () { return this.Yr }, function (a) { this.Yr !== a && (w.j(a, "number", lu, "linkSpacing"), 0 <= a && (this.Yr = a, this.J())) }); w.u(lu, { RI: "maxLayer" }, function () { return this.qb }); w.u(lu, { nL: "maxIndex" }, function () { return this.Yv }); w.u(lu, { mL: "maxColumn" }, function () { return this.Jb }); w.u(lu, { sL: "minIndexLayer" }, function () { return this.gs }); w.u(lu, { oL: "maxIndexLayer" }, function () { return this.Qf }); var mu; lu.CycleDepthFirst = mu = w.p(lu, "CycleDepthFirst", 0); var su; lu.CycleGreedy = su = w.p(lu, "CycleGreedy", 1); var nu; lu.LayerOptimalLinkLength = nu = w.p(lu, "LayerOptimalLinkLength", 0); var Ku; lu.LayerLongestPathSink = Ku = w.p(lu, "LayerLongestPathSink", 1); var Mu; lu.LayerLongestPathSource = Mu = w.p(lu, "LayerLongestPathSource", 2); var ou; lu.InitDepthFirstOut = ou = w.p(lu, "InitDepthFirstOut", 0); var Su; lu.InitDepthFirstIn = Su = w.p(lu, "InitDepthFirstIn", 1); var Qu; lu.InitNaive = Qu = w.p(lu, "InitNaive", 2); var Wu; lu.AggressiveNone = Wu = w.p(lu, "AggressiveNone", 0); var pu; lu.AggressiveLess = pu = w.p(lu, "AggressiveLess", 1); var Xu; lu.AggressiveMore = Xu = w.p(lu, "AggressiveMore", 2); lu.PackNone = 0; var Yu; lu.PackExpand = Yu = 1; var Zu; lu.PackStraighten = Zu = 2; var av; lu.PackMedian = av = 4; var qu; lu.PackAll = qu = 7; function hv() { this.index = this.re = this.Ye = this.fe = this.first = this.layer = 0; this.link = null; this.ti = 0 } w.ce(hv, { layer: !0, first: !0, fe: !0, Ye: !0, re: !0, index: !0, link: !0, ti: !0 }); function ru() { tg.call(this) } w.Ka(ru, tg); w.ga("LayeredDigraphNetwork", ru); ru.prototype.createVertex = function () { return new jv }; ru.prototype.createEdge = function () { return new kv }; function jv() { ns.call(this); this.index = this.column = this.layer = -1; this.component = NaN; this.near = null; this.valid = !1; this.finish = this.Op = NaN; this.ln = 0; this.RA = this.SA = null } w.Ka(jv, ns); w.ga("LayeredDigraphVertex", jv); function kv() { os.call(this); this.forest = this.rev = this.valid = !1; this.portToPos = this.portFromPos = NaN; this.portToColOffset = this.portFromColOffset = 0 } w.Ka(kv, os); w.ga("LayeredDigraphEdge", kv); function $() { 0 < arguments.length && w.jd($); sg.call(this); this.td = new I(Object); this.As = lv; this.Mf = mv; this.qt = nv; this.Vv = ov; this.QB = null; this.Mh = !0; this.md = pv; this.mg = (new ia(10, 10)).freeze(); this.va = new qv; this.wa = new qv; this.Hz = [] } w.Ka($, sg); w.ga("TreeLayout", $); $.prototype.cloneProtected = function (a) { sg.prototype.cloneProtected.call(this, a); a.As = this.As; a.qt = this.qt; a.Vv = this.Vv; a.Mh = this.Mh; a.md = this.md; a.mg.assign(this.mg); a.va.copyInheritedPropertiesFrom(this.va); a.wa.copyInheritedPropertiesFrom(this.wa) }; $.prototype.ic = function (a) { a.Ee === $ ? 0 === a.name.indexOf("Alignment") ? this.alignment = a : 0 === a.name.indexOf("Arrangement") ? this.Tf = a : 0 === a.name.indexOf("Compaction") ? this.compaction = a : 0 === a.name.indexOf("Path") ? this.path = a : 0 === a.name.indexOf("Sorting") ? this.sorting = a : 0 === a.name.indexOf("Style") ? this.VJ = a : w.k("Unknown enum value: " + a) : sg.prototype.ic.call(this, a) }; $.prototype.createNetwork = function () { return new rv }; $.prototype.makeNetwork = function (a) { function b(a) { if (a instanceof U) return !a.Af && "Comment" !== a.ud; if (a instanceof W) { var b = a.V; if (null === b || b.Af || "Comment" === b.ud) return !1; a = a.Z; return null === a || a.Af || "Comment" === a.ud ? !1 : !0 } return !1 } var c = this.createNetwork(); c.Tb = this; a instanceof D ? (c.sk(a.gg, !0, b), c.sk(a.links, !0, b)) : a instanceof V ? c.sk(a.Oc, !1, b) : c.sk(a.i, !1, b); return c }; $.prototype.doLayout = function (a) { null === a && w.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts"); null === this.network && (this.network = this.makeNetwork(a)); this.Tf !== sv && (this.qe = this.initialOrigin(this.qe)); var b = this.g; null === b && a instanceof D && (b = a); this.Mf = this.path === lv && null !== b ? b.Sd ? mv : tv : this.path === lv ? mv : this.path; if (0 < this.network.vertexes.count) { this.network.gx(); for (a = this.network.vertexes.i; a.next();)b = a.value, b.initialized = !1, b.level = 0, b.parent = null, b.children = []; if (0 < this.td.count) { a = new I(qv); for (b = this.td.i; b.next();) { var c = b.value; c instanceof U ? (c = this.network.zn(c), null !== c && a.add(c)) : c instanceof qv && a.add(c) } this.td = a } 0 === this.td.count && this.findRoots(); for (a = this.td.copy().i; a.next();)b = a.value, b.initialized || (b.initialized = !0, uv(this, b)); b = this.network.vertexes; for (a = null; a = vv(b), 0 < a.count;)b = wv(this, a), null !== b && this.td.add(b), b.initialized = !0, uv(this, b), b = a; for (a = this.td.i; a.next();)b = a.value, b instanceof qv && xv(this, b); for (a = this.td.i; a.next();)b = a.value, b instanceof qv && yv(this, b); for (a = this.td.i; a.next();)b = a.value, b instanceof qv && zv(this, b); this.Tz(); if (this.FA === Av) { c = []; for (a = this.network.vertexes.i; a.next();) { var d = a.value, b = d.parent; null === b && (b = d); var b = 0 === b.angle || 180 === b.angle, e = c[d.level]; void 0 === e && (e = 0); c[d.level] = Math.max(e, b ? d.width : d.height) } for (d = 0; d < c.length; d++)void 0 === c[d] && (c[d] = 0); this.QB = c; for (a = this.network.vertexes.i; a.next();)d = a.value, b = d.parent, null === b && (b = d), 0 === b.angle || 180 === b.angle ? (180 === b.angle && (d.Tt += c[d.level] - d.width), d.width = c[d.level]) : (270 === b.angle && (d.Ut += c[d.level] - d.height), d.height = c[d.level]) } else if (this.FA === Bv) for (a = this.network.vertexes.i; a.next();) { c = a.value; b = 0 === c.angle || 180 === c.angle; e = -1; for (d = 0; d < c.children.length; d++)var f = c.children[d], e = Math.max(e, b ? f.width : f.height); if (0 <= e) for (d = 0; d < c.children.length; d++)f = c.children[d], b ? (180 === c.angle && (f.Tt += e - f.width), f.width = e) : (270 === c.angle && (f.Ut += e - f.height), f.height = e) } for (a = this.td.i; a.next();)b = a.value, b instanceof qv && this.layoutTree(b); this.arrangeTrees(); this.updateParts() } this.network = null; this.td = new I(Object); this.Cf = !0 }; function vv(a) { var b = new I(qv); for (a = a.i; a.next();) { var c = a.value; c.initialized || b.add(c) } return b } $.prototype.findRoots = function () { for (var a = this.network.vertexes, b = a.i; b.next();) { var c = b.value; switch (this.Mf) { case mv: 0 === c.mc.count && this.td.add(c); break; case tv: 0 === c.kc.count && this.td.add(c); break; default: w.k("Unhandled path value " + this.Mf.toString()) } } 0 === this.td.count && (a = wv(this, a), null !== a && this.td.add(a)) }; function wv(a, b) { for (var c = 999999, d = null, e = b.i; e.next();) { var f = e.value; switch (a.Mf) { case mv: f.mc.count < c && (c = f.mc.count, d = f); break; case tv: f.kc.count < c && (c = f.kc.count, d = f); break; default: w.k("Unhandled path value " + a.Mf.toString()) } } return d } function uv(a, b) { if (null !== b) { switch (a.Mf) { case mv: if (0 < b.kc.count) { for (var c = new H(qv), d = b.MH; d.next();) { var e = d.value; Cv(a, b, e) && c.add(e) } 0 < c.count && (b.children = c.gc()) } break; case tv: if (0 < b.mc.count) { c = new H(qv); for (d = b.JJ; d.next();)e = d.value, Cv(a, b, e) && c.add(e); 0 < c.count && (b.children = c.gc()) } break; default: w.k("Unhandled path value" + a.Mf.toString()) }c = b.children; d = c.length; for (e = 0; e < d; e++) { var f = c[e]; f.initialized = !0; f.level = b.level + 1; f.parent = b; a.td.remove(f) } for (e = 0; e < d; e++)f = c[e], uv(a, f) } } function Cv(a, b, c) { if (c.initialized) { var d; if (null === b) d = !1; else { for (d = b.parent; null !== d && d !== c;)d = d.parent; d = d === c } if (d || c.level > b.level) return !1; a.removeChild(c.parent, c) } return !0 } $.prototype.removeChild = function (a, b) { if (null !== a && null !== b) { for (var c = a.children, d = 0, e = 0; e < c.length; e++)c[e] === b && d++; if (0 < d) { for (var d = Array(c.length - d), f = 0, e = 0; e < c.length; e++)c[e] !== b && (d[f++] = c[e]); a.children = d } } }; function xv(a, b) { if (null !== b) { a.initializeTreeVertexValues(b); b.alignment === Dv && a.sortTreeVertexChildren(b); for (var c = 0, d = b.pn, e = 0, f = b.children, h = f.length, k = 0; k < h; k++) { var l = f[k]; xv(a, l); c += l.descendantCount + 1; d = Math.max(d, l.maxChildrenCount); e = Math.max(e, l.maxGenerationCount) } b.descendantCount = c; b.maxChildrenCount = d; b.maxGenerationCount = 0 < d ? e + 1 : 0 } } function Ev(a, b) { switch (a.qt) { default: case nv: return null !== b.parent ? b.parent : a.va; case Fv: return null === b.parent ? a.va : null === b.parent.parent ? a.wa : b.parent; case Gv: return null !== b.parent ? null !== b.parent.parent ? b.parent.parent : a.wa : a.va; case Hv: var c = !0; if (0 === b.pn) c = !1; else for (var d = b.children, e = d.length, f = 0; f < e; f++)if (0 < d[f].pn) { c = !1; break } return c && null !== b.parent ? a.wa : null !== b.parent ? b.parent : a.va } } $.prototype.initializeTreeVertexValues = function (a) { var b = Ev(this, a); a.copyInheritedPropertiesFrom(b); if (null !== a.parent && a.parent.alignment === Dv) { for (var b = a.angle, c = a.parent.children, d = 0; d < c.length && a !== c[d];)d++; 0 === d % 2 ? d !== c.length - 1 && (b = 90 === b ? 180 : 180 === b ? 270 : 270 === b ? 180 : 270) : b = 90 === b ? 0 : 180 === b ? 90 : 270 === b ? 0 : 90; a.angle = b } a.initialized = !0 }; function yv(a, b) { if (null !== b) { a.assignTreeVertexValues(b); for (var c = b.children, d = c.length, e = 0; e < d; e++)yv(a, c[e]) } } $.prototype.assignTreeVertexValues = function () { }; function zv(a, b) { if (null !== b) { b.alignment !== Dv && a.sortTreeVertexChildren(b); for (var c = b.children, d = c.length, e = 0; e < d; e++)zv(a, c[e]) } } $.prototype.sortTreeVertexChildren = function (a) { switch (a.sorting) { case Iv: break; case Jv: a.children.reverse(); break; case Kv: a.children.sort(a.comparer); break; case Lv: a.children.sort(a.comparer); a.children.reverse(); break; default: w.k("Unhandled sorting value " + a.sorting.toString()) } }; $.prototype.Tz = function () { if (this.comments) for (var a = this.network.vertexes.i; a.next();)this.addComments(a.value) }; $.prototype.addComments = function (a) { var b = a.angle, c = a.parent, d = 0, e = Mv, e = !1; null !== c && (d = c.angle, e = c.alignment, e = Nv(e)); var b = 90 === b || 270 === b, d = 90 === d || 270 === d, c = 0 === a.pn, f = 0, h = 0, k = 0, l = a.commentSpacing; if (null !== a.Pc) for (var m = a.Pc.NE(); m.next();) { var n = m.value; "Comment" === n.ud && n.canLayout() && (null === a.comments && (a.comments = []), a.comments.push(n), n.af(), n = n.za, b && !c || !e && !d && c || e && d && c ? (f = Math.max(f, n.width), h += n.height + Math.abs(k)) : (f += n.width + Math.abs(k), h = Math.max(h, n.height)), k = l) } null !== a.comments && (b && !c || !e && !d && c || e && d && c ? (f += Math.abs(a.commentMargin), h = Math.max(0, h - a.height)) : (h += Math.abs(a.commentMargin), f = Math.max(0, f - a.width)), e = w.jg(0, 0, a.M.width + f, a.M.height + h), a.gb = e, w.Db(e)) }; function Nv(a) { return a === Ov || a === Dv || a === Pv || a === Qv } function Rv(a) { return a === Ov || a === Dv } function Sv(a) { var b = a.parent; if (null !== b) { var c = b.alignment; if (Nv(c)) { if (Rv(c)) { b = b.children; for (c = 0; c < b.length && a !== b[c];)c++; return 0 === c % 2 } if (c === Pv) return !0 } } return !1 } $.prototype.layoutComments = function (a) { if (null !== a.comments) { var b = a.Pc.za, c = a.parent, d = a.angle, e = 0, f = Mv, f = !1; null !== c && (e = c.angle, f = c.alignment, f = Nv(f)); for (var c = 90 === d || 270 === d, d = 90 === e || 270 === e, h = 0 === a.pn, k = Sv(a), l = 0, m = a.comments, n = m.length, p = w.K(), q = 0; q < n; q++) { var r = m[q], s = r.za; if (c && !h || !f && !d && h || f && d && h) { if (135 < e && !f || d && k) if (0 <= a.commentMargin) for (p.m(a.M.x - a.commentMargin - s.width, a.M.y + l), r.move(p), r = r.Ng(); r.next();) { var u = r.value; u.Ab = Ic; u.Bb = Jc } else for (p.m(a.M.x + 2 * a.T.x - a.commentMargin, a.M.y + l), r.move(p), r = r.Ng(); r.next();)u = r.value, u.Ab = Jc, u.Bb = Ic; else if (0 <= a.commentMargin) for (p.m(a.M.x + 2 * a.T.x + a.commentMargin, a.M.y + l), r.move(p), r = r.Ng(); r.next();)u = r.value, u.Ab = Jc, u.Bb = Ic; else for (p.m(a.M.x + a.commentMargin - s.width, a.M.y + l), r.move(p), r = r.Ng(); r.next();)u = r.value, u.Ab = Ic, u.Bb = Jc; l = 0 <= a.commentSpacing ? l + (s.height + a.commentSpacing) : l + (a.commentSpacing - s.height) } else { if (135 < e && !f || !d && k) if (0 <= a.commentMargin) for (p.m(a.M.x + l, a.M.y - a.commentMargin - s.height), r.move(p), r = r.Ng(); r.next();)u = r.value, u.Ab = Hc, u.Bb = Kc; else for (p.m(a.M.x + l, a.M.y + 2 * a.T.y - a.commentMargin), r.move(p), r = r.Ng(); r.next();)u = r.value, u.Ab = Kc, u.Bb = Hc; else if (0 <= a.commentMargin) for (p.m(a.M.x + l, a.M.y + 2 * a.T.y + a.commentMargin), r.move(p), r = r.Ng(); r.next();)u = r.value, u.Ab = Kc, u.Bb = Hc; else for (p.m(a.M.x + l, a.M.y + a.commentMargin - s.height), r.move(p), r = r.Ng(); r.next();)u = r.value, u.Ab = Hc, u.Bb = Kc; l = 0 <= a.commentSpacing ? l + (s.width + a.commentSpacing) : l + (a.commentSpacing - s.width) } } w.v(p); b = l - a.commentSpacing - (c ? b.height : b.width); if (this.Mf === mv) for (e = a.kc; e.next();)a = e.value.link, null === a || a.Xl || (a.Sl = 0 < b ? b : NaN); else for (e = a.mc; e.next();)a = e.value.link, null === a || a.Xl || (a.km = 0 < b ? b : NaN) } }; $.prototype.layoutTree = function (a) { if (null !== a) { for (var b = a.children, c = b.length, d = 0; d < c; d++)this.layoutTree(b[d]); switch (a.compaction) { case Tv: Uv(this, a); break; case Vv: if (a.alignment === Dv) Uv(this, a); else if (0 === a.pn) { var d = a.parent, b = !1, c = 0, e = Mv; null !== d && (c = d.angle, e = d.alignment, b = Nv(e)); d = Sv(a); a.pa.m(0, 0); a.kb.m(a.width, a.height); null === a.parent || null === a.comments || (180 !== c && 270 !== c || b) && !d ? a.Na.m(0, 0) : 180 === c && !b || (90 === c || 270 === c) && d ? a.Na.m(a.width - 2 * a.T.x, 0) : a.Na.m(0, a.height - 2 * a.T.y); a.ku = null; a.Eu = null } else { for (var f = Wv(a), b = 90 === f || 270 === f, h = 0, k = a.children, l = k.length, m = 0; m < l; m++)var n = k[m], h = Math.max(h, b ? n.kb.width : n.kb.height); var p = a.alignment, d = p === Xv, q = p === Yv, r = Nv(p), s = Math.max(0, a.breadthLimit), c = Zv(a), u = a.nodeSpacing, t = $v(a), x = a.rowSpacing, v = 0; if (d || q || a.nq || a.oq && 1 === a.maxGenerationCount) v = Math.max(0, a.rowIndent); var d = a.width, e = a.height, A = 0, y = 0, K = 0, E = null, Q = null, X = 0, O = 0, aa = 0, da = 0, S = 0, Ra = 0, gb = 0, qa = 0, n = 0; r && !Rv(p) && 135 < f && k.reverse(); if (Rv(p)) if (1 < l) for (m = 0; m < l; m++)0 === m % 2 && m !== l - 1 ? qa = Math.max(qa, b ? k[m].kb.width : k[m].kb.height) : 0 !== m % 2 && (n = Math.max(n, b ? k[m].kb.width : k[m].kb.height)); else 1 === l && (qa = b ? k[0].kb.width : k[0].kb.height); if (r) { switch (p) { case Ov: y = 135 > f ? aw(a, k, qa, A, y) : bw(a, k, qa, A, y); qa = y.x; A = y.width; y = y.height; break; case Pv: for (m = 0; m < l; m++) { var n = k[m], Ja = n.kb, E = 0 === Ra ? 0 : x; b ? (n.pa.m(h - Ja.width, da + E), A = Math.max(A, Ja.width), y = Math.max(y, da + E + Ja.height), da += E + Ja.height) : (n.pa.m(aa + E, h - Ja.height), A = Math.max(A, aa + E + Ja.width), y = Math.max(y, Ja.height), aa += E + Ja.width); Ra++ } break; case Qv: for (m = 0; m < l; m++)n = k[m], Ja = n.kb, E = 0 === Ra ? 0 : x, b ? (n.pa.m(u / 2 + a.T.x, da + E), A = Math.max(A, Ja.width), y = Math.max(y, da + E + Ja.height), da += E + Ja.height) : (n.pa.m(aa + E, u / 2 + a.T.y), A = Math.max(A, aa + E + Ja.width), y = Math.max(y, Ja.height), aa += E + Ja.width), Ra++ }E = cw(this, 2); Q = cw(this, 2); b ? (E[0].m(0, 0), E[1].m(0, y), Q[0].m(A, 0)) : (E[0].m(0, 0), E[1].m(A, 0), Q[0].m(0, y)); Q[1].m(A, y) } else for (m = 0; m < l; m++) { n = k[m]; Ja = n.kb; if (b) { 0 < s && 0 < Ra && aa + u + Ja.width > s && (aa < h && Iw(a, p, h - aa, 0, gb, m - 1), S++ , Ra = 0, gb = m, K = y, aa = 0, da = 135 < f ? -y - x : y + x); Jw(this, n, 0, da); var za = 0; if (0 === Ra) { if (E = n.ku, Q = n.Eu, X = Ja.width, O = Ja.height, null === E || null === Q || f !== Wv(n)) E = cw(this, 2), Q = cw(this, 2), E[0].m(0, 0), E[1].m(0, O), Q[0].m(X, 0), Q[1].m(X, O) } else { var Tb = w.cb(), O = Kw(this, a, n, E, Q, X, O, Tb), za = O.x, E = Tb[0], Q = Tb[1], X = O.width, O = O.height; w.ua(Tb); aa < Ja.width && 0 > za && (Lw(a, -za, 0, gb, m - 1), Mw(E, -za, 0), Mw(Q, -za, 0), za = 0) } n.pa.m(za, da); A = Math.max(A, X); y = Math.max(y, K + (0 === S ? 0 : x) + Ja.height); aa = X } else { 0 < s && 0 < Ra && da + u + Ja.height > s && (da < h && Iw(a, p, 0, h - da, gb, m - 1), S++ , Ra = 0, gb = m, K = A, da = 0, aa = 135 < f ? -A - x : A + x); Jw(this, n, aa, 0); za = 0; if (0 === Ra) { if (E = n.ku, Q = n.Eu, X = Ja.width, O = Ja.height, null === E || null === Q || f !== Wv(n)) E = cw(this, 2), Q = cw(this, 2), E[0].m(0, 0), E[1].m(X, 0), Q[0].m(0, O), Q[1].m(X, O) } else Tb = w.cb(), O = Kw(this, a, n, E, Q, X, O, Tb), za = O.x, E = Tb[0], Q = Tb[1], X = O.width, O = O.height, w.ua(Tb), da < Ja.height && 0 > za && (Lw(a, 0, -za, gb, m - 1), Mw(E, 0, -za), Mw(Q, 0, -za), za = 0); n.pa.m(aa, za); y = Math.max(y, O); A = Math.max(A, K + (0 === S ? 0 : x) + Ja.width); da = O } Ra++ } 0 < S && (b ? (y += Math.max(0, c), aa < A && Iw(a, p, A - aa, 0, gb, l - 1), 0 < v && (q || Lw(a, v, 0, 0, l - 1), A += v)) : (A += Math.max(0, c), da < y && Iw(a, p, 0, y - da, gb, l - 1), 0 < v && (q || Lw(a, 0, v, 0, l - 1), y += v))); v = q = 0; switch (p) { case Nw: b ? q += A / 2 - a.T.x - t / 2 : v += y / 2 - a.T.y - t / 2; break; case Mv: 0 < S ? b ? q += A / 2 - a.T.x - t / 2 : v += y / 2 - a.T.y - t / 2 : b ? (qa = k[0].pa.x + k[0].Na.x, m = k[l - 1].pa.x + k[l - 1].Na.x + 2 * k[l - 1].T.x, q += qa + (m - qa) / 2 - a.T.x - t / 2) : (qa = k[0].pa.y + k[0].Na.y, m = k[l - 1].pa.y + k[l - 1].Na.y + 2 * k[l - 1].T.y, v += qa + (m - qa) / 2 - a.T.y - t / 2); break; case Xv: b ? (q -= t, A += t) : (v -= t, y += t); break; case Yv: b ? (q += A - a.width + t, A += t) : (v += y - a.height + t, y += t); break; case Ov: b ? q = 1 < l ? q + (qa + u / 2 - a.T.x) : q + (k[0].T.x - a.T.x + k[0].Na.x) : v = 1 < l ? v + (qa + u / 2 - a.T.y) : v + (k[0].T.y - a.T.y + k[0].Na.y); break; case Pv: b ? q += A + u / 2 - a.T.x : v += y + u / 2 - a.T.y; break; case Qv: break; default: w.k("Unhandled alignment value " + p.toString()) }for (m = 0; m < l; m++)n = k[m], b ? n.pa.m(n.pa.x + n.Na.x - q, n.pa.y + (135 < f ? (r ? -y : -n.kb.height) + n.Na.y - c : e + c + n.Na.y)) : n.pa.m(n.pa.x + (135 < f ? (r ? -A : -n.kb.width) + n.Na.x - c : d + c + n.Na.x), n.pa.y + n.Na.y - v); l = k = 0; r ? b ? (A = Ow(a, A, q), 0 > q && (q = 0), 135 < f && (v += y + c), y += e + c, p === Qv && (k += u / 2 + a.T.x), l += e + c) : (135 < f && (q += A + c), A += d + c, y = Pw(a, y, v), 0 > v && (v = 0), p === Qv && (l += u / 2 + a.T.y), k += d + c) : b ? (null === a.comments ? d > A && (p = Qw(p, d - A, 0), k = p.x, l = p.y, A = d, q = 0) : A = Ow(a, A, q), 0 > q && (k -= q, q = 0), 135 < f && (v += y + c), y = Math.max(Math.max(y, e), y + e + c), l += e + c) : (135 < f && (q += A + c), A = Math.max(Math.max(A, d), A + d + c), null === a.comments ? e > y && (p = Qw(p, 0, e - y), k = p.x, l = p.y, y = e, v = 0) : y = Pw(a, y, v), 0 > v && (l -= v, v = 0), k += d + c); if (0 < S) f = cw(this, 4), p = cw(this, 4), b ? (f[2].m(0, e + c), f[3].m(f[2].x, y), p[2].m(A, f[2].y), p[3].m(p[2].x, f[3].y)) : (f[2].m(d + c, 0), f[3].m(A, f[2].y), p[2].m(f[2].x, y), p[3].m(f[3].x, p[2].y)); else { f = cw(this, E.length + 2); p = cw(this, Q.length + 2); for (m = 0; m < E.length; m++)r = E[m], f[m + 2].m(r.x + k, r.y + l); for (m = 0; m < Q.length; m++)r = Q[m], p[m + 2].m(r.x + k, r.y + l) } b ? (f[0].m(q, 0), f[1].m(f[0].x, e), f[2].y < f[1].y && (f[2].x > f[0].x ? f[2].assign(f[1]) : f[1].assign(f[2])), f[3].y < f[2].y && (f[3].x > f[0].x ? f[3].assign(f[2]) : f[2].assign(f[3])), p[0].m(q + d, 0), p[1].m(p[0].x, e), p[2].y < p[1].y && (p[2].x < p[0].x ? p[2].assign(p[1]) : p[1].assign(p[2])), p[3].y < p[2].y && (p[3].x < p[0].x ? p[3].assign(p[2]) : p[2].assign(p[3])), f[2].y -= c / 2, p[2].y -= c / 2) : (f[0].m(0, v), f[1].m(d, f[0].y), f[2].x < f[1].x && (f[2].y > f[0].y ? f[2].assign(f[1]) : f[1].assign(f[2])), f[3].x < f[2].x && (f[3].y > f[0].y ? f[3].assign(f[2]) : f[2].assign(f[3])), p[0].m(0, v + e), p[1].m(d, p[0].y), p[2].x < p[1].x && (p[2].y < p[0].y ? p[2].assign(p[1]) : p[1].assign(p[2])), p[3].x < p[2].x && (p[3].y < p[0].y ? p[3].assign(p[2]) : p[2].assign(p[3])), f[2].x -= c / 2, p[2].x -= c / 2); Rw(this, E); Rw(this, Q); a.ku = f; a.Eu = p; a.Na.m(q, v); a.kb.m(A, y) } break; default: w.k("Unhandled compaction value " + a.compaction.toString()) } } }; function Uv(a, b) { if (0 === b.pn) { var c = !1, d = 0, e = Mv; null !== b.parent && (d = b.parent.angle, e = b.parent.alignment, c = Nv(e)); e = Sv(b); b.pa.m(0, 0); b.kb.m(b.width, b.height); null === b.parent || null === b.comments || (180 !== d && 270 !== d || c) && !e ? b.Na.m(0, 0) : 180 === d && !c || (90 === d || 270 === d) && e ? b.Na.m(b.width - 2 * b.T.x, 0) : b.Na.m(0, b.height - 2 * b.T.y) } else { for (var c = Wv(b), d = 90 === c || 270 === c, f = 0, e = b.children, h = e.length, k = 0; k < h; k++)var l = e[k], f = Math.max(f, d ? l.kb.width : l.kb.height); var m = b.alignment, n = m === Xv, p = m === Yv, q = Nv(m), r = Math.max(0, b.breadthLimit), s = Zv(b), u = b.nodeSpacing, t = $v(b), x = n || p ? 0 : t / 2, v = b.rowSpacing, A = 0; if (n || p || b.nq || b.oq && 1 === b.maxGenerationCount) A = Math.max(0, b.rowIndent); var n = b.width, y = b.height, K = 0, E = 0, Q = 0, X = 0, O = 0, aa = 0, da = 0, S = 0, Ra = 0, gb = 0; q && !Rv(m) && 135 < c && e.reverse(); if (Rv(m)) if (1 < h) for (k = 0; k < h; k++) { var l = e[k], qa = l.kb; 0 === k % 2 && k !== h - 1 ? Ra = Math.max(Ra, (d ? qa.width : qa.height) + Sw(l) - u) : 0 !== k % 2 && (gb = Math.max(gb, (d ? qa.width : qa.height) + Sw(l) - u)) } else 1 === h && (Ra = d ? e[0].kb.width : e[0].kb.height); if (q) switch (m) { case Ov: case Dv: E = 135 > c ? aw(b, e, Ra, K, E) : bw(b, e, Ra, K, E); Ra = E.x; K = E.width; E = E.height; break; case Pv: for (k = 0; k < h; k++)l = e[k], qa = l.kb, r = 0 === da ? 0 : v, d ? (l.pa.m(f - qa.width, O + r), K = Math.max(K, qa.width), E = Math.max(E, O + r + qa.height), O += r + qa.height) : (l.pa.m(X + r, f - qa.height), K = Math.max(K, X + r + qa.width), E = Math.max(E, qa.height), X += r + qa.width), da++; break; case Qv: for (f = 0; f < h; f++)l = e[f], qa = l.kb, r = 0 === da ? 0 : v, d ? (l.pa.m(u / 2 + b.T.x, O + r), K = Math.max(K, qa.width), E = Math.max(E, O + r + qa.height), O += r + qa.height) : (l.pa.m(X + r, u / 2 + b.T.y), K = Math.max(K, X + r + qa.width), E = Math.max(E, qa.height), X += r + qa.width), da++ } else for (k = 0; k < h; k++)l = e[k], qa = l.kb, d ? (0 < r && 0 < da && X + u + qa.width > r && (X < f && Iw(b, m, f - X, 0, S, k - 1), aa++ , da = 0, S = k, Q = E, X = 0, O = 135 < c ? -E - v : E + v), gb = 0 === da ? x : u, Jw(a, l, 0, O), l.pa.m(X + gb, O), K = Math.max(K, X + gb + qa.width), E = Math.max(E, Q + (0 === aa ? 0 : v) + qa.height), X += gb + qa.width) : (0 < r && 0 < da && O + u + qa.height > r && (O < f && Iw(b, m, 0, f - O, S, k - 1), aa++ , da = 0, S = k, Q = K, O = 0, X = 135 < c ? -K - v : K + v), gb = 0 === da ? x : u, Jw(a, l, X, 0), l.pa.m(X, O + gb), E = Math.max(E, O + gb + qa.height), K = Math.max(K, Q + (0 === aa ? 0 : v) + qa.width), O += gb + qa.height), da++; 0 < aa && (d ? (E += Math.max(0, s), X < K && Iw(b, m, K - X, 0, S, h - 1), 0 < A && (p || Lw(b, A, 0, 0, h - 1), K += A)) : (K += Math.max(0, s), O < E && Iw(b, m, 0, E - O, S, h - 1), 0 < A && (p || Lw(b, 0, A, 0, h - 1), E += A))); A = p = 0; switch (m) { case Nw: d ? p += K / 2 - b.T.x - t / 2 : A += E / 2 - b.T.y - t / 2; break; case Mv: 0 < aa ? d ? p += K / 2 - b.T.x - t / 2 : A += E / 2 - b.T.y - t / 2 : d ? (m = e[0].pa.x + e[0].Na.x, u = e[h - 1].pa.x + e[h - 1].Na.x + 2 * e[h - 1].T.x, p += m + (u - m) / 2 - b.T.x - t / 2) : (m = e[0].pa.y + e[0].Na.y, u = e[h - 1].pa.y + e[h - 1].Na.y + 2 * e[h - 1].T.y, A += m + (u - m) / 2 - b.T.y - t / 2); break; case Xv: d ? (p -= t, K += t) : (A -= t, E += t); break; case Yv: d ? (p += K - b.width + t, K += t) : (A += E - b.height + t, E += t); break; case Ov: case Dv: d ? p = 1 < h ? p + (Ra + u / 2 - b.T.x) : p + (e[0].T.x - b.T.x + e[0].Na.x) : A = 1 < h ? A + (Ra + u / 2 - b.T.y) : A + (e[0].T.y - b.T.y + e[0].Na.y); break; case Pv: d ? p += K + u / 2 - b.T.x : A += E + u / 2 - b.T.y; break; case Qv: break; default: w.k("Unhandled alignment value " + m.toString()) }for (k = 0; k < h; k++)l = e[k], d ? l.pa.m(l.pa.x + l.Na.x - p, l.pa.y + (135 < c ? (q ? -E : -l.kb.height) + l.Na.y - s : y + s + l.Na.y)) : l.pa.m(l.pa.x + (135 < c ? (q ? -K : -l.kb.width) + l.Na.x - s : n + s + l.Na.x), l.pa.y + l.Na.y - A); d ? (K = Ow(b, K, p), 0 > p && (p = 0), 135 < c && (A += E + s), E += y + s) : (135 < c && (p += K + s), K += n + s, E = Pw(b, E, A), 0 > A && (A = 0)); b.Na.m(p, A); b.kb.m(K, E) } } function aw(a, b, c, d, e) { var f = b.length; if (0 === f) return new B(c, 0, d, e); if (1 === f) { var h = b[0]; d = h.kb.width; e = h.kb.height; return new B(c, 0, d, e) } for (var k = a.nodeSpacing, l = a.rowSpacing, m = 90 === Wv(a), n = 0, p = 0, q = 0, r = 0; r < f; r++)if (!(0 !== r % 2 || 1 < f && r === f - 1)) { var h = b[r], s = h.kb, u = 0 === n ? 0 : l; if (m) { var t = Sw(h) - k; h.pa.m(c - (s.width + t), q + u); d = Math.max(d, s.width + t); e = Math.max(e, q + u + s.height); q += u + s.height } else t = Sw(h) - k, h.pa.m(p + u, c - (s.height + t)), e = Math.max(e, s.height + t), d = Math.max(d, p + u + s.width), p += u + s.width; n++ } var n = 0, x = p, v = q; m ? (p = c + k, q = 0) : (p = 0, q = c + k); for (r = 0; r < f; r++)0 !== r % 2 && (h = b[r], s = h.kb, u = 0 === n ? 0 : l, m ? (t = Sw(h) - k, h.pa.m(p + t, q + u), d = Math.max(d, p + s.width + t), e = Math.max(e, q + u + s.height), q += u + s.height) : (t = Sw(h) - k, h.pa.m(p + u, q + t), d = Math.max(d, p + u + s.width), e = Math.max(e, q + s.height + t), p += u + s.width), n++); 1 < f && 1 === f % 2 && (h = b[f - 1], s = h.kb, b = Tw(h, m ? Math.max(Math.abs(v), Math.abs(q)) : Math.max(Math.abs(x), Math.abs(p))), m ? (h.pa.m(c + k / 2 - h.T.x - h.Na.x, e + b), m = c + k / 2 - h.T.x - h.Na.x, d = Math.max(d, m + s.width), 0 > m && (d -= m), e = Math.max(e, Math.max(v, q) + b + s.height), 0 > h.pa.x && (c = Uw(a, h.pa.x, !1, c, k))) : (h.pa.m(d + b, c + k / 2 - h.T.y - h.Na.y), d = Math.max(d, Math.max(x, p) + b + s.width), m = c + k / 2 - h.T.y - h.Na.y, e = Math.max(e, m + s.height), 0 > m && (e -= m), 0 > h.pa.y && (c = Uw(a, h.pa.y, !0, c, k)))); return new B(c, 0, d, e) } function bw(a, b, c, d, e) { var f = b.length; if (0 === f) return new B(c, 0, d, e); if (1 === f) { var h = b[0]; d = h.kb.width; e = h.kb.height; return new B(c, 0, d, e) } for (var k = a.nodeSpacing, l = a.rowSpacing, m = 270 === Wv(a), n = 0, p = 0, q = 0, r = 0; r < f; r++)if (!(0 !== r % 2 || 1 < f && r === f - 1)) { var h = b[r], s = h.kb, u = 0 === n ? 0 : l; if (m) { var t = Sw(h) - k, q = q - (u + s.height); h.pa.m(c - (s.width + t), q); d = Math.max(d, s.width + t); e = Math.max(e, Math.abs(q)) } else t = Sw(h) - k, p -= u + s.width, h.pa.m(p, c - (s.height + t)), e = Math.max(e, s.height + t), d = Math.max(d, Math.abs(p)); n++ } var n = 0, x = p, v = q; m ? (p = c + k, q = 0) : (p = 0, q = c + k); for (r = 0; r < f; r++)0 !== r % 2 && (h = b[r], s = h.kb, u = 0 === n ? 0 : l, m ? (t = Sw(h) - k, q -= u + s.height, h.pa.m(p + t, q), d = Math.max(d, p + s.width + t), e = Math.max(e, Math.abs(q))) : (t = Sw(h) - k, p -= u + s.width, h.pa.m(p, q + t), e = Math.max(e, q + s.height + t), d = Math.max(d, Math.abs(p))), n++); 1 < f && 1 === f % 2 && (h = b[f - 1], s = h.kb, l = Tw(h, m ? Math.max(Math.abs(v), Math.abs(q)) : Math.max(Math.abs(x), Math.abs(p))), m ? (h.pa.m(c + k / 2 - h.T.x - h.Na.x, -e - s.height - l), p = c + k / 2 - h.T.x - h.Na.x, d = Math.max(d, p + s.width), 0 > p && (d -= p), e = Math.max(e, Math.abs(Math.min(v, q)) + l + s.height), 0 > h.pa.x && (c = Uw(a, h.pa.x, !1, c, k))) : (h.pa.m(-d - s.width - l, c + k / 2 - h.T.y - h.Na.y), d = Math.max(d, Math.abs(Math.min(x, p)) + l + s.width), p = c + k / 2 - h.T.y - h.Na.y, e = Math.max(e, p + s.height), 0 > p && (e -= p), 0 > h.pa.y && (c = Uw(a, h.pa.y, !0, c, k)))); for (r = 0; r < f; r++)h = b[r], m ? h.pa.m(h.pa.x, h.pa.y + e) : h.pa.m(h.pa.x + d, h.pa.y); return new B(c, 0, d, e) } function Sw(a) { return null === a.parent ? 0 : a.parent.nodeSpacing } function Tw(a) { return null === a.parent ? 0 : a.parent.rowSpacing } function Uw(a, b, c, d, e) { a = a.children; for (var f = a.length, h = 0; h < f; h++)c ? a[h].pa.m(a[h].pa.x, a[h].pa.y - b) : a[h].pa.m(a[h].pa.x - b, a[h].pa.y); b = a[f - 1]; return Math.max(d, c ? b.Na.y + b.T.y - e / 2 : b.Na.x + b.T.x - e / 2) } function Ow(a, b, c) { switch (a.alignment) { case Mv: case Nw: var d = b; c + a.width > d && (d = c + a.width); 0 > c && (d -= c); return d; case Xv: return a.width > b ? a.width : b; case Yv: return 2 * a.T.x > b ? a.width : b + a.width - 2 * a.T.x; case Ov: case Dv: return d = Math.min(0, c), c = Math.max(b, c + a.width), Math.max(a.width, c - d); case Pv: return a.width - a.T.x + a.nodeSpacing / 2 + b; case Qv: return Math.max(a.width, a.T.x + a.nodeSpacing / 2 + b); default: return b } } function Pw(a, b, c) { switch (a.alignment) { case Mv: case Nw: var d = b; c + a.height > d && (d = c + a.height); 0 > c && (d -= c); return d; case Xv: return a.height > b ? a.height : b; case Yv: return 2 * a.T.y > b ? a.height : b + a.height - 2 * a.T.y; case Ov: case Dv: return d = Math.min(0, c), c = Math.max(b, c + a.height), Math.max(a.height, c - d); case Pv: return a.height - a.T.y + a.nodeSpacing / 2 + b; case Qv: return Math.max(a.height, a.T.y + a.nodeSpacing / 2 + b); default: return b } } function Qw(a, b, c) { switch (a) { case Nw: b /= 2; c /= 2; break; case Mv: b /= 2; c /= 2; break; case Xv: c = b = 0; break; case Yv: break; default: w.k("Unhandled alignment value " + a.toString()) }return new z(b, c) } function Iw(a, b, c, d, e, f) { b = Qw(b, c, d); Lw(a, b.x, b.y, e, f) } function Lw(a, b, c, d, e) { if (0 !== b || 0 !== c) for (a = a.children; d <= e; d++) { var f = a[d].pa; f.x += b; f.y += c } } function Jw(a, b, c, d) { var e = b.parent; switch (a.Mf) { case mv: for (a = b.mc; a.next();)b = a.value, b.fromVertex === e && b.Hs.m(c, d); break; case tv: for (a = b.kc; a.next();)b = a.value, b.toVertex === e && b.Hs.m(c, d); break; default: w.k("Unhandled path value " + a.Mf.toString()) } } function Mw(a, b, c) { for (var d = 0; d < a.length; d++) { var e = a[d]; e.x += b; e.y += c } } function Kw(a, b, c, d, e, f, h, k) { var l = Wv(b), m = 90 === l || 270 === l, n = b.nodeSpacing; b = d; var p = e; d = f; e = h; var q = c.ku, r = c.Eu; h = c.kb; var s = m ? Math.max(e, h.height) : Math.max(d, h.width); if (null === q || l !== Wv(c)) q = cw(a, 2), r = cw(a, 2), m ? (q[0].m(0, 0), q[1].m(0, h.height), r[0].m(h.width, 0), r[1].m(r[0].x, q[1].y)) : (q[0].m(0, 0), q[1].m(h.width, 0), r[0].m(0, h.height), r[1].m(q[1].x, r[0].y)); if (m) { c = d; d = 9999999; if (!(null === p || 2 > p.length || null === q || 2 > q.length)) for (m = l = 0; l < p.length && m < q.length;) { e = p[l]; var u = q[m]; f = u.x; var t = u.y; f += c; var x = e; l + 1 < p.length && (x = p[l + 1]); var v = u, u = v.x, v = v.y; m + 1 < q.length && (v = q[m + 1], u = v.x, v = v.y, u += c); var A = d; e.y === t ? A = f - e.x : e.y > t && e.y < v ? A = f + (e.y - t) / (v - t) * (u - f) - e.x : t > e.y && t < x.y && (A = f - (e.x + (t - e.y) / (x.y - e.y) * (x.x - e.x))); A < d && (d = A); x.y <= e.y ? l++ : v <= t ? m++ : (x.y <= v && l++ , v <= x.y && m++) } c -= d; c += n; l = q; m = c; if (null === b || 2 > b.length || null === l || 2 > l.length) d = null; else { n = cw(a, b.length + l.length); for (d = f = e = 0; f < l.length && l[f].y < b[0].y;)t = l[f++], n[d++].m(t.x + m, t.y); for (; e < b.length;)t = b[e++], n[d++].m(t.x, t.y); for (e = b[b.length - 1].y; f < l.length && l[f].y <= e;)f++; for (; f < l.length && l[f].y > e;)t = l[f++], n[d++].m(t.x + m, t.y); l = cw(a, d); for (e = 0; e < d; e++)l[e].assign(n[e]); Rw(a, n); d = l } f = r; t = c; if (null === p || 2 > p.length || null === f || 2 > f.length) e = null; else { n = cw(a, p.length + f.length); for (m = x = l = 0; l < p.length && p[l].y < f[0].y;)e = p[l++], n[m++].m(e.x, e.y); for (; x < f.length;)e = f[x++], n[m++].m(e.x + t, e.y); for (f = f[f.length - 1].y; l < p.length && p[l].y <= f;)l++; for (; l < p.length && p[l].y > f;)e = p[l++], n[m++].m(e.x, e.y); e = cw(a, m); for (l = 0; l < m; l++)e[l].assign(n[l]); Rw(a, n) } f = Math.max(0, c) + h.width; h = s } else { c = e; d = 9999999; if (!(null === p || 2 > p.length || null === q || 2 > q.length)) for (m = l = 0; l < p.length && m < q.length;)e = p[l], u = q[m], f = u.x, t = u.y, t += c, x = e, l + 1 < p.length && (x = p[l + 1]), v = u, u = v.x, v = v.y, m + 1 < q.length && (v = q[m + 1], u = v.x, v = v.y, v += c), A = d, e.x === f ? A = t - e.y : e.x > f && e.x < u ? A = t + (e.x - f) / (u - f) * (v - t) - e.y : f > e.x && f < x.x && (A = t - (e.y + (f - e.x) / (x.x - e.x) * (x.y - e.y))), A < d && (d = A), x.x <= e.x ? l++ : u <= f ? m++ : (x.x <= u && l++ , u <= x.x && m++); c -= d; c += n; l = q; m = c; if (null === b || 2 > b.length || null === l || 2 > l.length) d = null; else { n = cw(a, b.length + l.length); for (d = f = e = 0; f < l.length && l[f].x < b[0].x;)t = l[f++], n[d++].m(t.x, t.y + m); for (; e < b.length;)t = b[e++], n[d++].m(t.x, t.y); for (e = b[b.length - 1].x; f < l.length && l[f].x <= e;)f++; for (; f < l.length && l[f].x > e;)t = l[f++], n[d++].m(t.x, t.y + m); l = cw(a, d); for (e = 0; e < d; e++)l[e].assign(n[e]); Rw(a, n); d = l } f = r; t = c; if (null === p || 2 > p.length || null === f || 2 > f.length) e = null; else { n = cw(a, p.length + f.length); for (m = x = l = 0; l < p.length && p[l].x < f[0].x;)e = p[l++], n[m++].m(e.x, e.y); for (; x < f.length;)e = f[x++], n[m++].m(e.x, e.y + t); for (f = f[f.length - 1].x; l < p.length && p[l].x <= f;)l++; for (; l < p.length && p[l].x > f;)e = p[l++], n[m++].m(e.x, e.y); e = cw(a, m); for (l = 0; l < m; l++)e[l].assign(n[l]); Rw(a, n) } f = s; h = Math.max(0, c) + h.height } Rw(a, b); Rw(a, q); Rw(a, p); Rw(a, r); k[0] = d; k[1] = e; return new B(c, 0, f, h) } function cw(a, b) { var c = a.Hz[b]; if (void 0 !== c && (c = c.pop(), void 0 !== c)) return c; for (var c = [], d = 0; d < b; d++)c[d] = new z; return c } function Rw(a, b) { var c = b.length, d = a.Hz[c]; void 0 === d && (d = [], a.Hz[c] = d); d.push(b) } $.prototype.arrangeTrees = function () { if (this.md === sv) for (var a = this.td.i; a.next();) { var b = a.value; if (b instanceof qv) { var c = b.Pc; if (null !== c) { var d = c.position, c = d.x, d = d.y; isFinite(c) || (c = 0); isFinite(d) || (d = 0); Vw(this, b, c, d) } } } else { c = []; for (a = this.td.i; a.next();)b = a.value, b instanceof qv && c.push(b); switch (this.sorting) { case Iv: break; case Jv: c.reverse(); break; case Kv: c.sort(this.comparer); break; case Lv: c.sort(this.comparer); c.reverse(); break; default: w.k("Unhandled sorting value " + this.sorting.toString()) }b = this.qe; a = b.x; b = b.y; for (d = 0; d < c.length; d++) { var e = c[d]; Vw(this, e, a + e.Na.x, b + e.Na.y); switch (this.md) { case pv: b += e.kb.height + this.mg.height; break; case Ww: a += e.kb.width + this.mg.width; break; default: w.k("Unhandled arrangement value " + this.md.toString()) } } } }; function Vw(a, b, c, d) { if (null !== b) { b.x = c; b.y = d; b = b.children; for (var e = b.length, f = 0; f < e; f++) { var h = b[f]; Vw(a, h, c + h.pa.x, d + h.pa.y) } } } $.prototype.commitLayout = function () { this.kB(); this.commitNodes(); this.Yz(); this.iu && this.commitLinks() }; $.prototype.commitNodes = function () { for (var a = this.network.vertexes.i; a.next();)a.value.commit(); for (a.reset(); a.next();)this.layoutComments(a.value) }; $.prototype.Yz = function () { if (this.FA === Av) { for (var a = this.QB, b = [], c = null, d = this.network.vertexes.i; d.next();) { var e = d.value; null === c ? c = e.gb.copy() : c.Kh(e.gb); var f = b[e.level], f = void 0 === f ? Zv(e) : Math.max(f, Zv(e)); b[e.level] = f } for (d = 0; d < b.length; d++)void 0 === b[d] && (b[d] = 0); 90 === this.angle || 270 === this.angle ? (c.zf(this.nodeSpacing / 2, this.layerSpacing), e = new z(-this.nodeSpacing / 2, -this.layerSpacing / 2)) : (c.zf(this.layerSpacing, this.nodeSpacing / 2), e = new z(-this.layerSpacing / 2, -this.nodeSpacing / 2)); var f = [], c = 90 === this.angle || 270 === this.angle ? c.width : c.height, h = 0; if (180 === this.angle || 270 === this.angle) for (d = 0; d < a.length; d++)h += a[d] + b[d]; for (d = 0; d < a.length; d++) { var k = a[d] + b[d]; 270 === this.angle ? (h -= k, f.push(new B(0, h, c, k))) : 90 === this.angle ? (f.push(new B(0, h, c, k)), h += k) : 180 === this.angle ? (h -= k, f.push(new B(h, 0, k, c))) : (f.push(new B(h, 0, k, c)), h += k) } this.commitLayers(f, e) } }; $.prototype.commitLayers = function () { }; $.prototype.commitLinks = function () { for (var a = this.network.edges.i; a.next();)a.value.commit() }; $.prototype.kB = function () { for (var a = this.td.i; a.next();) { var b = a.value; b instanceof qv && Xw(this, b) } }; function Xw(a, b) { if (null !== b) { a.setPortSpots(b); for (var c = b.children, d = c.length, e = 0; e < d; e++)Xw(a, c[e]) } } $.prototype.setPortSpots = function (a) { var b = a.alignment; if (Nv(b)) { var c = this.Mf === mv, d = Wv(a), e; switch (d) { case 0: e = Jc; break; case 90: e = Kc; break; case 180: e = Ic; break; default: e = Hc }var f = a.children, h = f.length; switch (b) { case Ov: case Dv: for (b = 0; b < h; b++) { var k = f[b], k = (c ? k.mc : k.kc).first(); if (null !== k && (k = k.link, null !== k)) { var l = 90 === d || 270 === d ? Ic : Hc; if (1 === h || b === h - 1 && 1 === h % 2) switch (d) { case 0: l = Ic; break; case 90: l = Hc; break; case 180: l = Jc; break; default: l = Kc } else 0 === b % 2 && (l = 90 === d || 270 === d ? Jc : Kc); c ? (a.setsPortSpot && (k.Ab = e), a.setsChildPortSpot && (k.Bb = l)) : (a.setsPortSpot && (k.Ab = l), a.setsChildPortSpot && (k.Bb = e)) } } break; case Pv: l = 90 === d || 270 === d ? Jc : Kc; for (d = c ? a.kc : a.mc; d.next();)k = d.value.link, null !== k && (c ? (a.setsPortSpot && (k.Ab = e), a.setsChildPortSpot && (k.Bb = l)) : (a.setsPortSpot && (k.Ab = l), a.setsChildPortSpot && (k.Bb = e))); break; case Qv: for (l = 90 === d || 270 === d ? Ic : Hc, d = c ? a.kc : a.mc; d.next();)k = d.value.link, null !== k && (c ? (a.setsPortSpot && (k.Ab = e), a.setsChildPortSpot && (k.Bb = l)) : (a.setsPortSpot && (k.Ab = l), a.setsChildPortSpot && (k.Bb = e))) } } else if (c = Wv(a), this.Mf === mv) for (e = a.kc; e.next();) { if (d = e.value.link, null !== d) { if (a.setsPortSpot) if (a.portSpot.Wc()) switch (c) { case 0: d.Ab = Jc; break; case 90: d.Ab = Kc; break; case 180: d.Ab = Ic; break; default: d.Ab = Hc } else d.Ab = a.portSpot; if (a.setsChildPortSpot) if (a.childPortSpot.Wc()) switch (c) { case 0: d.Bb = Ic; break; case 90: d.Bb = Hc; break; case 180: d.Bb = Jc; break; default: d.Bb = Kc } else d.Bb = a.childPortSpot } } else for (e = a.mc; e.next();)if (d = e.value.link, null !== d) { if (a.setsPortSpot) if (a.portSpot.Wc()) switch (c) { case 0: d.Bb = Jc; break; case 90: d.Bb = Kc; break; case 180: d.Bb = Ic; break; default: d.Bb = Hc } else d.Bb = a.portSpot; if (a.setsChildPortSpot) if (a.childPortSpot.Wc()) switch (c) { case 0: d.Ab = Ic; break; case 90: d.Ab = Hc; break; case 180: d.Ab = Jc; break; default: d.Ab = Kc } else d.Ab = a.childPortSpot } }; function Wv(a) { a = a.angle; return 45 >= a ? 0 : 135 >= a ? 90 : 225 >= a ? 180 : 315 >= a ? 270 : 0 } function Zv(a) { var b = Wv(a), b = 90 === b || 270 === b, c = a.layerSpacing; if (0 < a.layerSpacingParentOverlap) var d = Math.min(1, a.layerSpacingParentOverlap), c = c - (b ? a.height * d : a.width * d); c < (b ? -a.height : -a.width) && (c = b ? -a.height : -a.width); return c } function $v(a) { var b = Wv(a), b = 90 === b || 270 === b, c = a.nodeIndent; if (0 < a.nodeIndentPastParent) var d = Math.min(1, a.nodeIndentPastParent), c = c + (b ? a.width * d : a.height * d); return c = Math.max(0, c) } w.defineProperty($, { JL: "roots" }, function () { return this.td }, function (a) { this.td !== a && (w.G(a, I, $, "roots"), this.td = a, this.J()) }); w.defineProperty($, { path: "path" }, function () { return this.As }, function (a) { this.As !== a && (w.mb(a, $, $, "path"), this.As = a, this.J()) }); w.defineProperty($, { VJ: "treeStyle" }, function () { return this.qt }, function (a) { this.md !== a && (w.mb(a, $, $, "treeStyle"), a === nv || a === Gv || a === Hv || a === Fv) && (this.qt = a, this.J()) }); w.defineProperty($, { FA: "layerStyle" }, function () { return this.Vv }, function (a) { this.md !== a && (w.mb(a, $, $, "layerStyle"), a === ov || a === Bv || a === Av) && (this.Vv = a, this.J()) }); w.defineProperty($, { comments: "comments" }, function () { return this.Mh }, function (a) { this.Mh !== a && (w.j(a, "boolean", $, "comments"), this.Mh = a, this.J()) }); w.defineProperty($, { Tf: "arrangement" }, function () { return this.md }, function (a) { this.md !== a && (w.mb(a, $, $, "arrangement"), a === pv || a === Ww || a === sv) && (this.md = a, this.J()) }); w.defineProperty($, { pE: "arrangementSpacing" }, function () { return this.mg }, function (a) { w.G(a, ia, $, "arrangementSpacing"); this.mg.L(a) || (this.mg.assign(a), this.J()) }); w.defineProperty($, { IL: "rootDefaults" }, function () { return this.va }, function (a) { this.va !== a && (w.G(a, qv, $, "rootDefaults"), this.va = a, this.J()) }); w.defineProperty($, { lK: "alternateDefaults" }, function () { return this.wa }, function (a) { this.wa !== a && (w.G(a, qv, $, "alternateDefaults"), this.wa = a, this.J()) }); w.defineProperty($, { sorting: "sorting" }, function () { return this.va.sorting }, function (a) { this.va.sorting !== a && (w.mb(a, $, $, "sorting"), a === Iv || a === Jv || a === Kv || Lv) && (this.va.sorting = a, this.J()) }); w.defineProperty($, { comparer: "comparer" }, function () { return this.va.comparer }, function (a) { this.va.comparer !== a && (w.j(a, "function", $, "comparer"), this.va.comparer = a, this.J()) }); w.defineProperty($, { angle: "angle" }, function () { return this.va.angle }, function (a) { this.va.angle !== a && (w.j(a, "number", $, "angle"), 0 === a || 90 === a || 180 === a || 270 === a ? (this.va.angle = a, this.J()) : w.k("TreeLayout.angle must be 0, 90, 180, or 270")) }); w.defineProperty($, { alignment: "alignment" }, function () { return this.va.alignment }, function (a) { this.va.alignment !== a && (w.mb(a, $, $, "alignment"), this.va.alignment = a, this.J()) }); w.defineProperty($, { nodeIndent: "nodeIndent" }, function () { return this.va.nodeIndent }, function (a) { this.va.nodeIndent !== a && (w.j(a, "number", $, "nodeIndent"), 0 <= a && (this.va.nodeIndent = a, this.J())) }); w.defineProperty($, { nodeIndentPastParent: "nodeIndentPastParent" }, function () { return this.va.nodeIndentPastParent }, function (a) { this.va.nodeIndentPastParent !== a && (w.j(a, "number", $, "nodeIndentPastParent"), 0 <= a && 1 >= a && (this.va.nodeIndentPastParent = a, this.J())) }); w.defineProperty($, { nodeSpacing: "nodeSpacing" }, function () { return this.va.nodeSpacing }, function (a) { this.va.nodeSpacing !== a && (w.j(a, "number", $, "nodeSpacing"), this.va.nodeSpacing = a, this.J()) }); w.defineProperty($, { layerSpacing: "layerSpacing" }, function () { return this.va.layerSpacing }, function (a) { this.va.layerSpacing !== a && (w.j(a, "number", $, "layerSpacing"), this.va.layerSpacing = a, this.J()) }); w.defineProperty($, { layerSpacingParentOverlap: "layerSpacingParentOverlap" }, function () { return this.va.layerSpacingParentOverlap }, function (a) { this.va.layerSpacingParentOverlap !== a && (w.j(a, "number", $, "layerSpacingParentOverlap"), 0 <= a && 1 >= a && (this.va.layerSpacingParentOverlap = a, this.J())) }); w.defineProperty($, { compaction: "compaction" }, function () { return this.va.compaction }, function (a) { this.va.compaction !== a && (w.mb(a, $, $, "compaction"), a === Tv || a === Vv) && (this.va.compaction = a, this.J()) }); w.defineProperty($, { breadthLimit: "breadthLimit" }, function () { return this.va.breadthLimit }, function (a) { this.va.breadthLimit !== a && (w.j(a, "number", $, "breadthLimit"), 0 <= a && (this.va.breadthLimit = a, this.J())) }); w.defineProperty($, { rowSpacing: "rowSpacing" }, function () { return this.va.rowSpacing }, function (a) { this.va.rowSpacing !== a && (w.j(a, "number", $, "rowSpacing"), this.va.rowSpacing = a, this.J()) }); w.defineProperty($, { rowIndent: "rowIndent" }, function () { return this.va.rowIndent }, function (a) { this.va.rowIndent !== a && (w.j(a, "number", $, "rowIndent"), 0 <= a && (this.va.rowIndent = a, this.J())) }); w.defineProperty($, { commentSpacing: "commentSpacing" }, function () { return this.va.commentSpacing }, function (a) { this.va.commentSpacing !== a && (w.j(a, "number", $, "commentSpacing"), this.va.commentSpacing = a, this.J()) }); w.defineProperty($, { commentMargin: "commentMargin" }, function () { return this.va.commentMargin }, function (a) { this.va.commentMargin !== a && (w.j(a, "number", $, "commentMargin"), this.va.commentMargin = a, this.J()) }); w.defineProperty($, { setsPortSpot: "setsPortSpot" }, function () { return this.va.setsPortSpot }, function (a) { this.va.setsPortSpot !== a && (w.j(a, "boolean", $, "setsPortSpot"), this.va.setsPortSpot = a, this.J()) }); w.defineProperty($, { portSpot: "portSpot" }, function () { return this.va.portSpot }, function (a) { w.G(a, L, $, "portSpot"); this.va.portSpot.L(a) || (this.va.portSpot = a, this.J()) }); w.defineProperty($, { setsChildPortSpot: "setsChildPortSpot" }, function () { return this.va.setsChildPortSpot }, function (a) { this.va.setsChildPortSpot !== a && (w.j(a, "boolean", $, "setsChildPortSpot"), this.va.setsChildPortSpot = a, this.J()) }); w.defineProperty($, { childPortSpot: "childPortSpot" }, function () { return this.va.childPortSpot }, function (a) { w.G(a, L, $, "childPortSpot"); this.va.childPortSpot.L(a) || (this.va.childPortSpot = a, this.J()) }); w.defineProperty($, { wK: "alternateSorting" }, function () { return this.wa.sorting }, function (a) { this.wa.sorting !== a && (w.mb(a, $, $, "alternateSorting"), a === Iv || a === Jv || a === Kv || Lv) && (this.wa.sorting = a, this.J()) }); w.defineProperty($, { kK: "alternateComparer" }, function () { return this.wa.comparer }, function (a) { this.wa.comparer !== a && (w.j(a, "function", $, "alternateComparer"), this.wa.comparer = a, this.J()) }); w.defineProperty($, { eK: "alternateAngle" }, function () { return this.wa.angle }, function (a) { this.wa.angle !== a && (w.j(a, "number", $, "alternateAngle"), 0 === a || 90 === a || 180 === a || 270 === a) && (this.wa.angle = a, this.J()) }); w.defineProperty($, { dK: "alternateAlignment" }, function () { return this.wa.alignment }, function (a) { this.wa.alignment !== a && (w.mb(a, $, $, "alternateAlignment"), this.wa.alignment = a, this.J()) }); w.defineProperty($, { oK: "alternateNodeIndent" }, function () { return this.wa.nodeIndent }, function (a) { this.wa.nodeIndent !== a && (w.j(a, "number", $, "alternateNodeIndent"), 0 <= a && (this.wa.nodeIndent = a, this.J())) }); w.defineProperty($, { pK: "alternateNodeIndentPastParent" }, function () { return this.wa.nodeIndentPastParent }, function (a) { this.wa.nodeIndentPastParent !== a && (w.j(a, "number", $, "alternateNodeIndentPastParent"), 0 <= a && 1 >= a && (this.wa.nodeIndentPastParent = a, this.J())) }); w.defineProperty($, { qK: "alternateNodeSpacing" }, function () { return this.wa.nodeSpacing }, function (a) { this.wa.nodeSpacing !== a && (w.j(a, "number", $, "alternateNodeSpacing"), this.wa.nodeSpacing = a, this.J()) }); w.defineProperty($, { mK: "alternateLayerSpacing" }, function () { return this.wa.layerSpacing }, function (a) { this.wa.layerSpacing !== a && (w.j(a, "number", $, "alternateLayerSpacing"), this.wa.layerSpacing = a, this.J()) }); w.defineProperty($, { nK: "alternateLayerSpacingParentOverlap" }, function () { return this.wa.layerSpacingParentOverlap }, function (a) { this.wa.layerSpacingParentOverlap !== a && (w.j(a, "number", $, "alternateLayerSpacingParentOverlap"), 0 <= a && 1 >= a && (this.wa.layerSpacingParentOverlap = a, this.J())) }); w.defineProperty($, { jK: "alternateCompaction" }, function () { return this.wa.compaction }, function (a) { this.wa.compaction !== a && (w.mb(a, $, $, "alternateCompaction"), a === Tv || a === Vv) && (this.wa.compaction = a, this.J()) }); w.defineProperty($, { fK: "alternateBreadthLimit" }, function () { return this.wa.breadthLimit }, function (a) { this.wa.breadthLimit !== a && (w.j(a, "number", $, "alternateBreadthLimit"), 0 <= a && (this.wa.breadthLimit = a, this.J())) }); w.defineProperty($, { tK: "alternateRowSpacing" }, function () { return this.wa.rowSpacing }, function (a) { this.wa.rowSpacing !== a && (w.j(a, "number", $, "alternateRowSpacing"), this.wa.rowSpacing = a, this.J()) }); w.defineProperty($, { sK: "alternateRowIndent" }, function () { return this.wa.rowIndent }, function (a) { this.wa.rowIndent !== a && (w.j(a, "number", $, "alternateRowIndent"), 0 <= a && (this.wa.rowIndent = a, this.J())) }); w.defineProperty($, { iK: "alternateCommentSpacing" }, function () { return this.wa.commentSpacing }, function (a) { this.wa.commentSpacing !== a && (w.j(a, "number", $, "alternateCommentSpacing"), this.wa.commentSpacing = a, this.J()) }); w.defineProperty($, { hK: "alternateCommentMargin" }, function () { return this.wa.commentMargin }, function (a) { this.wa.commentMargin !== a && (w.j(a, "number", $, "alternateCommentMargin"), this.wa.commentMargin = a, this.J()) }); w.defineProperty($, { vK: "alternateSetsPortSpot" }, function () { return this.wa.setsPortSpot }, function (a) { this.wa.setsPortSpot !== a && (w.j(a, "boolean", $, "alternateSetsPortSpot"), this.wa.setsPortSpot = a, this.J()) }); w.defineProperty($, { rK: "alternatePortSpot" }, function () { return this.wa.portSpot }, function (a) { w.G(a, L, $, "alternatePortSpot"); this.wa.portSpot.L(a) || (this.wa.portSpot = a, this.J()) }); w.defineProperty($, { uK: "alternateSetsChildPortSpot" }, function () { return this.wa.setsChildPortSpot }, function (a) { this.wa.setsChildPortSpot !== a && (w.j(a, "boolean", $, "alternateSetsChildPortSpot"), this.wa.setsChildPortSpot = a, this.J()) }); w.defineProperty($, { gK: "alternateChildPortSpot" }, function () { return this.wa.childPortSpot }, function (a) { w.G(a, L, $, "alternateChildPortSpot"); this.wa.childPortSpot.L(a) || (this.wa.childPortSpot = a, this.J()) }); var lv; $.PathDefault = lv = w.p($, "PathDefault", -1); var mv; $.PathDestination = mv = w.p($, "PathDestination", 0); var tv; $.PathSource = tv = w.p($, "PathSource", 1); var Iv; $.SortingForwards = Iv = w.p($, "SortingForwards", 10); var Jv; $.SortingReverse = Jv = w.p($, "SortingReverse", 11); var Kv; $.SortingAscending = Kv = w.p($, "SortingAscending", 12); var Lv; $.SortingDescending = Lv = w.p($, "SortingDescending", 13); var Nw; $.AlignmentCenterSubtrees = Nw = w.p($, "AlignmentCenterSubtrees", 20); var Mv; $.AlignmentCenterChildren = Mv = w.p($, "AlignmentCenterChildren", 21); var Xv; $.AlignmentStart = Xv = w.p($, "AlignmentStart", 22); var Yv; $.AlignmentEnd = Yv = w.p($, "AlignmentEnd", 23); var Ov; $.AlignmentBus = Ov = w.p($, "AlignmentBus", 24); var Dv; $.AlignmentBusBranching = Dv = w.p($, "AlignmentBusBranching", 25); var Pv; $.AlignmentTopLeftBus = Pv = w.p($, "AlignmentTopLeftBus", 26); var Qv; $.AlignmentBottomRightBus = Qv = w.p($, "AlignmentBottomRightBus", 27); var Tv; $.CompactionNone = Tv = w.p($, "CompactionNone", 30); var Vv; $.CompactionBlock = Vv = w.p($, "CompactionBlock", 31); var nv; $.StyleLayered = nv = w.p($, "StyleLayered", 40); var Hv; $.StyleLastParents = Hv = w.p($, "StyleLastParents", 41); var Gv; $.StyleAlternating = Gv = w.p($, "StyleAlternating", 42); var Fv; $.StyleRootOnly = Fv = w.p($, "StyleRootOnly", 43); var pv; $.ArrangementVertical = pv = w.p($, "ArrangementVertical", 50); var Ww; $.ArrangementHorizontal = Ww = w.p($, "ArrangementHorizontal", 51); var sv; $.ArrangementFixedRoots = sv = w.p($, "ArrangementFixedRoots", 52); var ov; $.LayerIndividual = ov = w.p($, "LayerIndividual", 60); var Bv; $.LayerSiblings = Bv = w.p($, "LayerSiblings", 61); var Av; $.LayerUniform = Av = w.p($, "LayerUniform", 62); function rv() { tg.call(this) } w.Ka(rv, tg); w.ga("TreeNetwork", rv); rv.prototype.createVertex = function () { return new qv }; rv.prototype.createEdge = function () { return new Yw }; function qv() { ns.call(this); this.initialized = !1; this.parent = null; this.children = []; this.maxGenerationCount = this.maxChildrenCount = this.descendantCount = this.level = 0; this.comments = null; this.pa = new z(0, 0); this.kb = new ia(0, 0); this.Na = new z(0, 0); this.oq = this.nq = this.yJ = !1; this.Eu = this.ku = null; this.sorting = Iv; this.comparer = ts; this.angle = 0; this.alignment = Mv; this.nodeIndentPastParent = this.nodeIndent = 0; this.nodeSpacing = 20; this.layerSpacing = 50; this.layerSpacingParentOverlap = 0; this.compaction = Vv; this.breadthLimit = 0; this.rowSpacing = 25; this.commentSpacing = this.rowIndent = 10; this.commentMargin = 20; this.setsPortSpot = !0; this.portSpot = rc; this.setsChildPortSpot = !0; this.childPortSpot = rc } w.Ka(qv, ns); w.ga("TreeVertex", qv); qv.prototype.copyInheritedPropertiesFrom = function (a) { null !== a && (this.sorting = a.sorting, this.comparer = a.comparer, this.angle = a.angle, this.alignment = a.alignment, this.nodeIndent = a.nodeIndent, this.nodeIndentPastParent = a.nodeIndentPastParent, this.nodeSpacing = a.nodeSpacing, this.layerSpacing = a.layerSpacing, this.layerSpacingParentOverlap = a.layerSpacingParentOverlap, this.compaction = a.compaction, this.breadthLimit = a.breadthLimit, this.rowSpacing = a.rowSpacing, this.rowIndent = a.rowIndent, this.commentSpacing = a.commentSpacing, this.commentMargin = a.commentMargin, this.setsPortSpot = a.setsPortSpot, this.portSpot = a.portSpot, this.setsChildPortSpot = a.setsChildPortSpot, this.childPortSpot = a.childPortSpot) }; w.u(qv, { pn: "childrenCount" }, function () { return this.children.length }); w.defineProperty(qv, { HL: "relativePosition" }, function () { return this.pa }, function (a) { this.pa.set(a) }); w.defineProperty(qv, { UL: "subtreeSize" }, function () { return this.kb }, function (a) { this.kb.set(a) }); w.defineProperty(qv, { TL: "subtreeOffset" }, function () { return this.Na }, function (a) { this.Na.set(a) }); function Yw() { os.call(this); this.Hs = new z(0, 0) } w.Ka(Yw, os); w.ga("TreeEdge", Yw); Yw.prototype.commit = function () { var a = this.link; if (null !== a && !a.Xl) { var b = this.network.Tb, c = null, d = null; switch (b.Mf) { case mv: c = this.fromVertex; d = this.toVertex; break; case tv: c = this.toVertex; d = this.fromVertex; break; default: w.k("Unhandled path value " + b.Mf.toString()) }if (null !== c && null !== d) if (b = this.Hs, 0 !== b.x || 0 !== b.y || c.yJ) { var d = c.gb, e = Wv(c), f = Zv(c), h = c.rowSpacing; a.co(); var k = a.$e === Jj, l = a.ac, m = 0, n, p; a.fm(); if (l || k) { for (m = 2; 4 < a.qa;)a.UF(2); n = a.l(1); p = a.l(2) } else { for (m = 1; 3 < a.qa;)a.UF(1); n = a.l(0); p = a.l(a.qa - 1) } var q = a.l(a.qa - 1), r = 0; 0 === e ? (c.alignment === Yv ? (r = d.bottom + b.y, 0 === b.y && n.y > q.y + c.rowIndent && (r = Math.min(r, Math.max(n.y, r - $v(c))))) : c.alignment === Xv ? (r = d.top + b.y, 0 === b.y && n.y < q.y - c.rowIndent && (r = Math.max(r, Math.min(n.y, r + $v(c))))) : r = c.nq || c.oq && 1 === c.maxGenerationCount ? d.top - c.Na.y + b.y : d.y + d.height / 2 + b.y, k ? (a.w(m, n.x, r), m++ , a.w(m, d.right + f, r), m++ , a.w(m, d.right + f + (b.x - h) / 3, r), m++ , a.w(m, d.right + f + 2 * (b.x - h) / 3, r), m++ , a.w(m, d.right + f + (b.x - h), r), m++ , a.w(m, p.x, r)) : (l && (a.w(m, d.right + f / 2, n.y), m++), a.w(m, d.right + f / 2, r), m++ , a.w(m, d.right + f + b.x - (l ? h / 2 : h), r), m++ , l && a.w(m, a.l(m - 1).x, p.y))) : 90 === e ? (c.alignment === Yv ? (r = d.right + b.x, 0 === b.x && n.x > q.x + c.rowIndent && (r = Math.min(r, Math.max(n.x, r - $v(c))))) : c.alignment === Xv ? (r = d.left + b.x, 0 === b.x && n.x < q.x - c.rowIndent && (r = Math.max(r, Math.min(n.x, r + $v(c))))) : r = c.nq || c.oq && 1 === c.maxGenerationCount ? d.left - c.Na.x + b.x : d.x + d.width / 2 + b.x, k ? (a.w(m, r, n.y), m++ , a.w(m, r, d.bottom + f), m++ , a.w(m, r, d.bottom + f + (b.y - h) / 3), m++ , a.w(m, r, d.bottom + f + 2 * (b.y - h) / 3), m++ , a.w(m, r, d.bottom + f + (b.y - h)), m++ , a.w(m, r, p.y)) : (l && (a.w(m, n.x, d.bottom + f / 2), m++), a.w(m, r, d.bottom + f / 2), m++ , a.w(m, r, d.bottom + f + b.y - (l ? h / 2 : h)), m++ , l && a.w(m, p.x, a.l(m - 1).y))) : 180 === e ? (c.alignment === Yv ? (r = d.bottom + b.y, 0 === b.y && n.y > q.y + c.rowIndent && (r = Math.min(r, Math.max(n.y, r - $v(c))))) : c.alignment === Xv ? (r = d.top + b.y, 0 === b.y && n.y < q.y - c.rowIndent && (r = Math.max(r, Math.min(n.y, r + $v(c))))) : r = c.nq || c.oq && 1 === c.maxGenerationCount ? d.top - c.Na.y + b.y : d.y + d.height / 2 + b.y, k ? (a.w(m, n.x, r), m++ , a.w(m, d.left - f, r), m++ , a.w(m, d.left - f + (b.x + h) / 3, r), m++ , a.w(m, d.left - f + 2 * (b.x + h) / 3, r), m++ , a.w(m, d.left - f + (b.x + h), r), m++ , a.w(m, p.x, r)) : (l && (a.w(m, d.left - f / 2, n.y), m++), a.w(m, d.left - f / 2, r), m++ , a.w(m, d.left - f + b.x + (l ? h / 2 : h), r), m++ , l && a.w(m, a.l(m - 1).x, p.y))) : 270 === e ? (c.alignment === Yv ? (r = d.right + b.x, 0 === b.x && n.x > q.x + c.rowIndent && (r = Math.min(r, Math.max(n.x, r - $v(c))))) : c.alignment === Xv ? (r = d.left + b.x, 0 === b.x && n.x < q.x - c.rowIndent && (r = Math.max(r, Math.min(n.x, r + $v(c))))) : r = c.nq || c.oq && 1 === c.maxGenerationCount ? d.left - c.Na.x + b.x : d.x + d.width / 2 + b.x, k ? (a.w(m, r, n.y), m++ , a.w(m, r, d.top - f), m++ , a.w(m, r, d.top - f + (b.y + h) / 3), m++ , a.w(m, r, d.top - f + 2 * (b.y + h) / 3), m++ , a.w(m, r, d.top - f + (b.y + h)), m++ , a.w(m, r, p.y)) : (l && (a.w(m, n.x, d.top - f / 2), m++), a.w(m, r, d.top - f / 2), m++ , a.w(m, r, d.top - f + b.y + (l ? h / 2 : h)), m++ , l && a.w(m, p.x, a.l(m - 1).y))) : w.k("Invalid angle " + e); a.kj() } else e = c, f = d, a = this.link, c = Wv(e), c !== Wv(f) && (b = Zv(e), d = e.gb, e = f.gb, 0 === c && e.left - d.right < b + 1 || 90 === c && e.top - d.bottom < b + 1 || 180 === c && d.left - e.right < b + 1 || 270 === c && d.top - e.bottom < b + 1 || (a.co(), e = a.$e === Jj, f = a.ac, h = Nv(this.fromVertex.alignment), a.fm(), 0 === c ? (c = d.right + b / 2, e ? 4 === a.qa && (b = a.l(3).y, a.ca(1, c - 20, a.l(1).y), a.w(2, c - 20, b), a.w(3, c, b), a.w(4, c + 20, b), a.ca(5, a.l(5).x, b)) : f ? h ? a.ca(3, a.l(2).x, a.l(4).y) : 6 === a.qa && (a.ca(2, c, a.l(2).y), a.ca(3, c, a.l(3).y)) : 4 === a.qa ? a.w(2, c, a.l(2).y) : 3 === a.qa ? a.ca(1, c, a.l(2).y) : 2 === a.qa && a.w(1, c, a.l(1).y)) : 90 === c ? (b = d.bottom + b / 2, e ? 4 === a.qa && (c = a.l(3).x, a.ca(1, a.l(1).x, b - 20), a.w(2, c, b - 20), a.w(3, c, b), a.w(4, c, b + 20), a.ca(5, c, a.l(5).y)) : f ? h ? a.ca(3, a.l(2).x, a.l(4).y) : 6 === a.qa && (a.ca(2, a.l(2).x, b), a.ca(3, a.l(3).x, b)) : 4 === a.qa ? a.w(2, a.l(2).x, b) : 3 === a.qa ? a.ca(1, a.l(2).x, b) : 2 === a.qa && a.w(1, a.l(1).x, b)) : 180 === c ? (c = d.left - b / 2, e ? 4 === a.qa && (b = a.l(3).y, a.ca(1, c + 20, a.l(1).y), a.w(2, c + 20, b), a.w(3, c, b), a.w(4, c - 20, b), a.ca(5, a.l(5).x, b)) : f ? h ? a.ca(3, a.l(2).x, a.l(4).y) : 6 === a.qa && (a.ca(2, c, a.l(2).y), a.ca(3, c, a.l(3).y)) : 4 === a.qa ? a.w(2, c, a.l(2).y) : 3 === a.qa ? a.ca(1, c, a.l(2).y) : 2 === a.qa && a.w(1, c, a.l(1).y)) : 270 === c && (b = d.top - b / 2, e ? 4 === a.qa && (c = a.l(3).x, a.ca(1, a.l(1).x, b + 20), a.w(2, c, b + 20), a.w(3, c, b), a.w(4, c, b - 20), a.ca(5, c, a.l(5).y)) : f ? h ? a.ca(3, a.l(2).x, a.l(4).y) : 6 === a.qa && (a.ca(2, a.l(2).x, b), a.ca(3, a.l(3).x, b)) : 4 === a.qa ? a.w(2, a.l(2).x, b) : 3 === a.qa ? a.ca(1, a.l(2).x, b) : 2 === a.qa && a.w(1, a.l(1).x, b)), a.kj())) } }; w.defineProperty(Yw, { GL: "relativePoint" }, function () { return this.Hs }, function (a) { this.Hs.set(a) }); function Zw() { G.call(this); this.Te = null } w.Ka(Zw, G); Zw.prototype.cloneProtected = function (a) { G.prototype.cloneProtected.call(this, a); a.element = this.Te.cloneNode(!0) }; Zw.prototype.toString = function () { return "HTMLHost(" + this.Te.toString() + ")#" + w.Nd(this) }; Zw.prototype.yk = function (a, b) { var c = this.Te; if (null !== c) { var d = this.Wa(Hb); d.x -= this.Y.width / 2; d.y -= this.Y.height / 2; d.x -= this.Y.x; d.y -= this.Y.y; var d = b.yG(d), e = b.nj; null === e || e.contains(c) || e.appendChild(c); e = this.transform; c.style.transform = "matrix(" + e.m11 + "," + e.m12 + "," + e.m21 + "," + e.m22 + "," + e.dx + "," + e.dy + ")"; c.style.transformOrigin = "0 0"; e = d.y; c.style.left = d.x + "px"; c.style.top = e + "px" } }; Zw.prototype.Nn = function (a, b, c, d) { var e = this.Ca; isFinite(e.width) && (a = e.width); isFinite(e.height) && (b = e.height); var e = this.Ff, f = this.Bh; c = Math.max(c, f.width); d = Math.max(d, f.height); a = Math.min(e.width, a); b = Math.min(e.height, b); a = Math.max(c, a); b = Math.max(d, b); c = this.Te; null !== c && (b = c.getBoundingClientRect(), a = b.width, b = b.height); Pa(this.Uc, a, b); Bo(this, 0, 0, a, b) }; Zw.prototype.jj = function (a, b, c, d) { Go(this, a, b, c, d) }; w.u(Zw, { Ja: "naturalBounds" }, function () { return this.Uc }); w.defineProperty(Zw, { element: "element" }, function () { return this.Te }, function (a) { var b = this.Te; b !== a && (a instanceof HTMLElement || w.k("HTMLHost.element must be an instance of Element."), this.Te = a, a.className = "HTMLHost", this.h("element", b, a), this.na()) }); ca.version = "1.7.17"; window && (window.module && "object" === typeof window.module && "object" === typeof window.module.exports ? window.module.exports = ca : window.define && "function" === typeof window.define && window.define.amd ? (window.go = ca, window.define(ca)) : window.go = ca); "undefined" !== typeof module && "object" === typeof module.exports && (module.exports = ca); })(window);